mcp

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 17 Imported by: 0

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

View Source
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.

View Source
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.

View Source
const (
	ToolInspect        = mcptools.ToolInspect
	ToolPredict        = mcptools.ToolPredict
	ToolProcess        = mcptools.ToolProcess
	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
	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).

View Source
const CohortURIScheme = "pulse://"

CohortURIScheme is the URI scheme for .pulse cohort resources.

View Source
const ServerName = "pulse"

ServerName is the MCP server identity reported during initialize.

View Source
const SkillURIScheme = "pulse-skill://"

SkillURIScheme is the URI scheme for embedded skill resources.

View Source
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

func Bind(schema *encoding.Schema) (map[string]json.RawMessage, error)

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

func New(p *pulse.Pulse) *server.MCPServer

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

func NewWithOptions(p *pulse.Pulse, opts Options) *server.MCPServer

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

func ServeStdio(s *server.MCPServer) error

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

type ToolMeta = mcptools.ToolMeta

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.

Directories

Path Synopsis
Package mcptools holds the metadata table for the MCP tools registered by internal/mcp.
Package mcptools holds the metadata table for the MCP tools registered by internal/mcp.

Jump to

Keyboard shortcuts

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