mcpserver

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package mcpserver publishes operations as MCP tools.

It is the only part that knows the protocol — and it knows no dialect at all. It takes core.Operation and registers it; if a gRPC or SOAP dialect shows up tomorrow, nothing here changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, ops []core.Operation, cfg Config) error

Serve registers the operations and answers until the context ends.

Types

type Config

type Config struct {
	Name    string
	Version string
	Mode    Mode
	Addr    string
	Path    string // http mode only
	// BlobIn, when set, is the directory a `file:<path>` argument may be read from — Offload's
	// mirror on the way in. Empty means the prefix is not interpreted at all.
	BlobIn string
	// BlobInURLSafe picks the alphabet the inlined bytes are encoded with. Google's APIs declare
	// their `format: byte` fields as base64URL ("The entire email message ... base64url encoded
	// string", in Gmail's own discovery document); OpenAPI's `format: byte` is plain base64.
	BlobInURLSafe bool
	// BlobDir, when set, is where oversized base64 in a response is written to instead of
	// travelling into the model's context. See internal/blob.
	BlobDir string
	// Instructions is what the client reads before loading any tool. Under tool search — the
	// default in Claude Code — only tool names and this text arrive when the session opens, so
	// it is what tells the model this server is worth searching. Empty is allowed and means the
	// spec had nothing to say; see spec.Document.Instructions.
	Instructions string
}

Config holds the transport decisions.

type Mode

type Mode string

Mode is how the server talks to the client.

const (
	ModeStdio Mode = "stdio" // the default: the MCP client starts the process and talks over pipes
	ModeSSE   Mode = "sse"
	ModeHTTP  Mode = "http"
)

Jump to

Keyboard shortcuts

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