Versions in this module Expand all Collapse all v0 v0.3.1 Jan 19, 2026 v0.3.0 Jan 19, 2026 Changes in this version + var ErrPromptNotFound = errors.New("prompt not found") + var ErrResourceNotFound = errors.New("resource not found") + var ErrToolNotFound = errors.New("tool not found") + func AddTool[In, Out any](r *Runtime, t *mcp.Tool, h mcp.ToolHandlerFor[In, Out]) + func AuthorizationServerMetadataHandler(tokenPath string) http.Handler + func ProtectedResourceMetadataHandler(mcpPath string) http.Handler + type HTTPServerOptions struct + Addr string + Ngrok *NgrokOptions + OAuth *OAuthOptions + OAuth2 *OAuth2Options + OnReady func(result *HTTPServerResult) + Path string + ReadHeaderTimeout time.Duration + StreamableHTTPOptions *mcp.StreamableHTTPOptions + type HTTPServerResult struct + LocalAddr string + LocalURL string + OAuth *OAuthCredentials + OAuth2 *OAuth2Credentials + PublicURL string + type NgrokOptions struct + Authtoken string + Domain string + type OAuth2Credentials struct + AuthorizationEndpoint string + ClientID string + ClientSecret string + RegistrationEndpoint string + TokenEndpoint string + Users []string + type OAuth2Options struct + AccessTokenExpiry time.Duration + AllowedScopes []string + ClientID string + ClientSecret string + Debug bool + LoginPageTemplate string + RedirectURIs []string + RefreshTokenExpiry time.Duration + Users map[string]string + type OAuthCredentials struct + ClientID string + ClientSecret string + TokenEndpoint string + type OAuthOptions struct + ClientID string + ClientSecret string + TokenExpiry time.Duration + TokenPath string + type Options struct + Logger *slog.Logger + ServerOptions *mcp.ServerOptions + type PromptHandler = mcp.PromptHandler + type ResourceHandler = mcp.ResourceHandler + type Runtime struct + func New(impl *mcp.Implementation, opts *Options) *Runtime + func (r *Runtime) AddPrompt(p *mcp.Prompt, h mcp.PromptHandler) + func (r *Runtime) AddResource(res *mcp.Resource, h mcp.ResourceHandler) + func (r *Runtime) AddResourceTemplate(t *mcp.ResourceTemplate, h mcp.ResourceHandler) + func (r *Runtime) AddToolHandler(t *mcp.Tool, h mcp.ToolHandler) + func (r *Runtime) CallTool(ctx context.Context, name string, args any) (*mcp.CallToolResult, error) + func (r *Runtime) Connect(ctx context.Context, transport mcp.Transport) (*mcp.ServerSession, error) + func (r *Runtime) GetPrompt(ctx context.Context, name string, args map[string]string) (*mcp.GetPromptResult, error) + func (r *Runtime) HasPrompt(name string) bool + func (r *Runtime) HasResource(uri string) bool + func (r *Runtime) HasTool(name string) bool + func (r *Runtime) Implementation() *mcp.Implementation + func (r *Runtime) InMemorySession(ctx context.Context) (*mcp.ServerSession, *mcp.ClientSession, error) + func (r *Runtime) ListPrompts() []*mcp.Prompt + func (r *Runtime) ListResources() []*mcp.Resource + func (r *Runtime) ListTools() []*mcp.Tool + func (r *Runtime) MCPServer() *mcp.Server + func (r *Runtime) PromptCount() int + func (r *Runtime) ReadResource(ctx context.Context, uri string) (*mcp.ReadResourceResult, error) + func (r *Runtime) RemovePrompts(names ...string) + func (r *Runtime) RemoveResourceTemplates(uriTemplates ...string) + func (r *Runtime) RemoveResources(uris ...string) + func (r *Runtime) RemoveTools(names ...string) + func (r *Runtime) ResourceCount() int + func (r *Runtime) SSEHandler(opts *mcp.SSEOptions) http.Handler + func (r *Runtime) Serve(ctx context.Context, transport mcp.Transport) error + func (r *Runtime) ServeHTTP(ctx context.Context, opts *HTTPServerOptions) (*HTTPServerResult, error) + func (r *Runtime) ServeIO(ctx context.Context, reader io.ReadCloser, writer io.WriteCloser) error + func (r *Runtime) ServeStdio(ctx context.Context) error + func (r *Runtime) StreamableHTTPHandler(opts *mcp.StreamableHTTPOptions) http.Handler + func (r *Runtime) ToolCount() int + type ToolHandler = mcp.ToolHandler + type ToolHandlerFor = mcp.ToolHandlerFor[In, Out]