Skip to content

Commit 003e2b9

Browse files
updates to 26.0.0.2-beta blog
1 parent 04895fc commit 003e2b9

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

posts/2026-02-10-26.0.0.2-beta.adoc

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ categories: blog
66
author_picture: https://avatars3.githubusercontent.com/navaneethsnair1
77
author_github: https://github.com/navaneethsnair1
88
seo-title: "Model Context Protocol Server 1.0 updates and more in 26.0.0.2-beta- OpenLiberty.io"
9-
seo-description: This beta release enhances the mcpServer-1.0 feature with role-based authorization, request IDs, the new `_meta` field, and key bug fixes. It also adds documentation and tests for displayCustomizedExceptionText, allowing users to replace default Liberty error messages with clearer, custom text.
10-
blog_description: This beta release enhances the mcpServer-1.0 feature with role-based authorization, request IDs, the new `_meta` field, and key bug fixes. It also adds documentation and tests for displayCustomizedExceptionText, allowing users to replace default Liberty error messages with clearer, custom text.
9+
seo-description: This beta release enhances the `mcpServer-1.0` feature with role-based authorization, request IDs, the new `_meta` field, and key bug fixes. It also adds documentation and tests for `displayCustomizedExceptionText`, allowing users to replace default Liberty error messages with clearer, custom text.
10+
blog_description: This beta release enhances the `mcpServer-1.0` feature with role-based authorization, request IDs, the new `_meta` field, and key bug fixes. It also adds documentation and tests for `displayCustomizedExceptionText`, allowing users to replace default Liberty error messages with clearer, custom text.
1111
open-graph-image: https://openliberty.io/img/twitter_card.jpg
1212
open-graph-image-alt: Open Liberty Logo
1313
---
@@ -18,7 +18,7 @@ Navaneeth S Nair <https://github.com/navaneethsnair1>
1818
:url-about: /
1919
//Blank line here is necessary before starting the body of the post.
2020

21-
This beta release enhances the mcpServer-1.0 feature with role-based authorization, request IDs, the new `_meta` field, and key bug fixes. It also adds documentation and tests for displayCustomizedExceptionText, allowing users to replace default Liberty error messages with clearer, custom text.
21+
This beta release enhances the `mcpServer-1.0` feature with role-based authorization, request IDs, the new `_meta` field, and key bug fixes. It also adds documentation and tests for `displayCustomizedExceptionText`, allowing users to replace default Liberty error messages with clearer, custom text.
2222

2323
The link:{url-about}[Open Liberty] 26.0.0.2-beta includes the following beta features (along with link:{url-prefix}/docs/latest/reference/feature/feature-overview.html[all GA features]):
2424

@@ -38,28 +38,28 @@ The link:https://modelcontextprotocol.io/docs/getting-started/intro[Model Contex
3838
This beta release of Open Liberty includes important updates to the `mcpServer-1.0` feature including role-based authorization, request IDs, the `_meta` field, and a few bug fixes.
3939

4040
=== Prerequisites
41-
To use the `mcpServer-1.0` feature, `Java 17` or later must be installed on the system.
41+
To use the `mcpServer-1.0` feature, Java 17 or later must be installed on the system.
4242

43-
=== Implement Role-based authorization for MCP tools via annotations
43+
=== Implement role-based authorization for MCP tools via annotations
4444

4545
The following new annotations allow you to restrict tool usage through authorization policies:
4646

47-
. `@DenyAll` - Resource is denied. This is the strictest policy.
48-
. `@RolesAllowed` - Resource is allowed for pre-authorised users in a role (same as a group in liberty).
47+
. `@DenyAll` - Resource is denied. This annotation is the strictest policy.
48+
. `@RolesAllowed` - Resource is allowed for pre-authorised users in a role (the same as a group in Liberty).
4949
. `@PermitAll` - Resource is allowed for anyone (even unauthenticated users).
5050

5151
These security annotations are declared on two levels:
5252

53-
. Class level - Every method in the class inherits this class level annotation
54-
. Method level - Overrides any class level annotations
53+
. Class level - Every method in the class inherits this class level annotation.
54+
. Method level - Overrides any class level annotations.
5555

5656
For complete reference documentation, see the link:https://jakarta.ee/specifications/security/[Jakarta Security Annotations specification].
5757

5858
==== Basic Authorization policy
5959

6060
Consider an online bookshop that has different users each with different authorization levels:
6161

62-
* Users - Low Security clearance required
62+
* Users - Minimum Security clearance required
6363
* Moderators - Medium Security clearance required
6464
* Admins - High Security clearance required
6565

@@ -124,16 +124,16 @@ public class PublicTools {
124124
==== Steps required
125125

126126
* Create an application with `@ApplicationScoped` and expose the tool with the required annotations.
127-
* Create a `server.xml` with users
128-
* Ensure that the groups map to the Roles created in the Tool
129-
* Add users to the groups in the `server.xml`
130-
* Create tests that test the expected functionality of the tools
127+
* Create a `server.xml` file with the users.
128+
* Ensure that the groups map to the roles created in the tool.
129+
* Add users to the groups in the `server.xml` file.
130+
* Create tests that validate the expected functionality of the tools.
131131

132132

133133
The following additional configuration is required in the `server.xml` (also see comments in the xml below):
134134

135-
* additional: appSecurity feature
136-
* additional: transportSecurity feature
135+
* additional: `appSecurity` feature
136+
* additional: `transportSecurity` feature
137137
* additional: define a user registry
138138
* additional: enable TLS (Transport Layer Security) for security
139139
* additional: require TLS (Transport Layer Security) to ensure credentials aren't sent in cleartext
@@ -204,20 +204,20 @@ The following additional configuration is required in the `server.xml` (also see
204204
</server>
205205
----
206206

207-
If another role were added to the code, say `RoleDoesNotExistInServerConfig` then any user (for e.g. Sally) was trying to authenticate with `@RolesAllowed("RoleDoesNotExistInServerConfig")` would not be able to have access to the resource until that role had a group created for it in the `server.xml` file and that user was mapped to that group.
207+
If a new role like `RoleDoesNotExistInServerConfig` were added to the code, any user (e.g., Sally) attempting to authenticate with a resource annotated with `@RolesAllowed("RoleDoesNotExistInServerConfig")` would be denied access to the resource. Access would only be granted after creating a corresponding group for that role in the server.xml file and mapping the user to that group.
208208

209-
In other situations we could also add multiple roles to tools: `@RolesAllowed("Admins, Moderators")`. This could make sense if the roles would have no overlapping users.
209+
In other situations we could also add multiple roles to tools: `@RolesAllowed("Admins, Moderators")`. This approach might make sense if the roles had no overlapping users.
210210

211-
_**Authorization Configuration**_
211+
**Authorization Configuration**
212212

213-
The `mcpServer-1.0` feature does not currently implement the MCP specification's link:https://spec.modelcontextprotocol.io/specification/2025-06-18/server/authorization[authorization-server-metadata-discovery] requirements. However, you can use any of Liberty's link:https://openliberty.io/docs/latest/authentication.html[standard authorization methods], including custom implementations.
213+
The `mcpServer-1.0` feature does not currently implement the MCP specification's authorization-server-metadata-discovery requirements. However, you can use any of Liberty's link:https://openliberty.io/docs/latest/authentication.html[standard authorization methods], including custom implementations.
214214

215215

216-
=== MCP: Tools can now access the ID of the request sent by the client
216+
=== MCP: Tools can now access the ID of the request that is sent by the client
217217

218218
Your tool can now have a new argument of type `io.openliberty.mcp.request.RequestID`.
219219

220-
As an example the requestID may be used for logging or audit purposes:
220+
As an example the requestID can be used for logging or audit purposes:
221221

222222
[source,java]
223223
----
@@ -234,7 +234,7 @@ public class RequestIDLoggingExample {
234234
}
235235
----
236236

237-
=== MCP: Tools can access metadata sent by the client in the `_meta` field
237+
=== MCP: Tools can access metadata that is sent by the client in the `_meta` field
238238

239239
The link:https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta[MCP specification] specifies that the `_meta` property/parameter is reserved by MCP to allow clients and servers to attach additional metadata to their interactions.
240240

@@ -247,8 +247,7 @@ The whole `_meta` key is seen as "example.com/myKey"
247247

248248
==== Adding a Tool Meta parameter
249249

250-
The code below shows an example metaKey used to retrieve the value of the metadata.
251-
In the example below, the metakey is "api.ibmtest.org/location"
250+
The following code shows an example metaKey used to retrieve the value of the metadata. In the example, the metakey is "api.ibmtest.org/location"
252251

253252
[source,java]
254253
----
@@ -265,9 +264,9 @@ In the example below, the metakey is "api.ibmtest.org/location"
265264
}
266265
----
267266

268-
==== Returning meta data via a Tool Response
267+
==== Returning metadata via a Tool Response
269268

270-
A method can return any meta data via the `ToolResponse` Object:
269+
A method can return any metadata via the `ToolResponse` Object:
271270

272271
[source,java]
273272
----
@@ -296,16 +295,16 @@ Track API costs for expensive operations.
296295

297296
*How it works:*
298297

299-
* Server adds costs to tool metadata
300-
* Client tracks total spending across operations
298+
* Server adds costs to tool metadata.
299+
* Client tracks total spending across operations.
301300

302301
==== 2) Rate Limiting Extension
303302
Prevent resource exhaustion and ensure fair access.
304303

305304
*How it works:*
306305

307-
* Metadata shows remaining quota before each call for time window
308-
* If limit exceeded, error includes retry time in `_meta`
306+
* Metadata shows the remaining quota before each call for time window
307+
* If limit is exceeded, error includes retry time in `_meta`
309308

310309
==== 3) Caching Hints Extension
311310
Optimize performance through intelligent caching.
@@ -317,7 +316,7 @@ Optimize performance through intelligent caching.
317316

318317
==== 4) Bringing it all together
319318

320-
All three of the above extensions could be built into your MCP server as extensions:
319+
All three of the preceding extensions might be built into your MCP server as extensions:
321320

322321
[source,json]
323322
----
@@ -343,16 +342,15 @@ All three of the above extensions could be built into your MCP server as extensi
343342

344343
=== Notable bug fixes in MCP 1.0
345344

346-
==== 1) MCP Server feature used ISO-8859-1 and did not handle non-latin characters
345+
==== 1) MCP Server feature used ISO-8859-1 and did not handle non-Latin characters
347346

348347
* Non-ASCII characters are now encoded correctly using UTF-8.
349-
* When an asynchronous tool failed with a business exception, it was incorrectly treated as a non-business exception and the client would receive an "Internal server error" response. Now the business exception message is correctly returned to the user in the same way that it is for synchronous tools.
348+
* When an asynchronous tool failed with a business exception, it was incorrectly treated as a non-business exception and the client might receive an "Internal server error" response. Now, the business exception message is correctly returned to the user in the same way that it is for synchronous tools.
350349

351-
==== 2) Fix Async MCP Tool error handling
350+
==== 2) Fix asynchronous MCP Tool error handling
352351

353-
* When an async tool returned a completion stage that failed, we were not checking whether the returned exception was a business exception or not, so we always reported an internal error.
354-
* Now we are checking whether or not it is a business or technical error and returning the error.
355-
* Business errors are returned to the client and technical errors are returned to the technical team to resolve.
352+
* Previously, when an asynchronous tool returned a failed completion stage, the system did not verify if the exception was a business or technical error. This oversight resulted in all failures being reported as internal errors.
353+
* The system now differentiates between exception types. This categorization ensures that business errors are returned to the client, while technical errors are directed to the technical team for resolution.
356354

357355
// DO NOT MODIFY THIS LINE. </GHA-BLOG-TOPIC>
358356

@@ -362,7 +360,9 @@ All three of the above extensions could be built into your MCP server as extensi
362360
// // // // // // // //
363361
[#displayCustomizedExceptionText]
364362
== displayCustomizedExceptionText property
365-
This beta release adds documentation and tests for the `displayCustomizedExceptionText` configuration, which allows users to override Liberty’s default error messages (such as SRVE0218E: Forbidden and SRVE0232E: An exception occurred) with clearer, user-defined messages. The feature is enabled through simple `server.xml` configuration, where custom messages can be mapped to specific HTTP status codes (403 and 500). Testing ensures that these custom messages correctly replace Liberty’s defaults across all supported platforms, confirming that the configured text is returned consistently in all scenarios.
363+
This beta release adds documentation and tests for the `displayCustomizedExceptionText` configuration, which allows users to override Liberty’s default error messages (such as SRVE0218E: Forbidden and SRVE0232E: An exception occurred) with clearer, user-defined messages.
364+
The feature is enabled through simple `server.xml` configuration, where custom messages can be mapped to specific HTTP status codes (403 and 500).
365+
Testing ensures that these custom messages correctly replace Liberty’s defaults across all supported platforms, confirming that the configured text is returned consistently in all scenarios.
366366

367367
[source,xml]
368368
----

0 commit comments

Comments
 (0)