mock

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: GPL-3.0 Imports: 8 Imported by: 0 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 mock turns a recorded session into an MCP server that answers with what the real servers answered at the time. Point an agent, a test or a new policy at it and it sees the same tools and gets the same results, with nothing real behind them: no filesystem, no network, no side effects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Strict answers a call nothing was recorded for — same tool, same
	// arguments — with an error. Without it, such a call gets the next
	// recorded result of the same tool.
	Strict bool
	// Version is advertised as the server's version.
	Version string
}

Options shape the mock.

type Server

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

Server is a recorded session, served.

func New

func New(calls []*audit.Call, catalog []byte, opts Options) (*Server, error)

New builds a mock from a session's calls and its catalog snapshot. A nil catalog — a session recorded before snapshots existed — means the tools are made up from the calls, with a schema that accepts anything.

func (*Server) MCP

func (s *Server) MCP() *mcp.Server

MCP returns the server to connect a transport to.

func (*Server) Tools

func (s *Server) Tools() []*mcp.Tool

Tools lists what the mock serves.

Jump to

Keyboard shortcuts

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