MCP server for intelligent codebase analysis using AST parsing, knowledge graphs, and semantic search. Builds comprehensive code understanding graphs with Neo4j and ChromaDB, supports surgical updates from git diffs, and provides natural language querying over codebases.
Code Grapher MCP server has a foundation with 4 well-named tools and descriptions present for all tools and parameters. However, there are significant gaps in output schema documentation, error handling guidance, and completeness of parameter descriptions. Tools follow verb-noun naming convention (create_, update_, query_, get_) which aids LLM intent inference. Descriptions are detailed (ranging 150-250 chars) and explain WHAT each tool does and WHEN to use it. However, the sample code provided shows only stub implementations in mcp_server_refactored.py with incomplete error handling. The original mcp_server.py is cut off mid-workflow, preventing full assessment of output schemas and error recovery patterns. Input schemas are present with proper types (object, string, boolean, integer, array) and descriptions for all parameters. No output schemas are documented in the visible code. Tool implementations appear to exist but are not fully visible for verification.
Build comprehensive knowledge graph from codebase using AST analysis. Parses ALL source files (Python, TypeScript, JavaScript, JSON, Markdown) using AST for 100% accuracy. Extracts 25+ entity types (functions, classes, imports, decorators, dependencies, documentation, etc.). Detects relationships: INHERITS, DECORATES, CALLS, DEPENDS_ON, DOCUMENTS across files. Automatically loads PRIMER.md for business context in AI descriptions. Creates semantic embeddings for intelligent search. Processes typical codebase in 30-60 seconds.
Traverse relationships to specified depth to understand entity connections and architectural impact. Explores how changing an entity affects other parts of the codebase. Shows INHERITS, CALLS, DEPENDS_ON, DECORATES relationships. Helps understand impact analysis and architectural connections.
Find relevant code using natural language queries with semantic + structural understanding. Combines vector similarity (meaning) + graph traversal (structure). Returns actual code snippets with context. Understands business logic, not just keywords. Provides relevance-ranked results.
Efficiently update existing graph based on specific git changes (surgical updates). Analyzes git diff to identify changed files. Updates only affected entities and relationships. Much faster than full reanalysis (seconds vs minutes). Maintains graph consistency during updates.
Output schemas not documented. Tools return TextContent or JSON but no structured schema is declared for LLM understanding of response fields.
No pagination support visible. query_code_graph accepts max_results (5-20 range) but no pagination token, offset, or total_count is documented in output.
Error handling in tool handlers returns generic TextContent with prefixed '❌' text. No error categorization (retryable, user-fixable, fatal) or recovery guidance provided.
No dry-run or confirmation step for destructive operation create_code_graph with clear_existing=true. Agent could accidentally wipe graph without safeguard.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 68 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 9 | - | v1 |
Parameter 'primer_file_path' in create_code_graph lacks validation constraints. No mention of required format, max length, or what happens if file doesn't exist.
query_code_graph parameter 'query' has no length limit, max complexity, or constraint on natural language format. LLM could pass multi-paragraph queries.
get_related_entities 'relationship_types' is an unconstrained array. Should be an enum to prevent invalid relationship type strings.
No tool annotations visible (readOnlyHint, destructiveHint, idempotentHint). Audit trail and permission declarations missing.