Skip to content

MCP server overview

sextant-mcp is the Model Context Protocol server that exposes Sextant’s grading engine to agents. It speaks JSON-RPC 2.0 over either stdio or HTTP and surfaces five tools.

ToolPurpose
grade_diffGrade just the changed lines. Inner-loop fast.
grade_filesGrade entire files. Slower, thorough.
list_rulesList every loaded rule.
explain_ruleFetch a rule’s full markdown documentation.
get_configReturn the resolved Sextant config.

The schemas come straight from the engine’s Report / Verdict types — same data the CLI returns in --format json.

Terminal window
sextant-mcp

The standard MCP transport: JSON-RPC over stdin/stdout, one message per line. Logging goes to stderr. This is what Claude Code, Claude Desktop, and most other MCP clients use.

Terminal window
sextant-mcp --http 127.0.0.1:7878

Newline-delimited JSON-RPC over HTTP at the bound address. Each request is a single POST to /. Useful for clients that don’t speak stdio, debugging via curl, or running the server as a long-lived daemon.

Terminal window
curl -sS http://127.0.0.1:7878/ \
-H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
VariablePurpose
RUST_LOGtracing env-filter. Defaults to warn. Try RUST_LOG=sextant_mcp=debug while debugging.
ANTHROPIC_API_KEYUsed by LLM-evaluated rules when [judge] selects an Anthropic model.
OPENAI_API_KEYSame, for OpenAI models.
SEXTANT_NO_LLMIf set to 1, disables LLM evaluators globally — same as the CLI’s --no-llm.

The server reads .sextant/config.toml and .sextant/rules/**/*.md from the current working directory’s repository root, just like the CLI. Run it from the repo root.

All log output goes to stderr. The stdio transport reserves stdout for the JSON-RPC protocol, so any println! to stdout would corrupt the stream. In HTTP mode, stderr still gets the logs.

For verbose tracing during development:

Terminal window
RUST_LOG=sextant_mcp=debug,sextant_engine=debug sextant-mcp