mcpserve

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mcpserve exposes Pulse's Model Context Protocol server as a public entry point.

The MCP wiring lives in internal/mcp (the library facade has no dependency on it; the CLI invokes it to expose Pulse over stdio). This package lets an embedder serve a Pulse MCP from its own process — including any operators, expression functions, or label tables registered via the constructed *pulse.Pulse's Options.Extensions — without shelling out to the `pulse` binary. That is the only way a domain layer (e.g. a BERA-flavored Pulse) can surface its in-process Go extensions over MCP, since the stock binary cannot load them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, p *pulse.Pulse, opts Options, in io.Reader, out io.Writer) error

Serve runs an MCP server bound to p, reading JSON-RPC requests from in and writing responses to out. It blocks until ctx is cancelled or a transport error occurs. Extensions registered when p was constructed are exposed verbatim.

func ServeStdio

func ServeStdio(p *pulse.Pulse, opts Options) error

ServeStdio is Serve over the process's stdin/stdout — the transport MCP clients use when they spawn the server as a subprocess. It blocks until stdin closes or the client disconnects.

Types

type Options

type Options struct {
	// BindOnOpen registers session-scoped schema-bound tool variants on a
	// successful pulse_inspect. True gives MCP clients typed enum constraints
	// on field-name parameters; false leaves only the unbound global tools,
	// which is useful for clients that bind tool schemas themselves.
	BindOnOpen bool
}

Options configures the served MCP server. It mirrors internal/mcp.Options.

Jump to

Keyboard shortcuts

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