feat: add MCP server for Neo4j graph queries#11
Merged
Conversation
This MCP server provides AI coding agents with sophisticated tools to query and analyze the Blarify graph database. It enables AI agents to understand codebases deeply by accessing the rich graph representations Blarify creates. Key features: - Three main tools: getContextForFiles, getContextForSymbol, buildPlanForChange - Intelligent Cypher query building for complex graph traversals - LLM integration to organize results into coherent Markdown - Comprehensive context extraction with configurable depth - Impact analysis for change planning - Support for fuzzy symbol matching - Error handling and performance optimization Tools: 1. getContextForFiles: Retrieves comprehensive context for specified files 2. getContextForSymbol: Gets detailed context for symbols (classes, functions, etc.) 3. buildPlanForChange: Analyzes codebase and creates implementation plans The server uses Neo4j for graph queries and Azure OpenAI for intelligent result formatting. It includes comprehensive tests, documentation, and usage examples. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Added full integration testing suite that actually tests the MCP server with a real Neo4j database: - Docker-compose setup for Neo4j test environment - Test graph setup script that creates realistic Blarify data - Integration tests that verify all MCP tools work with real data - Manual test script for interactive testing - CI/CD workflow for automated testing - Convenience script for running integration tests The test graph includes: - Folder structure with src, tests, docs directories - Code nodes: UserService, AuthService, UserController classes - Relationships: inheritance, method calls, imports, usage - Documentation nodes with concepts and links - LLM descriptions for key classes - Filesystem nodes - Test file relationships This ensures the MCP server is thoroughly tested with realistic data before deployment. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
rysweet
added a commit
that referenced
this pull request
Aug 3, 2025
feat: add MCP server for Neo4j graph queries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Details
This PR implements issue #10 to create an MCP (Model Context Protocol) server that provides AI coding agents with sophisticated tools to query and analyze Blarify graph databases.
Tools Implemented
getContextForFilesgetContextForSymbolbuildPlanForChangeArchitecture
Testing
This PR includes comprehensive testing:
Unit Tests
Integration Tests
Test Data
The test setup creates a realistic graph with:
Configuration
Environment variables:
NEO4J_URI,NEO4J_USERNAME,NEO4J_PASSWORD: Neo4j connectionAZURE_OPENAI_API_KEY,AZURE_OPENAI_ENDPOINT: LLM configurationMAX_TRAVERSAL_DEPTH,MAX_CONTEXT_LENGTH: Performance tuningUsage Example
Test plan
How to Test
Run unit tests:
Run integration tests:
cd mcp-blarify-server ./run_integration_tests.shManual testing:
cd mcp-blarify-server docker-compose up -d python tests/setup_test_graph.py python manual_test.py🤖 Generated with Claude Code