Package dev.relism.flash.ext.mcp
Class McpConfig.Builder
java.lang.Object
dev.relism.flash.ext.mcp.McpConfig.Builder
- Enclosing class:
McpConfig
-
Method Summary
Modifier and TypeMethodDescriptionallowedOrigins(String... origins) Origins allowed to call the MCP endpoint (DNS-rebinding protection, per the Streamable HTTP transport spec).authorizationServerIssuer(String issuer) Authorization server issuer URL, published in the RFC 9728 Protected Resource Metadata document at/.well-known/oauth-protected-resource{rootPath}.build()instructions(String instructions) Free-text instructions surfaced to the client atinitializetime.resourceIdentifier(String resourceIdentifier) Canonical URI of this MCP endpoint, used for RFC 8707 audience binding: tokens whoseaudclaim does not include this value are rejected.HTTP path for the Streamable HTTP endpoint.scopesSupported(String... scopes) OAuth2 scopes this server expects clients to request, published asscopes_supportedin the RFC 9728 Protected Resource Metadata document.security(McpSecurity security) OAuth2 requirement policy.toolsPackage(String toolsPackage) Server version reported ininitialize'sserverInfo.
-
Method Details
-
version
Server version reported ininitialize'sserverInfo. Default"1.0.0". -
instructions
Free-text instructions surfaced to the client atinitializetime. -
rootPath
HTTP path for the Streamable HTTP endpoint. Default"/mcp". -
toolsPackage
-
security
OAuth2 requirement policy. DefaultMcpSecurity.AUTO. -
resourceIdentifier
Canonical URI of this MCP endpoint, used for RFC 8707 audience binding: tokens whoseaudclaim does not include this value are rejected. Optional — whenflash-ext-oidcis installed, this is auto-derived per request from the forwarded/Hostheaders (same resolutionOidcExtensionuses for its own redirect URIs) and audience binding is enforced unconditionally. Set this explicitly only to override that guess — a reverse proxy that forwards neitherX-Forwarded-HostnorX-Forwarded-Proto. -
authorizationServerIssuer
Authorization server issuer URL, published in the RFC 9728 Protected Resource Metadata document at/.well-known/oauth-protected-resource{rootPath}. Optional — whenflash-ext-oidcis installed, this is auto-derived from its configured issuer. Set this explicitly only to override that (e.g. publishing a different issuer than the one actually validating tokens). -
allowedOrigins
Origins allowed to call the MCP endpoint (DNS-rebinding protection, per the Streamable HTTP transport spec). If never set,Originvalidation is skipped and a warning is logged at boot. -
scopesSupported
OAuth2 scopes this server expects clients to request, published asscopes_supportedin the RFC 9728 Protected Resource Metadata document. Optional per the spec — omitted from the document entirely if never set. A spec-compliant client reads this to know what to put in its authorization/token requests instead of requesting nothing; seedocs/keycloak.md's "same story for any other claim" section for why this matters in practice (a client that requests no scope only gets whatever your authorization server treats as always-included, e.g. Keycloak's `basic`). Purely advertisement — this server still validates whatever token it actually receives the same way regardless of what a client requested. -
build
-