You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
seo-title: Support for the Model Context Protocol within Open Liberty - OpenLiberty.io
9
-
seo-description: Learn how to use the MCP Server feature within your Liberty application to allow your business logic to be utilized within an agentic AI workflow.
10
-
blog_description: Learn how to use the MCP Server feature within your Liberty application to allow your business logic to be utilized within an agentic AI workflow.
9
+
seo-description: Learn how to use the MCP Server beta feature within your Liberty application to allow your business logic to be utilized within an agentic AI workflow.
10
+
blog_description: Learn how to use the MCP Server beta feature within your Liberty application to allow your business logic to be utilized within an agentic AI workflow.
Model Context Protocol (MCP) is an open standard that enables AI applications to interact with and utilize external systems.
23
23
24
-
The Liberty **MCP Server feature** allows developers to expose the business logic of their applications, making it discoverable, understandable, and usable by AI applications.
24
+
The Liberty **MCP Server beta feature** allows developers to expose the business logic of their applications, making it discoverable, understandable, and usable by AI applications.
25
25
26
26
27
27
== The Power of MCP
@@ -31,8 +31,8 @@ Consider a scenario where your company provides weather forecasting services tha
31
31
32
32
A more effective solution is to enable the AI to access current weather data through tools exposed by your Liberty application. This allows the AI to retrieve up-to-date forecast information whenever needed, ensuring responses are always based on the most current data available, without the need for AI model retraining.
33
33
34
-
== How to Use the Liberty MCP Server Feature
35
-
The Liberty MCP Server feature enables a Liberty server to communicate with agentic AI workflows through the MCP protocol. This protocol provides a standardized way for AI applications to discover and utilize the business logic within your application.
34
+
== How to Use the Liberty MCP Server Beta Feature
35
+
The Liberty MCP Server beta feature enables a Liberty server to communicate with agentic AI workflows through the MCP protocol. This protocol provides a standardized way for AI applications to discover and utilize the business logic within your application.
36
36
37
37
The MCP endpoint is available at `/mcp` under your application's context root. For example, if you see this in your logs:
38
38
```
@@ -45,7 +45,7 @@ To test your MCP server, you can use the https://modelcontextprotocol.io/docs/to
45
45
=== Declaring an MCP Tool
46
46
To expose your business logic to authorized AI applications, you'll need to declare it as an https://modelcontextprotocol.io/specification/2025-06-18/server/tools[MCP tool]. In this context, a tool is a function or operation that the AI can invoke to perform a specific task.
47
47
48
-
You can easily declare a tool with the Liberty MCP Server feature by adding the `@Tool` annotation to your desired Java method. This annotation makes your method automatically discoverable by the Liberty MCP Server feature to make the method available for AI applications to invoke.
48
+
You can easily declare a tool with the Liberty MCP Server beta feature by adding the `@Tool` annotation to your desired Java method. This annotation makes your method automatically discoverable by the Liberty MCP Server beta feature to make the method available for AI applications to invoke.
49
49
50
50
For this discovery mechanism to work, your Java method must be defined within a https://openliberty.io/docs/latest/cdi-beans.html[CDI managed bean] that has an appropriate scope annotation (e.g., `@ApplicationScoped` or `@RequestScoped`).
51
51
@@ -94,9 +94,9 @@ Note that the AI model will use the description to decide when to call a tool an
94
94
95
95
96
96
== Supported MCP Functionality
97
-
Much of the MCP specification's functionality is optional to implement, allowing for gradual adoption while maintaining compatibility. The `mcpServer-1.0` feature has implemented support for the tool feature of the MCP Server specification, along with the tool related capabilities listed below.
97
+
Much of the MCP specification's functionality is optional to implement, allowing for gradual adoption while maintaining compatibility. The `mcpServer-1.0` beta feature has implemented support for the tool feature of the MCP Server specification, along with the tool related capabilities listed below.
98
98
99
-
The `mcpServer-1.0` feature supports communicating using both version https://modelcontextprotocol.io/specification/2025-06-18[2025-06-18] and version https://modelcontextprotocol.io/specification/2025-03-26[2025-03-26] of the MCP protocol.
99
+
The `mcpServer-1.0` beta feature supports communicating using both version https://modelcontextprotocol.io/specification/2025-06-18[2025-06-18] and version https://modelcontextprotocol.io/specification/2025-03-26[2025-03-26] of the MCP protocol.
100
100
101
101
=== Tool Metadata hints (Annotations)
102
102
You can provide hints about the scope and range of your tool to give the AI application an indication of how safe the tool is to call. For example, you can indicate whether calling your tool may modify data. Note that although the MCP specification refers to these hints as https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations["Tool Annotations"], they are unrelated to Java annotations.
@@ -137,8 +137,8 @@ public String bigComputationTool(Cancellation cancellation) {
137
137
}
138
138
----
139
139
140
-
== How to Try the MCP Server Feature
141
-
Here are the simple steps to follow to try out the MCP Server feature `mcpServer-1.0`:
140
+
== How to Try the MCP Server Beta Feature
141
+
Here are the simple steps to follow to try out the MCP Server beta feature `mcpServer-1.0`:
142
142
143
143
1. Download the Open Liberty All Beta Features package from https://openliberty.io/start/#runtime_betas[here]
144
144
2. Unzip the archive. You should have a `wlp` folder
0 commit comments