Repository navigation
Documentation, MCP server non-reference #8493
Description
Feature epic details
- For the title of this issue, type: Documentation, MCP server non-reference
- Link to development epic: Model Context Protocol (MCP) server #32710
- Target GA release: 26.0.0.9
Operating systems
Does the documentation apply to all operating systems?
- Yes
Summary
Provide the ability for Open Liberty to act as an MCP Server, giving developers the ability to define Tools, Resources, Prompts for use by AI Apps.
Model Context Protocol (MCP) is an open standard that enables AI applications to interact with and utilise external systems. The mcp-1.0 feature for Open Liberty allows developers to expose the business logic of their applications, making it discoverable, understandable, and invocable by AI applications.
Configuration
The mcp-1.0 feature uses the https://github.com/mcp-java/java-mcp-annotations[`mcp-java` API] (org.mcpjava:mcp-server-api), which is available on Maven Central.
Add the following dependency to your pom.xml:
<!-- MCP Server API -->
<dependency>
<groupId>org.mcpjava</groupId>
<artifactId>mcp-server-api</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>Some features - such as @Schema, DefaultValueConverter, ToolManager, and ToolResponseEncoder - are provided by the io.openliberty.mcp jar that ships with Liberty. To make these available on the build path, you need to add a system-scoped dependency in your pom.xml that points to this jar.
First, locate the io.openliberty.mcp_*.jar in <wlp>/dev/api/ibm/ and note the version suffix (e.g. 1.0.106). Then define the following properties in your pom.xml:
<properties>
<wlp-dir-path>replace-with-path-to-wlp-dir</wlp-dir-path>
<mcp-jar-version>replace-with-version-number</mcp-jar-version>
</properties>Then add the dependency:
<!-- Liberty MCP extensions (io.openliberty.mcp) -->
<dependency>
<groupId>io.openliberty.mcp</groupId>
<artifactId>mcp-core</artifactId>
<version>${mcp-jar-version}</version>
<scope>system</scope>
<systemPath>${wlp-dir-path}/dev/api/ibm/io.openliberty.mcp_${mcp-jar-version}.jar</systemPath>
</dependency>=== Enable the feature
Add mcp-1.0 to your server.xml:
<featureManager>
<feature>servlet-6.0</feature>
<feature>cdi-4.0</feature>
<feature>mcp-1.0</feature>
</featureManager> Updates to existing topics
It should not update any existing topics.
Create a new topic
This documentation should act as a concise tutorial for the MCP feature.
We should discuss with the docs team to identify what documentation is expected for liberty features.
As a starting point, we should have a step-by-step guide to getting started and registering a tool, which we can then build on to explain more advanced features.
In principle, the list of actions/functionalities that need to be cover is the following:
- registering tools
- providing tool arguments
- using structured content
- registering encoders
- throwing exceptions
- handling cancellation
- writing asynchronous tools
- programmatically registering tools
- stateless mode
- endpoint configuration
Each entry should also note whether there are any restrictions (e.g. cancellation does not work in stateless mode, structured content only works for clients which support version 2025-06-18 or later)
Activity
[-]Documentation, MCP server non-reference documentation[/-][+]Documentation, MCP server non-reference[/+]TheoGkoumas commentedon Aug 12, 2026
New entry added (named as
MCP Servers) on navigation pane, under Development, pointing to the new doc.8493-liberty-mcp-servers-1
8493-liberty-mcp-servers-2
ramkumar-k-9286 commentedon Aug 19, 2026
Hi @TheoGkoumas
I moved the information in the PR you created into one of my PR and merged the information.
Please check and let me know.
Draft site link:
https://draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/liberty-mcp-server.html
You can close your PR.
Regards,
Ramkumar
CC @jantley-ibm @chirp1
IssacAX123 commentedon Aug 21, 2026
@ramkumar-k-9286 I have directly made changes in this PR #8500. There's a new security docs page and the main mcp server page has minor content removals and rewrites
new-file-liberty-mcp-server-security-1
ramkumar-k-9286 commentedon Aug 21, 2026
Hi @TheoGkoumas @IssacAX123 @Azquelt
I moved the information in the PR you #8500 into one of my PR and merged the information.
Please check and let me know.
Draft site link:
https://draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/liberty-mcp-server.html
https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/liberty-mcp-server-security.html
You can close your PR.
Regards,
Ramkumar
CC @jantley-ibm @chirp1
Azquelt commentedon Aug 21, 2026
Thanks for pulling in the updates, I've been held up sorting out a build issue but I will review and make comments here.
Azquelt commentedon Aug 24, 2026
The PR has some changes to the main page which aren't yet reflected in the draft.
Can you make the changes to
liberty-mcp-server.adocfrom these commits, aside from the one that I've left a comment on please? https://github.com/OpenLiberty/docs/pull/8500/changes/7af6f0f0eb0cf12a0795e1ec33bd5b43c5b08d85..8b6cc66eea8c7cfc4d809fe6293d91d9ce873f47#diff-b8f19b52f8eba5d170bd3eb4d69a3ec6a6eceacea0fe0563a76945ed96295700I'll continue reviewing, assuming those changes will be made.
Azquelt commentedon Aug 24, 2026
I think we should improve the flow of the getting started section and separate it from the more in-depth documentation about tools.
Please make the following changes:
At the end of the section "Enable the feature", add this as a Note:
The
mcp-1.0feature is compatible with Jakarta EE 10 and EE 11 featuresBefore the section "Find your MCP endpoint URL", add a new section "Register a tool":
Tools are registered by creating a public method on a CDI bean and annotating it with
@ToolMove the section "Test with the MCP Inspector" before "Connect an AI client"
In "Connect an AI client", I would suggest we separate the example from the instructive text. Start a new paragraph at "For example".
Add a new level 2 heading "Developing tools" before the level 3 heading "Registering tools"
After these changes, the outline should look like this:
Azquelt commentedon Aug 26, 2026
Ok, I've gone through it again and picked up some more changes:
mcp-1.0feature only supports Tools. For more information see <>mcp-1.0feature uses themcp-javaAPI (org.mcpjava:mcp-server-api)" to "Themcp-1.0feature uses the org.mcpjava API"You an send an error response by returning a
ToolResponse. (Include the example above here)ToolCallException. In this case the tool method does not need to returnToolResponse. The message of theToolCallExceptionwill be return to the client as the error message.(ToolCallException example here)
Other exceptions can also be automatically wrapped by a
ToolCallExceptionby annotating the method with@WrapBusinessException. The message of the exception will still be return directly to the client as the error message, so check carefully whether the error message makes sense to the client and that it doesn't reveal any sensitive information from the server. In many cases, it may be better to catch and handle the exception yourself and create a better error message.(WrapBusinessException example here)
ToolCallException, then a general "Server error" response is sent to the client and details of the exception will be logged to the server log."Call
cancellation.check().isRequested()periodically and throwCancellation.OperationCancelledExceptionto stop execution cleanly"to
"Call
cancellation.skipProcessingIfCancelled()periodically which will throwCancellation.OperationCancelledExceptionif the tool call has been cancelled. It's also possible to callcancellation.check()to handle cancellation yourself."<mcpServer>needs changed to<mcp>- we changed the name of this config element in Update feature name and config element tomcp-1.0open-liberty#35365Cancellationin the cancellation section). These render fine on github but don't render well on docs site. Unless we can get the styling changed, please change these to be just a link without code tags.8493-liberty-mcp-servers-3
ramkumar-k-9286 commentedon Aug 28, 2026
Hi @Azquelt
@TheoGkoumas @IssacAX123
I have incorporated the comments from the other PR as well as the previous comments mentioned in this issue.
Draft site link:
https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/liberty-mcp-server.html
https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/liberty-mcp-server-security.html
Regards,
Ramkumar
I have used BOB for grammar and style checks on these pages. You may find sentences that have been rephrased. FYI
Pending Items as mentioned in comments from @Azquelt
Azquelt commentedon Sep 1, 2026
I had a quick read through and spotted this:
In "Securing an MCP server" - "Controlling access per tool"
Should be
And in the following code sample
Should be
I'll get the updated examples to you tomorrow morning.
Azquelt commentedon Sep 2, 2026
New example for asynchronous tools: (The old example was from our tests. It wasn't wrong, but it didn't make sense as an example because there wasn't any need or benefit from it being asynchronous. This new example uses restfulWS async client which, in principle, saves server resources by being asynchronous.)
New example for programmatic registration: (it's the same, except it does the CDI lifecycle correctly)
Azquelt commentedon Sep 2, 2026
Change
to
Add this gradle example for MCP Server API:
providedCompile 'org.mcpjava:mcp-server-api:1.0.0'Add this gradle example for the Liberty MCP extensions:
providedCompile 'io.openliberty.api:io.openliberty.mcp:1.0.117'8493-liberty-mcp-servers-4
ramkumar-k-9286 commentedon Sep 2, 2026
Hi @Azquelt @IssacAX123
I have incorporated the comments from the other PR as well as the previous comments mentioned in this issue.
Draft site link:
https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/liberty-mcp-server.html
https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/liberty-mcp-server-security.html
Note: I have used BOB for grammar and style checks on these pages. You may find sentences that have been rephrased. FYI
Regards,
Ramkumar
Azquelt commentedon Sep 2, 2026
The maven and gradle examples are both showing together, with a dark grey box around them, rather than in tabs.
If we can't do tabs, then I think we would be better off just having them one after another without the big grey box if possible. It stands out to an extent that isn't justified by the content, unfortunately.
Azquelt commentedon Sep 2, 2026
Alternatively, we can revert back to just the maven example if that's easier.
Azquelt commentedon Sep 2, 2026
Other than that formatting issue, it looks good to me, so I'll tag with
developer reviewed8493-liberty-mcp-servers-5
ramkumar-k-9286 commentedon Sep 3, 2026
Hi @Azquelt
Suggested correction done.
https://draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/liberty-mcp-server.html
https://draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/liberty-mcp-server-security.html
Please let me know if you are fine with this.
Regards,
Ramkumar
Azquelt commentedon Sep 3, 2026
@ramkumar-k-9286 Looks good, thanks
ramkumar-k-9286 commentedon Sep 11, 2026
Published [26.0.0.9 release].