Help us shape the future of Go! Take the 2026 Go Developer Survey

mcp

package
v0.7.0 Latest Latest
Warning

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

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

Documentation

Overview

Package mcp exposes Pando's service layer as MCP tools.

An agent holds a token and is a principal like any other (R-262). No tool bypasses authorization, and every action lands in the audit log under the token's owner. Exec, secret value reads, grant mutation, policy mutation, and user deletion are deliberately not exposed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytes

type Bytes struct {
	ContentType string
	Data        []byte
}

Bytes is a request body sent as-is rather than encoded as JSON, for the endpoints whose body is a file.

type Server

type Server struct {
	// Call performs one API call on the agent's behalf. Injected so the
	// transport can be tested without a server, and so this package cannot
	// reach anything the API does not expose.
	Call func(ctx context.Context, method, path string, body any, out any) error

	// ToolsDisabled are excluded from tools/list.
	//
	// A courtesy, not a boundary. The enforcement is host policy scoped to
	// token principals (O-12), because an agent holding a token can call the
	// REST API directly and would simply route around a list kept here. What
	// this does is stop the agent wasting a turn on a call it cannot make.
	ToolsDisabled map[string]bool

	// Version is reported as serverInfo.version. Empty reports "dev".
	Version string
	// contains filtered or unexported fields
}

Server speaks MCP on a pair of streams.

func (*Server) Serve

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

Serve reads requests until the stream closes.

type ToolDoc

type ToolDoc struct {
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Schema      map[string]any `json:"schema"`
}

ToolDoc is one tool as the reference publishes it.

func Catalog

func Catalog() []ToolDoc

Catalog returns the tools this server offers, in the order it offers them.

Jump to

Keyboard shortcuts

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