Documentation
¶
Overview ¶
Package mcptest is an MCP server over the Streamable HTTP transport that a test owns, on the loopback address, for the RepoPrompt reviewer route's tests (itd-6): no test reaches a real RepoPrompt or the network. It answers initialize, the initialized notification, tools/list, tools/call and the session's closing DELETE, and records what it was sent.
Index ¶
Constants ¶
const SessionID = "session-1"
SessionID is the session id the server assigns.
const Version = "2025-06-18"
Version is the protocol revision the server answers initialize with.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct {
// Tools are the tools tools/list offers, each with the names of the
// properties its input schema declares.
Tools map[string][]string
// Answer is the tools/call result; nil answers with the message echoed.
Answer func(args map[string]any) any
// Stream answers every request as an event stream rather than a JSON
// body, with a notification and a keep-alive comment before the response.
Stream bool
// RPCError answers the named method with a JSON-RPC error.
RPCError string
// Delay holds the tools/call answer this long.
Delay time.Duration
// NoTools leaves the tools capability out of initialize.
NoTools bool
// ProtocolVersion is the revision initialize answers with; Version when
// empty.
ProtocolVersion string
// Session is the session id initialize assigns; SessionID when empty.
Session string
// contains filtered or unexported fields
}
Server is the fake. Its zero value offers no tools.