Interface McpEndpointMixin

All Known Subinterfaces:
McpEndpoint, McpEndpoint
All Known Implementing Classes:
SpringExampleMcpServer, SpringMcpRestServlet, SpringMcpRestServlet

public interface McpEndpointMixin
Mixin interface that exposes an MCP JSON-RPC endpoint at POST /mcp on any Juneau REST resource.

Implementing classes supply their McpServerConfig via getMcpConfig() and their protocol revision via revision(). In practice a consumer implements a revision-specific sub-interface (for example org.apache.juneau.rest.server.mcp.v20250618.McpEndpoint), which supplies revision() for them.

Example:

 @Rest(path="/api")
 public class MyResource extends BasicRestServlet implements org.apache.juneau.rest.server.mcp.v20250618.McpEndpoint {
     @Override
     public McpServerConfig getMcpConfig() {
         return new McpServerConfig().addTool(new MyEchoTool());
     }
 }
 

Named *Mixin (not Abstract*) because this is an interface, not an abstract class - Abstract* is this repo's naming convention for abstract classes only. McpRevision, the other core type dated subclasses de-versioning-shadow, deliberately keeps its plain name: end-users never implement it directly (only a bound revision's own subclass does), so it never faces the same-simple-name collision this mixin interface was renamed to avoid.