Skip to content

[MCP Servers] non-reference documentation - #8500

Open
TheoGkoumas wants to merge 5 commits into
draftfrom
8493-mcp-non-ref
Open

[MCP Servers] non-reference documentation#8500
TheoGkoumas wants to merge 5 commits into
draftfrom
8493-mcp-non-ref

Conversation

@TheoGkoumas

Copy link
Copy Markdown
Member

Resolves #8493

@TheoGkoumas

Copy link
Copy Markdown
Member Author

Please note that this is a new documentation referred to a new section, called MCP Servers.
It is currently bound on a new single entry in navigation menu, pointing to the new doc.
Please confirm that this is the proper way to be added in navigation.

Comment thread modules/ROOT/pages/liberty-mcp-server.adoc Outdated
Comment thread modules/ROOT/pages/liberty-mcp-server.adoc Outdated
Comment thread modules/ROOT/pages/liberty-mcp-server.adoc Outdated
Comment thread modules/ROOT/pages/liberty-mcp-server.adoc Outdated
Comment thread modules/ROOT/pages/liberty-mcp-server.adoc Outdated
Comment on lines +516 to +530
[[stateless-mode]]
=== Stateless mode

NOTE: In stateless mode, features that rely on per-client session state — including cancellation — are not available. Each request is handled independently with no shared state between calls.

By default, `mcp-1.0` maintains sessions to associate requests from the same client. In horizontally scaled or clustered deployments where requests can be routed to different server instances, enable stateless mode to remove this session affinity:

[source,xml]
----
<application location="myMcpApp.war">
<mcpServer stateless="true"/>
</application>
----

In stateless mode, each incoming request is processed independently. This makes the server suitable for load-balanced environments where there is no sticky session routing, but the trade-off is that client-driven cancellation of in-flight tool calls is not supported.

@Azquelt Azquelt Aug 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to start this section by saying that MCP is a stateful protocol (up to version 2025-11-25) and that requests from the same MCP session must be handled by the same server. In a clustered environment, this requires a load balancer that can route requests based on the Mcp-Session-Id header.

To allow easier deployment in a cluster, it's possible to disable stateful features so that special routing rules are not required.

The trade-off is that client-driven cancellation of in-flight tool calls is not supported.

((explain config))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Section has been updated

Comment on lines +549 to +551
==== Server description and metadata

During MCP initialisation, the server sends a `serverInfo` block containing the server name, version, and description. Configure it with the nested `<info>` element:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should highlight that some AI applications may display this information to the user, since that explains why it's important to set it.

@Azquelt

Azquelt commented Aug 12, 2026

Copy link
Copy Markdown
Member

We should include something about which versions of the MCP protocol we support (2025-11-25, 2025-06-18 and 2025-03-26) and which features of MCP we support (mostly to highlight which features we don't support).

Some of this information could possibly go on the feature reference doc page.

Comment on lines +93 to +100
=== Test with the MCP Inspector

The https://github.com/modelcontextprotocol/inspector[MCP Inspector] is an open-source browser UI that lets you browse and invoke tools on any MCP server. It is the easiest way to verify your tools are registered correctly before connecting a full AI agent. With `npm` installed, run:

[source,sh]
----
npx @modelcontextprotocol/inspector
----

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like we're asking users to test the server before they've added a tool to it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephrased to make more sense.

@TheoGkoumas
TheoGkoumas requested a review from Azquelt August 12, 2026 15:02
Comment thread modules/ROOT/pages/liberty-mcp-server.adoc
Comment thread modules/ROOT/pages/liberty-mcp-server.adoc
Comment thread modules/ROOT/pages/liberty-mcp-server.adoc
Comment thread modules/ROOT/pages/liberty-mcp-server.adoc
Comment on lines +246 to +252
=== Using structured content

NOTE: Structured content is only returned to clients that negotiate MCP protocol version `2025-06-18` or later. Clients using earlier protocol versions receive the unstructured text content only.

When `structuredContent = true` on `@Tool`, Liberty serialises the return value as JSON and includes it in the `structuredContent` field of the tool response alongside the unstructured text representation. This allows clients to consume a strongly-typed object rather than parsing text.

The following example returns a `City` record as both unstructured text (the default JSON serialisation) and as structured JSON content:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a bit more of an explanation of stuctured vs. unstructured data in MCP and that unstructured is the default because AI deals well with unstructured data.

We can also mention that when returning structured data, the json representation is also returned as unstructured text for backwards compatibility.

@Azquelt

Azquelt commented Aug 12, 2026

Copy link
Copy Markdown
Member

We also need documentation on securing access to MCP servers, including how to set up the openidConnectClient-1.0 feature with protected resource metadata. Since this is a fairly large topic, I would make it a second page below MCP Servers in the nav.

Comment on lines +509 to +512
To allow easier deployment in a cluster, it's possible to disable stateful features so that special routing rules are not required.
The trade-off is that client-driven cancellation of in-flight tool calls is not supported.

NOTE: In stateless mode, features that rely on per-client session state — including cancellation — are not available. Each request is handled independently with no shared state between calls.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're repeating ourself here.

@ramkumar-k-9286

Copy link
Copy Markdown
Contributor

Please do not merge the PR - I have moved the contents of this PR separately into draft.

Once the Draft site is up - I will share the Draft link in issue.

Regards,
Ramkumar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants