mcpserver

package
v0.0.0-...-8c9b6e8 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package mcpserver exposes Billet's tool surface as an MCP server over Streamable HTTP: the save_memory and search_memory tools Stirrup's harness calls directly (docs/DECISIONS.md, "two transports"). The tool semantics live in internal/service; this package owns only the MCP protocol adaptation.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is the Billet build version reported in the MCP Implementation handshake. Overridable at link time (-ldflags -X); "dev" otherwise.

Functions

This section is empty.

Types

type Server

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

Server adapts a service.Service to the MCP save_memory/search_memory tool surface. Validation, budget gating, and the generic error policy all live in the service, shared with the RPC transport.

func New

func New(svc *service.Service) *Server

New returns a Server delegating to svc.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the http.Handler serving Billet's MCP endpoint: the Streamable HTTP transport, stateless and JSON-only.

Stirrup's actual MCP client (harness/internal/mcp/client.go) sends no Accept header and never issues an "initialize" call before tools/list — it is a minimal, non-fully-compliant Streamable HTTP client, not the reference client the SDK expects. Stateless mode tolerates the missing initialize handshake (it synthesizes default session state per request); JSONResponse avoids SSE framing the client cannot parse (it does a raw json.Unmarshal of the response body); and acceptAnyMediaType supplies the Accept header the client omits, which the SDK otherwise requires and rejects with 400 when absent. All three were verified empirically against github.com/modelcontextprotocol/go-sdk v1.7.0 (docs/DECISIONS.md).

Jump to

Keyboard shortcuts

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