Class McpExtension

java.lang.Object
dev.relism.flash.ext.mcp.McpExtension
All Implemented Interfaces:
dev.relism.flash.extension.FlashExtension

public class McpExtension extends Object implements dev.relism.flash.extension.FlashExtension
MCP (Model Context Protocol) server extension. Streamable HTTP transport — a single POST JSON-RPC endpoint, stateless in this revision (see docs/transport.md) — dispatching to @Tool/@Resource/@Prompt classes under
invalid reference
McpConfig#toolsPackage(String)
.

 app.install(new SecurityExtension())
    .install(new OidcExtension(OidcProvider.of("sso", issuer, clientId, secret)))
    .install(new McpExtension(McpConfig.builder("my-server").toolsPackage("com.example.tools").build()));
 

Every call is authenticated by the application's security chain — OAuth2 bearer tokens, API keys, anything registered. When an OAuth2 issuer is among its schemes, the endpoint is also an OAuth2 protected resource: RFC 9728 metadata, a resource_metadata challenge, and RFC 8707 audience binding for audience-bound tokens. Tool annotations are enforced per call, with @RolesAllowed(on = ...) reading tool arguments.

  • Constructor Details

    • McpExtension

      public McpExtension(McpConfig config)
  • Method Details

    • configure

      public void configure(dev.relism.flash.extension.FlashRegistrar<?> app, dev.relism.flash.extension.FlashContext ctx)
      Specified by:
      configure in interface dev.relism.flash.extension.FlashExtension