MCP Java API support and MBean name updates in mcpServer-1.0 for Open Liberty 26.0.0.9-beta
This beta release updates mcpServer-1.0 to use the MCP Java API (org.mcpjava), improves MCP metrics MBean naming, and fixes the MCP endpoint URL log message. Open Liberty 26.0.0.9-beta is targeted at application developers building MCP-enabled Liberty applications.
The Open Liberty 26.0.0.9-beta includes the following beta features (along with all GA features):
See also previous Open Liberty beta blog posts.
MCP Java API support in mcpServer-1.0
The Model Context Protocol (MCP) is an open standard that enables AI applications to access real-time data and business logic from external sources. The mcpServer-1.0 feature lets application developers expose application tools and data for use in agentic AI workflows.
mcpServer-1.0 now uses the MCP Java API (org.mcpjava), which is published on Maven Central. Previously, the types used to write MCP tools were in Open Liberty API packages.
Since this is a significant change, a new blog post about the MCP feature, with examples of the new API, has also been published. See Getting started with mcpServer-1.0 for detailed instructions on how to get started with this feature.
| This is a breaking change. Existing code will not compile against the new API. In most cases, only the imports need to change. |
Add the dependency to your project
For Maven, add the following to your pom.xml:
<dependency>
<groupId>org.mcpjava</groupId>
<artifactId>mcp-server-api</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
For Gradle, add the following to your build.gradle:
compileOnly("org.mcpjava:mcp-server-api:1.0.0")
Import changes
The core annotations and types have moved from io.openliberty.mcp. to org.mcpjava.server.:
| Before (26.0.0.8-beta) | After (26.0.0.9-beta) |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The following Liberty-specific types remain in their existing packages and are unchanged:
-
io.openliberty.mcp.tools.ToolCallException -
io.openliberty.mcp.tools.ToolManager -
io.openliberty.mcp.annotations.Schema -
io.openliberty.mcp.annotations.DefaultValueConverter
Builder pattern for content types
A notable change in the MCP Java API is that content types are now created using builders rather than constructors. The TextContent.of(…) static factory method is still available for simple cases, but richer types such as ImageContent, which support annotations, now use a builder:
// Before
ImageContent image = new ImageContent(data, "image/png");
// After — simple case
ImageContent image = ImageContent.of(data, "image/png");
// After — with annotations
ImageContent image = ImageContent.builder(data, "image/png")
.setAnnotations(annotations)
.build();
See the MCP Java API Javadoc for the full API reference.
Although the MCP Java API includes types for prompts and resources, mcpServer-1.0 currently supports only tools. The prompt and resource parts of the API are not yet supported in Liberty.
|
MCP metrics: MBean names now use individual JMX ObjectName keys
Open Liberty 26.0.0.9-beta updates the MCP metrics MBeans introduced in 26.0.0.8-beta. Each McpOperationStatisticsMXBean and McpSessionStatisticsMXBean instance is now registered with its MCP attributes as individual keys in the JMX ObjectName, rather than encoded into a single opaque name value.
Before (26.0.0.8-beta):
WebSphere:type=McpOperation,name="mcpMethod:tools/call;rpcStatus:ok;netProto:HTTP"
After (26.0.0.9-beta):
WebSphere:type=McpOperation,mcpMethod=tools/call,rpcStatus=ok,netProto=HTTP,...
This change makes it easier to filter and query these MBeans based on their individual attribute values.
| This is a breaking change from 26.0.0.8-beta. If you have existing JMX queries or scripts written against the 26.0.0.8-beta MBean names, you must update them. |
Bug fixes
MCP server endpoint URL log message updated
The info message that includes the MCP endpoint URL has been updated to include a message code. It now looks like this:
CWMCM0008I: The MCP server endpoint: http://localhost:9080/myApp/mcp
Try it now
To try out these features, update your build tools to pull the Open Liberty All Beta Features package instead of the main release. To enable the MCP server feature, see Getting started with mcpServer-1.0 for detailed instructions. Note that mcpServer-1.0 requires Java SE 17 or later. The beta works with Java SE 25, Java SE 21, Java SE 17, Java SE 11, and Java SE 8.
If you’re using Maven, you can install the All Beta Features package using:
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.12.2</version>
<configuration>
<runtimeArtifact>
<groupId>io.openliberty.beta</groupId>
<artifactId>openliberty-runtime</artifactId>
<version>26.0.0.9-beta</version>
<type>zip</type>
</runtimeArtifact>
</configuration>
</plugin>
You must also add dependencies to your pom.xml file for the beta version of the APIs that are associated with the beta features that you want to try. For mcpServer-1.0, add the MCP Java API dependency:
<dependency>
<groupId>org.mcpjava</groupId>
<artifactId>mcp-server-api</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
Or for Gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'io.openliberty.tools:liberty-gradle-plugin:4.0.1'
}
}
apply plugin: 'liberty'
dependencies {
libertyRuntime group: 'io.openliberty.beta', name: 'openliberty-runtime', version: '[26.0.0.9-beta,)'
}
Or if you’re using container images:
FROM icr.io/appcafe/open-liberty:beta
Or take a look at our Downloads page.
If you’re using IntelliJ IDEA, Visual Studio Code or Eclipse IDE, you can also take advantage of our open source Liberty developer tools to enable effective development, testing, debugging and application management all from within your IDE.
For more information on using a beta release, refer to the Installing Open Liberty beta releases documentation.
We welcome your feedback
Let us know what you think on our mailing list. If you hit a problem, post a question on StackOverflow. If you hit a bug, please raise an issue.