File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
extensions/devui/runtime/src/main/java/io/quarkus/devui/runtime Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -50,12 +50,13 @@ private JsonRpcRequest remap(JsonRpcRequest jsonRpcRequest) {
50
50
Map params = jsonRpcRequest .getParams ();
51
51
String mappedName = (String ) params .remove ("name" );
52
52
Map mappedParams = (Map ) params .remove ("arguments" );
53
-
53
+
54
54
JsonRpcRequest mapped = new JsonRpcRequest (this .jsonMapper );
55
55
mapped .setId (jsonRpcRequest .getId ());
56
56
mapped .setJsonrpc (jsonRpcRequest .getJsonrpc ());
57
57
mapped .setMethod (mappedName );
58
- if (mappedParams !=null && !mappedParams .isEmpty ())mapped .setParams (mappedParams );
58
+ if (mappedParams != null && !mappedParams .isEmpty ())
59
+ mapped .setParams (mappedParams );
59
60
60
61
return mapped ;
61
62
}
Original file line number Diff line number Diff line change @@ -110,9 +110,17 @@ private void handleMCPJsonRPCRequest(RoutingContext ctx) {
110
110
// This is a MCP notification
111
111
this .routeToMCPNotification (jsonRpcRequest , codec , writer );
112
112
} else if (methodName .equalsIgnoreCase (McpBuiltinMethods .TOOLS_LIST ) ||
113
- methodName .equalsIgnoreCase (McpBuiltinMethods .RESOURCES_LIST ) ||
114
- methodName .equalsIgnoreCase (McpBuiltinMethods .RESOURCES_READ )) {
113
+ methodName .equalsIgnoreCase (McpBuiltinMethods .RESOURCES_LIST )) {
115
114
jsonRpcRequest .setMethod (methodName .replace (SLASH , UNDERSCORE ));
115
+ // Make sure that parameters is empty as expected.
116
+ jsonRpcRequest .setParams (null );
117
+ jsonRpcRouter .route (jsonRpcRequest , writer );
118
+ } else if (methodName .equalsIgnoreCase (McpBuiltinMethods .RESOURCES_READ )) {
119
+ jsonRpcRequest .setMethod (methodName .replace (SLASH , UNDERSCORE ));
120
+ // Make sure that the only parameter is uri (as expected).
121
+ String uri = jsonRpcRequest .getParam ("uri" , String .class );
122
+ jsonRpcRequest .getParams ().clear ();
123
+ jsonRpcRequest .setParams (Map .of ("uri" , uri ));
116
124
jsonRpcRouter .route (jsonRpcRequest , writer );
117
125
} else {
118
126
// This is a normal extension method
You can’t perform that action at this time.
0 commit comments