mcp

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mcp serves the Model Context Protocol at /mcp: AI clients (Claude, …) read and edit pads and use their chat with a token (Authorization: Bearer ep_…). What a call may do is the token's: its account's rights of the moment, cut down to the token's scopes and pad pattern, checked per pad like everywhere else.

The server keeps nothing between requests (stateless Streamable HTTP), so every instance of a cluster answers every request and no sticky sessions are needed.

Index

Constants

View Source
const Path = "/mcp"

Path is where the MCP server answers.

View Source
const ResourceMetadataPath = "/.well-known/oauth-protected-resource"

ResourceMetadataPath is OAuth 2.0 protected resource metadata (RFC 9728).

Variables

This section is empty.

Functions

This section is empty.

Types

type OAuth

type OAuth interface {
	MCPAccessToken(token string) (*oidc.MCPAccess, error)
	MCPOAuthIssuer() (string, bool)
}

OAuth checks the access tokens of MCP clients that connected with a login and the person's consent (lib/api/oidc).

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the MCP server of one instance.

func New

func New(store *lib.InitStore, keys *tokens.Manager) *Server

New makes the MCP server; Register serves it.

func (*Server) Register

func (s *Server) Register(app fiber.Router)

Register serves the MCP server at Path on app.

func (*Server) WithOAuth

func (s *Server) WithOAuth(o OAuth) *Server

WithOAuth lets MCP clients connect with OAuth, besides tokens.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL