Skip to content

feat: add local stdio MCP server subcommand (codeint mcp) - #164

Merged
avidianity merged 1 commit into
mainfrom
feat/mcp-server
Nov 22, 2026
Merged

avidianity merged 1 commit into
mainfrom
feat/mcp-server

Conversation

@avidianity

Copy link
Copy Markdown
Owner

Summary

Add the built-in local stdio Model Context Protocol (MCP) server subcommand (codeint mcp) so coding agents (Claude Code, Cursor, Codex, Antigravity) can call check, diff, and trend directly as structured read-only tools with zero new external dependencies.

Closes #161

Tier

Tier 2 from the tier check: adds crates/cli/src/mcp.rs, crates/cli/tests/mcp.rs, Command::Mcp, and MCP documentation.

Task

Spec #161:

  • Add codeint mcp subcommand in crates/config and crates/cli.
  • Implement JSON-RPC 2.0 over stdin/stdout (initialize, notifications/initialized, ping, tools/list, tools/call) exposing read-only check, diff, and trend tools using existing serde_json dependency.
  • Add end-to-end stdio integration tests in crates/cli/tests/mcp.rs.
  • Document codeint mcp in docs/reference.md, docs/guide/mcp.md, docs/guide/README.md, and llms.txt.

Fail-first test

  • Test: crates/cli/tests/mcp.rs::mcp_initialize_list_and_call_tools and crates/cli/tests/reference
  • Before the change: codeint mcp did not exist and tests/reference failed until ### codeint mcp and the top-level command row were documented.
  • After the change: tests/mcp.rs passed (1 passed; 0 failed) and tests/reference passed (5 passed; 0 failed).

Checks

Check Result
cargo clippy --workspace --all-targets -- -D warnings passed
cargo test --package codeint-cli --test mcp passed (1/1)
cargo test --package codeint-cli --test reference passed (5/5)
cargo run --package xtask -- merged-result passed
cargo run --package codeint-cli -- diff origin/main passed (0 new findings, 1 erosion finding resolved)
Pre-commit and commit-msg hooks passed

Safety proof

  • Safety fact: codeint mcp runs strictly over stdin/stdout with no open network port, exposes only read-only measurement tools (check, diff, trend), compiles with #![forbid(unsafe_code)], and adds zero new external crates.
  • Proof: crates/cli/tests/mcp.rs::mcp_initialize_list_and_call_tools drives the real codeint mcp binary over stdin/stdout pipes and verifies initialize, tools/list, check, diff, trend, and -32601 unknown-method error responses.
  • interrogate: none required below Tier 3.

Runtime evidence

  • Build revision: 4aa9f46
  • Verified codeint mcp over stdio pipes against a real Git repository in crates/cli/tests/mcp.rs and codeint mcp EOF exit 0 in crates/cli/tests/reference.

Gaps

  • Deferred coverage: none
  • Pre-existing failures: none
  • Environmental failures: none

@github-actions github-actions Bot added the tier-2 Tier 2 from the tier check label Nov 22, 2026
@avidianity
avidianity merged commit bec01b4 into main Nov 22, 2026
13 checks passed
@avidianity
avidianity deleted the feat/mcp-server branch November 22, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tier-2 Tier 2 from the tier check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spec: Built-in stdio MCP server (codeint mcp)

1 participant