mcp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mcp implements a minimal Model Context Protocol server over stdio.

Transport: newline-delimited JSON-RPC 2.0 (the MCP stdio convention — one JSON message per line). This is deliberately dependency-free; if it grows, swap in github.com/mark3labs/mcp-go. It exposes the query tools so a coding agent (Claude Code etc.) can drive the graph. See docs/ARCHITECTURE.md.

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 serves MCP over the given streams using a query engine.

func NewServer

func NewServer(eng *query.Engine, in io.Reader, out io.Writer) *Server

func (*Server) Serve

func (s *Server) Serve() error

Serve runs the request loop until stdin closes.

func (*Server) SetReadiness

func (s *Server) SetReadiness(fn func() (bool, string))

SetReadiness installs a gate consulted before every tool call. While it reports not-ready, tool calls return its status message instead of querying — so a repo whose background index is still building (or rebuilding) reports "indexing" rather than answering from a half-built store. initialize/tools/list are never gated, so the agent still sees the server and its tools immediately.

Jump to

Keyboard shortcuts

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