mcpserver

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mcpserver exposes AgentProvenance's AI tool surface over the Model Context Protocol (MCP, spec revision 2025-06-18) as a stdio JSON-RPC 2.0 server. It is a thin transport over internal/aitools: the tool catalog and dispatcher are the single source of truth, so an MCP client (Claude Desktop, the mcp inspector, etc.) sees exactly the same read surface + inline policy gate as the `agentprov ai` CLI and the provider adapters.

Trust boundary is inherited from aitools (see docs/ai-access.md): tools let a model QUERY the verifiable graph and pre-flight a proposed action; the gate verdict is computed by the trusted engine, never fabricated by the model.

Wire framing is newline-delimited JSON (one JSON-RPC message per line). Only JSON-RPC is written to the output stream -- callers must keep diagnostics on stderr so the stdout channel stays clean for the client.

Index

Constants

View Source
const ProtocolVersion = "2025-06-18"

ProtocolVersion is the MCP spec revision this server implements. During the initialize handshake we echo the client's requested version when it sends one (maximizing client compatibility) and fall back to this otherwise.

Variables

This section is empty.

Functions

func Serve

func Serve(db *sql.DB, r io.Reader, w io.Writer) error

Serve runs the MCP stdio loop: it reads newline-delimited JSON-RPC messages from r and writes responses to w until r reaches EOF (a clean shutdown). It returns a non-nil error only on an unrecoverable transport failure.

Types

This section is empty.

Jump to

Keyboard shortcuts

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