Documentation
¶
Overview ¶
Package mcpserver mounts the MCP surface at /mcp (ADR 0016). It is a projection of the external /api contract, not a second implementation: tools are generated from the embedded OpenAPI document and each call is dispatched in-process through the same ogen server with the caller's own Bearer token, so workspace scoping, token scopes, validation and RFC 7807 errors are the /api ones by construction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New builds the /mcp http.Handler: Streamable HTTP, stateless, one tool per non-hidden operation of the OpenAPI spec. api is the external API handler serving under /api; auth validates the connecting Bearer token.
With WithResourceMetadataURL, 401 responses carry a WWW-Authenticate challenge pointing OAuth clients (claude.ai connectors) at the protected resource metadata.
Types ¶
type Authenticator ¶
type Authenticator interface {
HandleBearerAuth(ctx context.Context, op externalapi.OperationName, t externalapi.BearerAuth) (context.Context, error)
}
Authenticator validates a Bearer API token (the external API's security handler).