mcp

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package mcp exposes this runtime over the Model Context Protocol.

It is a transport adapter only: it maps MCP tool calls onto the existing validation, conformance, describe, and evaluation packages and returns their versioned results. It opens no network connection and holds no credential -- an MCP client reaches exactly the same offline core the CLI reaches, over JSON-RPC on stdio instead of argv. The validation tools evaluate no condition and resolve no outcome; the exceptions are experimental_evaluate, experimental_test_packs and experimental_test_graphs (ADR-0007, ADR-0021, ADR-0026), which run the evaluation package on this runtime's experimental surface. experimental_evaluate is the one tool here that can write: in a project whose jpack.json declares an audit directory it appends one record per completed non-rehearsal call (ADR-0028), through the project's own directory handle and nowhere else (ADR-0018); experimental_test_packs runs declared instance matrices, experimental_test_graphs runs declared graph matrices, and neither writes anything at all, because a matrix row is a rehearsal and not a decision. experimental_list_graphs and experimental_get_graph serve the graph convention's inventory and documents read-only (ADR-0029): they carry the experimental marker for their surface's stability, and they evaluate nothing and write nothing. experimental_validate_expectations checks proposed exact §8.3 dispositions through the same decoder the matrix comparator uses (ADR-0035), reaching no pack, project or evaluator at all: it reads its arguments and nothing else. Nothing in this package states a conformance claim: the claim is stated, in full and only, in CONFORMANCE.md, and the payloads reference it by their own contracts — a successful evaluation or matrix payload carries the reference beside the contract version applied (result.EvaluationClaimReference, result.EvaluatorSpecVersion), the corpus payload carries the reference beside its pinned specVersion, and a classified refusal envelope carries the class's evaluatorSpecVersion inside its evaluationError member and no reference at all.

The server speaks MCP's newline-delimited JSON-RPC 2.0 stdio framing directly, without a third-party SDK, to keep the runtime's dependency set minimal and its build free of a newer-Go-toolchain requirement. It runs as the "mcp" subcommand of the single jpack binary.

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 maps MCP tool calls onto the offline validation core. It holds no network connection and no credential.

func NewServer

func NewServer(engine *validation.Engine, runner *conformance.Runner) *Server

NewServer builds a server over an already-constructed engine and runner.

func (*Server) Serve

func (s *Server) Serve(in io.Reader, out, logw io.Writer) error

Serve reads newline-delimited JSON-RPC messages from in, dispatches each, and writes one response line per request to out. Notifications receive no response. Diagnostic text goes to logw so it never mixes with protocol output on out. Serve returns when in reaches EOF.

Jump to

Keyboard shortcuts

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