Skip to content

feat: MCP Phase 1 — Code Intelligence tools (#284) - #287

Merged
ajianaz merged 1 commit into
developfrom
feat/mcp-phase1-code-intel
Jun 14, 2026
Merged

feat: MCP Phase 1 — Code Intelligence tools (#284)#287
ajianaz merged 1 commit into
developfrom
feat/mcp-phase1-code-intel

Conversation

@ajianaz

Copy link
Copy Markdown
Collaborator

MCP Phase 1 — Code Intelligence Tools

Expose v0.6/v0.7 code intelligence to AI agents (Claude Code, Cursor, Windsurf).

5 New MCP Tools

ToolInputOutputVerified
cora.search_symbolsquery, kind?, file?, language?, limit?JSON: matching symbols
cora.find_callerssymbol, limit?JSON: caller locations✅ 11 callers
cora.find_impactsymbol, depth?JSON: affected symbols by depth✅ 21 sites
cora.find_affected_testsfiles[]JSON: affected test files✅ 2 files
cora.index_statusJSON: symbol/file/language stats✅ 534 symbols

Design

  • Read-only: no side effects, no writes
  • JSON output: structured for agent parsing
  • Graceful: "no index, run cora index first" error
  • Fast: <100ms (no LLM calls)
  • Stateless: each call independent

Tests

  • 559 total (+7 new: parameter validation + tool listing)
  • Clippy clean, fmt clean
  • Runtime verified via full MCP protocol handshake + tool calls

Example Agent Session

Agent: "Where is open_index defined?"
→ cora.search_symbols("open_index")
→ [{name: "open_index", kind: "function", file: "src/index/mod.rs", line: 22}]
Agent: "What breaks if I change it?"
→ cora.find_impact("open_index", depth=2)
→ [21 affected symbols across 2 depth levels]
Agent: "Which tests should I run?"
→ cora.find_affected_tests(["src/index/mod.rs"])
→ {affected_tests: ["tests/cli_basic.rs"], count: 1}

Add 5 MCP tools for code intelligence:
- cora.search_symbols: FTS5 search across symbol index
Input: query, kind?, file?, language?, limit?
Output: JSON array of matching symbols
- cora.find_callers: reverse call graph traversal
Input: symbol, limit?
Output: JSON array of caller locations
- cora.find_impact: blast radius analysis
Input: symbol, depth?
Output: JSON array of affected symbols by depth level
- cora.find_affected_tests: test file selection
Input: files[] (changed source files)
Output: JSON with affected_tests array + count
- cora.index_status: index health check
Input: none
Output: JSON with total_symbols, files, by_kind, by_language
All tools:
- Read-only (no side effects)
- JSON output for agent parsing
- Graceful degradation (helpful error if no index)
- Fast: <100ms (no LLM calls)
- Stateless
Runtime verified via MCP protocol:
index_status → 534 symbols, 49 files ✅
find_callers open_index → 11 callers ✅
find_impact open_index -d 2 → 21 affected sites ✅
find_affected_tests src/main.rs → 2 test files ✅
7 new unit tests (parameter validation + tool listing).
559 tests total, clippy clean.
@ajianaz
ajianaz merged commit 817de0f into developJun 14, 2026
10 checks passed
@ajianaz
ajianaz deleted the feat/mcp-phase1-code-intel branch June 14, 2026 07:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@ajianaz