mcp

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package mcp serves the seamark index over the Model Context Protocol's stdio transport: newline-delimited JSON-RPC 2.0, the same hand-rolled approach the LSP server took (RFC-001 §6.2). Five tools, not forty — tool definitions are paid in tokens on every agent turn.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server answers MCP requests from the index at root. Every tool call self-repairs freshness first (the indexer's fast path makes that free when nothing changed), so answers never come from a stale graph.

func New

func New(root, dbPath, version string, logf func(format string, a ...any)) *Server

New builds a server for the workspace at root; logf receives operational notes (stderr in the CLI — stdout is protocol-only).

func (*Server) Serve

func (s *Server) Serve(r io.Reader, w io.Writer) error

Serve reads newline-delimited JSON-RPC messages until r closes. It never returns on a bad message — a protocol server that dies on one malformed line takes the whole agent session with it. That includes an over-length frame: it is rejected in-band and serving continues, rather than tearing the connection down (bufio.Scanner's fatal ErrTooLong is exactly the failure mode we must not have here).

Jump to

Keyboard shortcuts

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