From 5f010ecd7515753c0bf3c4991b0f4692cf35939d Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Wed, 12 Feb 2025 08:52:24 +0100 Subject: [PATCH] Fix docs - escape the "{rootPath}" - fixes #105 --- README.md | 12 ++++++------ .../ROOT/pages/includes/quarkus-mcp-server-sse.adoc | 2 +- .../includes/quarkus-mcp-server-sse_quarkus.mcp.adoc | 2 +- docs/modules/ROOT/pages/index.adoc | 8 +++++--- .../sse/runtime/config/McpSseBuildTimeConfig.java | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c04c5f0..37d18b9 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ _"[Model Context Protocol](https://modelcontextprotocol.io/) (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools."_ -This extension provides a declarative API that enables developers to implement the MCP server features easily. +This extension provides declarative and programmatic APIs that enable developers to implement the MCP server features easily. ## Get Started @@ -45,9 +45,9 @@ public class ServerFeatures { @Inject CodeService codeService; - @Tool - TextContent toLowerCase(String value) { - return new TextContent(value.toLowerCase()); + @Tool(description = "Converts the string value to lower case") + String toLowerCase(String value) { + return value.toLowerCase(); } @Prompt(name = "code_assist") @@ -56,8 +56,8 @@ public class ServerFeatures { } @Resource(uri = "file:///project/alpha") - BlobResourceContents alpha(String uri) throws IOException{ - return BlobResourceContents.create(uri, Files.readAllBytes(Paths.ALPHA)); + BlobResourceContents alpha(RequestUri uri) throws IOException{ + return BlobResourceContents.create(uri.value(), Files.readAllBytes(Paths.ALPHA)); } } diff --git a/docs/modules/ROOT/pages/includes/quarkus-mcp-server-sse.adoc b/docs/modules/ROOT/pages/includes/quarkus-mcp-server-sse.adoc index e6dbf11..e03383e 100644 --- a/docs/modules/ROOT/pages/includes/quarkus-mcp-server-sse.adoc +++ b/docs/modules/ROOT/pages/includes/quarkus-mcp-server-sse.adoc @@ -11,7 +11,7 @@ a|icon:lock[title=Fixed at build time] [[quarkus-mcp-server-sse_quarkus-mcp-serv [.description] -- -The SSE endpoint is exposed at `{rootPath}/sse`. By default, it's `/mcp/sse`. +The SSE endpoint is exposed at `\{rootPath}/sse`. By default, it's `/mcp/sse`. ifdef::add-copy-button-to-env-var[] diff --git a/docs/modules/ROOT/pages/includes/quarkus-mcp-server-sse_quarkus.mcp.adoc b/docs/modules/ROOT/pages/includes/quarkus-mcp-server-sse_quarkus.mcp.adoc index e6dbf11..e03383e 100644 --- a/docs/modules/ROOT/pages/includes/quarkus-mcp-server-sse_quarkus.mcp.adoc +++ b/docs/modules/ROOT/pages/includes/quarkus-mcp-server-sse_quarkus.mcp.adoc @@ -11,7 +11,7 @@ a|icon:lock[title=Fixed at build time] [[quarkus-mcp-server-sse_quarkus-mcp-serv [.description] -- -The SSE endpoint is exposed at `{rootPath}/sse`. By default, it's `/mcp/sse`. +The SSE endpoint is exposed at `\{rootPath}/sse`. By default, it's `/mcp/sse`. ifdef::add-copy-button-to-env-var[] diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc index 94d0485..da9ef5a 100644 --- a/docs/modules/ROOT/pages/index.adoc +++ b/docs/modules/ROOT/pages/index.adoc @@ -4,12 +4,12 @@ include::./includes/attributes.adoc[] _"https://modelcontextprotocol.io/[Model Context Protocol] (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools."_ -This extension provides a declarative API that enables developers to implement the MCP server features easily. +This extension provides declarative and programmatic APIs that enable developers to implement the MCP server features easily. == Supported transports MCP currently defines two standard transports for client-server communication. -This extension supports both transports and defines a unified declarative API. +This extension supports both transports and defines a unified API to define server features. In other words, the server features are defined with the same API but the selected transport determines the way the MCP server communicates with clients. If you want to use the https://spec.modelcontextprotocol.io/specification/2024-11-05/basic/transports/#stdio[stdio] transport you'll need to add the `io.quarkiverse.mcp:quarkus-mcp-server-stdio` extension to your build file first. @@ -38,7 +38,9 @@ For instance, with Maven, add the following dependency to your POM file: ---- -TIP: The SSE endpoint is exposed at `{rootPath}/sse`. The `{rootPath}` is set to `mcp` by default, but it can be changed with the `quarkus.mcp.server.sse.root-path` configuration property. +// We need to escape the {rootPath} +// https://github.com/quarkiverse/quarkus-mcp-server/issues/105 +TIP: The SSE endpoint is exposed at `\{rootPath}/sse`. The `\{rootPath}` is set to `mcp` by default, but it can be changed with the `quarkus.mcp.server.sse.root-path` configuration property. == Supported server features diff --git a/transports/sse/runtime/src/main/java/io/quarkiverse/mcp/server/sse/runtime/config/McpSseBuildTimeConfig.java b/transports/sse/runtime/src/main/java/io/quarkiverse/mcp/server/sse/runtime/config/McpSseBuildTimeConfig.java index 92de4ba..1c201f4 100644 --- a/transports/sse/runtime/src/main/java/io/quarkiverse/mcp/server/sse/runtime/config/McpSseBuildTimeConfig.java +++ b/transports/sse/runtime/src/main/java/io/quarkiverse/mcp/server/sse/runtime/config/McpSseBuildTimeConfig.java @@ -10,7 +10,7 @@ public interface McpSseBuildTimeConfig { /** - * The SSE endpoint is exposed at `{rootPath}/sse`. By default, it's `/mcp/sse`. + * The SSE endpoint is exposed at `\{rootPath}/sse`. By default, it's `/mcp/sse`. * * @asciidoclet */