Documentation
¶
Overview ¶
Package mcp wraps the Pulse library facade in the Model Context Protocol surface. The library has no dependency on this package; the CLI invokes New() and ServeStdio() to expose Pulse over stdio for MCP clients.
Tool names are defined in tools.go and exported via RegisteredTools so the skills coverage gate can verify documentation parity.
Index ¶
- Constants
- func Bind(schema *encoding.Schema) (map[string]json.RawMessage, error)
- func BindSessionTools(s *server.MCPServer, sessionID string, schema *encoding.Schema, ...) error
- func BindSessionToolsWithExtensions(s *server.MCPServer, sessionID string, schema *encoding.Schema, ...) error
- func BindWithExtensions(schema *encoding.Schema, snap *descriptor.ExtensionsSnapshot) (map[string]json.RawMessage, error)
- func New(p *pulse.Pulse) *server.MCPServer
- func NewWithOptions(p *pulse.Pulse, opts Options) *server.MCPServer
- func RegisteredPrompts() []string
- func RegisteredTools() []string
- func ServeStdio(s *server.MCPServer) error
- type Options
- type ToolMeta
Constants ¶
const ( PromptBootstrap = "pulse-bootstrap" PromptAuthorRequest = "pulse-author-request" )
Prompt name constants. Exposed via the MCP prompts/list capability so clients can surface them as slash commands or auto-inject the bootstrap message into a session.
const ( DescPromptBootstrap = "" /* 284-byte string literal not displayed */ DescPromptAuthorRequest = "" /* 286-byte string literal not displayed */ )
Prompt descriptions — what the prompt does, when to call it. These strings reach the LLM via the MCP prompts/list response, so they should read like tool descriptions: imperative, no marketing.
const ( ToolInspect = mcptools.ToolInspect ToolPredict = mcptools.ToolPredict ToolProcess = mcptools.ToolProcess ToolProcessChain = mcptools.ToolProcessChain ToolCompose = mcptools.ToolCompose ToolSample = mcptools.ToolSample ToolFacet = mcptools.ToolFacet ToolFacetSchema = mcptools.ToolFacetSchema ToolSkillsList = mcptools.ToolSkillsList ToolSkillsGet = mcptools.ToolSkillsGet ToolManifest = mcptools.ToolManifest ToolAsk = mcptools.ToolAsk ToolExamplesSearch = mcptools.ToolExamplesSearch ToolExamplesGet = mcptools.ToolExamplesGet ToolErrorsLookup = mcptools.ToolErrorsLookup ToolImport = mcptools.ToolImport ToolDrop = mcptools.ToolDrop ToolImportsList = mcptools.ToolImportsList DescInspect = mcptools.DescInspect DescPredict = mcptools.DescPredict DescProcess = mcptools.DescProcess DescProcessChain = mcptools.DescProcessChain DescCompose = mcptools.DescCompose DescSample = mcptools.DescSample DescFacet = mcptools.DescFacet DescFacetSchema = mcptools.DescFacetSchema DescSkillsList = mcptools.DescSkillsList DescSkillsGet = mcptools.DescSkillsGet DescManifest = mcptools.DescManifest DescAsk = mcptools.DescAsk DescExamplesSearch = mcptools.DescExamplesSearch DescExamplesGet = mcptools.DescExamplesGet DescErrorsLookup = mcptools.DescErrorsLookup DescImport = mcptools.DescImport DescDrop = mcptools.DescDrop DescImportsList = mcptools.DescImportsList )
Tool name and description constants are sourced from the mcptools sub-package so the descriptor manifest can mirror them without taking a dependency on this package (which imports the root pulse package and would create an import cycle).
const CohortURIScheme = "pulse://"
CohortURIScheme is the URI scheme for .pulse cohort resources.
const ServerName = "pulse"
ServerName is the MCP server identity reported during initialize.
const SkillURIScheme = "pulse-skill://"
SkillURIScheme is the URI scheme for embedded skill resources.
const SpecVersion = "1.0.0"
SpecVersion pins the supported MCP spec. Bump deliberately when upgrading mark3labs/mcp-go and confirming the wire format still works for our clients.
Variables ¶
This section is empty.
Functions ¶
func Bind ¶ added in v0.5.0
Bind returns per-tool JSON Schemas keyed by tool name with no embedder extensions applied. Equivalent to BindWithExtensions with a nil snapshot.
func BindSessionTools ¶ added in v0.5.0
func BindSessionTools(s *server.MCPServer, sessionID string, schema *encoding.Schema, handlers boundHandlers) error
BindSessionTools is the entry point used by handleInspect. Given a schema, it derives per-tool JSON Schemas and registers them as session-scoped tools that override the global variants for the current session. mcp-go fires notifications/tools/list_changed on success.
func BindSessionToolsWithExtensions ¶ added in v0.7.0
func BindSessionToolsWithExtensions(s *server.MCPServer, sessionID string, schema *encoding.Schema, snap *descriptor.ExtensionsSnapshot, handlers boundHandlers) error
BindSessionToolsWithExtensions mirrors BindSessionTools but routes an extensions snapshot into the per-tool JSON Schemas so embedder-registered operator names appear in the enum lists.
func BindWithExtensions ¶ added in v0.7.0
func BindWithExtensions(schema *encoding.Schema, snap *descriptor.ExtensionsSnapshot) (map[string]json.RawMessage, error)
BindWithExtensions returns per-tool JSON Schemas keyed by tool name, merging any embedder-registered operator names into the per-category enums so LLM agents can author requests that reference custom operators. Empty schemas are omitted so the caller can decide which tools to override.
func New ¶
New constructs an MCP server bound to the given Pulse instance. Tools and resources are registered eagerly. The caller is responsible for serving the returned server (typically via server.ServeStdio). Bind-on-inspect (the schema-bound tool enum variants) is enabled by default; use NewWithOptions to opt out.
func NewWithOptions ¶ added in v0.5.0
NewWithOptions is New with explicit configuration.
func RegisteredPrompts ¶ added in v0.6.0
func RegisteredPrompts() []string
RegisteredPrompts returns the canonical list of prompt names this server registers. Stable order. Used by tests + manifest aggregation.
func RegisteredTools ¶
func RegisteredTools() []string
RegisteredTools returns the canonical list of MCP tool names exposed by this server. Order is stable for deterministic documentation scans.
func ServeStdio ¶
ServeStdio runs the given MCP server over stdio. Blocks until the client disconnects or an error occurs.
Types ¶
type Options ¶ added in v0.5.0
type Options struct {
// BindOnOpen toggles the session-scoped schema-bound tool variants
// registered on successful pulse_inspect calls. Default (true via New)
// gives LLM clients typed enum constraints on field-name parameters;
// false leaves only the unbound global tools, which is useful for
// embedders that bind themselves.
BindOnOpen bool
}
Options configures the MCP server.
type ToolMeta ¶ added in v0.5.0
ToolMeta is the canonical (name, description) record for one registered MCP tool. Alias of mcptools.ToolMeta so callers do not need to import the sub-package directly.
func RegisteredToolsMeta ¶ added in v0.5.0
func RegisteredToolsMeta() []ToolMeta
RegisteredToolsMeta returns the canonical list of MCP tools with their description strings.