
my neo4j project1
构建连接 Neo4j 图数据库的 MCP 服务器,提供模式、查询工具和数据分析功能。
Repository Info
About This Server
构建连接 Neo4j 图数据库的 MCP 服务器,提供模式、查询工具和数据分析功能。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Neo4j MCP Server
This project creates a Model Context Protocol (MCP) server that connects to a Neo4j graph database, exposing database schemas, providing Cypher query tools, and including prompts for common data analysis tasks.
Features
- Neo4j Database Connection: Securely connects to your company's Neo4j database
- Schema Resources: Exposes database schema information as MCP resources
- Cypher Query Tools: Provides tools for running read-only Cypher queries
- Analysis Prompts: Includes pre-built prompts for common data analysis tasks
Installation
Prerequisites
- Python 3.8+
- Neo4j database
- uv (recommended) or pip
Setup
-
Clone this repository or create a new project:
uv init my-neo4j-project cd my-neo4j-project -
Create and activate a virtual environment:
uv venv source .venv/bin/activate # On Unix/MacOS # or .venv\Scripts\activate # On Windows -
Install dependencies:
uv add "mcp[cli]" neo4j python-dotenv -
Create a
.envfile with your Neo4j credentials:NEO4J_URI=bolt://localhost:7687 NEO4J_USER=neo4j NEO4J_PASSWORD=your_password
Usage
Development Mode
Test the server using the MCP Inspector:
mcp dev neo4j_server.py
This opens an interactive interface where you can explore the server's resources, tools, and prompts.
Claude Desktop Integration
Install the server in Claude Desktop:
mcp install neo4j_server.py --name "Neo4j Explorer"
Direct Execution
Run the server directly:
python neo4j_server.py
Server Capabilities
Resources
- Complete Schema (
neo4j://schema): Provides a comprehensive view of nodes, relationships, and properties - Node Labels (
neo4j://labels): Lists all node types in the database - Relationship Types (
neo4j://relationships): Lists all relationship types - Node Properties (
neo4j://nodes/{label}/properties): Shows properties for specific node types
Tools
- Execute Cypher: Runs read-only Cypher queries with security checks
- Count Nodes: Counts nodes with a specific label
- Find Relationships: Discovers relationships between node types
Prompts
- Explore Schema: General database structure exploration
- Analyze Data: In-depth analysis of specific node types
- Find Paths: Discovering connections between different node types
Security Features
- Read-only operations enforced through query validation
- Credential protection using environment variables
- Comprehensive error handling
- Protection against common security vulnerabilities
Troubleshooting
If you encounter connection issues:
- Verify your Neo4j credentials in the
.envfile - Ensure your Neo4j database is running and accessible
- Check the server logs for detailed error messages
- Test connectivity using the MCP Inspector:
mcp dev neo4j_server.py
Extending the Server
You can extend this server by:
- Adding more specialized resources for specific data views
- Creating additional analysis tools for your specific domain
- Implementing visualization tools that return image data
- Adding authentication for multi-user environments
- Implementing caching for frequently accessed schema information
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Citations: [1] https://ppl-ai-file-upload.s3.amazonaws.com/web/direct-files/19272244/08039fc9-fa60-4099-be05-371379047242/README-1.md [2] https://ppl-ai-file-upload.s3.amazonaws.com/web/direct-files/19272244/3850f173-6e5a-4a8a-9e1e-80961fde62f9/llms-full.txt
Quick Start
Clone the repository
git clone https://github.com/ujjalcal/my-neo4j-project1Install dependencies
cd my-neo4j-project1
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.