mcp

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasSessionOrientation added in v0.35.0

func HasSessionOrientation(ctx context.Context) bool

HasSessionOrientation reports whether the current call is governed by a session orientation gate. A governed recovery session has no flight but still returns true; ungated embedded surfaces return false.

func NewServer

func NewServer(tap *tapper.Tap, version string, defaults KegDefaults, opts ...ServerOptions) *sdkmcp.Server

NewServer builds an MCP server with all registered tools.

func SessionFlight added in v0.35.0

func SessionFlight(ctx context.Context) *tapper.Flight

SessionFlight returns the immutable flight snapshot captured for the current MCP tool-call boundary. Hosted discovery tools use it to apply the same cover as KEG operations without reaching into session storage.

Types

type KegDefaults

type KegDefaults struct {
	tapper.KegTargetOptions
	// contains filtered or unexported fields
}

KegDefaults holds server-wide keg targeting defaults.

type OrientationLoader added in v0.35.0

type OrientationLoader func(context.Context) (*tapper.Flight, string, []tapper.OrientationKeg, []string, error)

OrientationLoader resolves one complete orientation candidate. Implementors must return a freshly loaded flight and payload; publishing is owned by the session gate and happens only after the loader succeeds.

type ServerOptions added in v0.12.0

type ServerOptions struct {
	LicenseText string
	// Logger is the structured logger for invocation logging. When nil,
	// invocation logging is silently skipped.
	Logger *slog.Logger
	// Reporter receives privacy-minimized tool invocation telemetry. It is
	// independent of Logger and may be nil.
	Reporter tapper.InvocationReporter
	// Surface selects the registered tool set. The zero value (SurfaceFull)
	// registers everything, preserving the CLI peer surface.
	Surface Surface
	// OrientationLoader supplies hosted/session-specific flight snapshots.
	// Local full-surface servers leave it nil and use Tapper configuration.
	OrientationLoader OrientationLoader
}

ServerOptions holds configuration for creating an MCP server.

type Surface added in v0.23.0

type Surface int

Surface selects which tool groups NewServer registers.

const (
	// SurfaceFull registers every tool — the CLI peer surface and the default.
	SurfaceFull Surface = iota
	// SurfaceHub registers only the per-user node read/write tools appropriate
	// for a remote, OAuth-scoped hub connector (tapper-hub's /mcp endpoint). It
	// omits CLI/local tools (auth_status, config, doctor, license,
	// file downloads, path-based image downloads, archive, locks) and hub-admin
	// tools (keg/namespace administration, flights) — none of which make sense
	// for a remote multi-tenant connector. Uploads remain available, but local
	// path sources are disabled. Image downloads return MCP image content rather
	// than writing to the server filesystem. Schema tools (schema_list/read/
	// create/edit/delete, validate) ARE registered here: schema mutation resolves
	// at editor role, consistent with how node writes already work on this
	// surface. The hub pairs this with Tap.KegResolver so the registered tools
	// resolve against the caller's catalog.
	SurfaceHub
)

Jump to

Keyboard shortcuts

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