-
Couldn't load subscription status.
- Fork 2k
MCP endpoints in controllers (SSE transport, Server side) #2630
-
Drafting it real quick, but what if, instead of having a single MCP endpoint, it was possible to define a controller similar to this one?
@MCPController @RequestMapping("/mcp/controller/") public class HelloMCPController { @MCPMapping("/{endpointId}") MCPEndpointConfig endpoint(@PathVariable String endpointId) { return MCPEndpointConfig.builder() .withTools(...) .build(); } }
Reasoning for this is ability to define what tools will be available on this endpoint based on a dynamic user-provided configuration. Additionally, with Multi-agent MCP clients, this would allow providing an endpoint that is fine-tuned for the given agent specifically, with tools that are only needed for that agent.
That is especially reasonable for large products.
As a note - I haven't checked exact API implementation just yet, so class names are taken out of the blue, but I have already noticed there's no support for the main idea of this code snippet.
Beta Was this translation helpful? Give feedback.