Skip to content

Conversation

@shivasurya
Copy link
Owner

@shivasurya shivasurya commented Jan 10, 2026

Summary

Implements Model Context Protocol (MCP) server for AI coding assistant integration.

Key features:

  • MCP protocol handler with JSON-RPC 2.0 support
  • 6 code intelligence tools: get_index_info, find_symbol, get_callers, get_callees, get_call_details, resolve_import
  • pathfinder serve command for stdio transport
  • Integration with existing call graph infrastructure

Tools provided:

Tool Description
get_index_info Project metadata and statistics
find_symbol Symbol lookup by name
get_callers Find all callers of a function
get_callees Find all callees from a function
get_call_details Call site details between functions
resolve_import Resolve import paths to files

Designed for Claude Code, Codex CLI, and other MCP-compatible assistants.

@shivasurya shivasurya added the enhancement New feature or request label Jan 10, 2026
@shivasurya shivasurya self-assigned this Jan 10, 2026
@shivasurya shivasurya changed the title feat(mcp): add serve command foundation for MCP server feat(mcp): add MCP server foundation with protocol handler and tools Jan 10, 2026
@codecov
Copy link

codecov bot commented Jan 10, 2026

Codecov Report

❌ Patch coverage is 0.83507% with 475 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.54%. Comparing base (21d144e) to head (8dab96e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sast-engine/mcp/tools.go 0.00% 351 Missing ⚠️
sast-engine/mcp/server.go 0.00% 91 Missing ⚠️
sast-engine/cmd/serve.go 14.81% 23 Missing ⚠️
sast-engine/mcp/types.go 0.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #454      +/-   ##
==========================================
- Coverage   80.41%   76.54%   -3.88%     
==========================================
  Files          85       89       +4     
  Lines        9370     9849     +479     
==========================================
+ Hits         7535     7539       +4     
- Misses       1527     2002     +475     
  Partials      308      308              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@safedep
Copy link

safedep bot commented Jan 10, 2026

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

This report is generated by SafeDep Github App

shivasurya and others added 3 commits January 9, 2026 23:43
Add basic structure for MCP server integration:
- cmd/serve.go: New 'serve' command that builds index and starts server
- mcp/types.go: JSON-RPC 2.0 and MCP protocol type definitions
- mcp/server.go: Server struct skeleton (implementation in next commit)

The serve command:
- Initializes code graph (AST parsing)
- Builds module registry
- Builds call graph using 5-pass algorithm
- Reports index stats to stderr
- Starts MCP server on stdio (skeleton)

Part 1/3 of MCP server PoC.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Full implementation of MCP server protocol:
- stdio reader/writer with JSON-RPC 2.0
- Request dispatch to appropriate handlers
- initialize: Returns server info and capabilities
- initialized: Acknowledgment (no response)
- tools/list: Returns 6 tool definitions
- tools/call: Dispatches to tool executor

Includes:
- Request timing logged to stderr
- Client info logging on initialize
- Basic error handling for parse/method errors
- get_index_info tool working for smoke testing

Other tools return "not yet implemented" - full implementation in Commit 3.

Part 2/3 of MCP server PoC.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Complete tool implementations for code intelligence queries:

1. get_index_info: Returns project stats (functions, edges, modules)
2. find_symbol: Finds symbols by name with metadata (type, params, decorators)
3. get_callers: Reverse call graph with call site locations
4. get_callees: Forward call graph with resolution status and type inference
5. get_call_details: Full call site info including arguments and resolution
6. resolve_import: Import path resolution with exact/short/partial matching

Features:
- Rich metadata in responses (file, line, return type, parameters)
- Resolution status tracking (resolved vs unresolved with reasons)
- Type inference information when available
- Helpful error messages with suggestions
- Multiple match handling with alternatives
- Detailed tool descriptions with examples for AI assistant usage

Part 3/3 of MCP server PoC. Ready for agent integration testing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@shivasurya shivasurya force-pushed the shiva/poc-mcp-server branch from d1c55ac to 8dab96e Compare January 10, 2026 04:43
Copy link
Owner Author

shivasurya commented Jan 10, 2026

Merge activity

  • Jan 10, 4:45 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 10, 4:46 AM UTC: @shivasurya merged this pull request with Graphite.

@shivasurya shivasurya merged commit e5b421c into main Jan 10, 2026
2 of 4 checks passed
@shivasurya shivasurya deleted the shiva/poc-mcp-server branch January 10, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants