forked from blarApp/blarify
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Feature: MCP Server for AI Agent Graph Queries
Overview
Build an MCP (Model Context Protocol) server that provides AI coding agents with sophisticated tools to query and analyze the Blarify graph database. This will enable AI agents to understand codebases deeply by accessing the rich graph representations Blarify creates.
Problem
AI coding agents currently lack standardized ways to:
- Query complex code relationships in the Blarify graph
- Retrieve contextual information about code elements
- Plan changes based on codebase structure
- Access the semantic knowledge stored in Neo4j
Solution
Create an MCP server with three primary tools:
-
getContextForFiles: Retrieve comprehensive context for specified files- Traverses graph to find related classes, functions, dependencies
- Includes LLM summaries and documentation links
- Returns organized Markdown structure
-
getContextForSymbol: Get context for a specific symbol (class/function/variable)- Finds definitions, usages, and relationships
- Includes inheritance chains and implementations
- Shows where symbol is used across codebase
-
buildPlanForChange: Generate implementation plan for a change request- Analyzes impact across codebase
- Identifies files to modify/create
- Orders changes by dependency
- Includes test and documentation updates
Technical Approach
- Build on existing neo4j-cypher and gds-agent MCP servers
- Use Cypher queries for graph traversal
- Integrate Azure OpenAI for organizing results into coherent Markdown
- Handle complex multi-hop traversals efficiently
Implementation Steps
- Set up MCP server scaffold
- Implement Neo4j connection and base queries
- Build graph traversal logic for context extraction
- Integrate LLM for result processing
- Implement the three custom tools
- Add error handling and query optimization
- Write comprehensive tests
- Create documentation and examples
Testing
- Unit tests for query builders
- Integration tests with sample graphs
- End-to-end MCP tool tests
- Mocked LLM response tests
Success Criteria
- AI agents can query code relationships effectively
- Context retrieval is accurate and well-organized
- Change planning identifies all dependencies
- Performance is acceptable for large codebases
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels