mcp

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package mcp is a stdlib-only MCP server; each tool call is one /api/v1 request under the operator's token.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Client *api.Client
	// FallbackWorkspace may be empty; calls then need a workspace unless the token sees exactly one.
	FallbackWorkspace string
	// Without AllowWrite the mutating tools are not even advertised.
	AllowWrite bool
	Version    string
	// Logf must never write to stdout: on stdio the protocol owns it.
	Logf func(format string, args ...any)
}

type Server

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

Server serves MCP over stdio or HTTP against one API client.

func New

func New(o Options) *Server

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, in io.Reader, out io.Writer) error

Serve returns nil on a clean EOF, when the client closed the pipe.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(ctx context.Context, addr string) error

ServeHTTP serves the MCP Streamable HTTP transport with a single JSON-RPC endpoint at /mcp.

Jump to

Keyboard shortcuts

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