Neo4j MCP Server
A TypeScript MCP server for executing Cypher queries and exploring Neo4j graph databases, enabling natural language database interaction through Claude.
README
πβοΈ Neo4j MCP Server (TypeScript)
π Overview
A Model Context Protocol (MCP) server implementation in TypeScript that provides database interaction and allows graph exploration capabilities through Neo4j. This server enables running Cypher graph queries, analyzing complex domain data, and automatically generating business insights that can be enhanced with Claude's analysis.
This is a TypeScript port of the original Python mcp-neo4j-cypher server.
π§© Components
π οΈ Tools
The server offers these core tools:
π Query Tools
-
read_neo4j_cypher- Execute Cypher read queries to read data from the database
- Input:
query(string): The Cypher query to executeparams(object, optional): Parameters to pass to the Cypher query
- Returns: Query results as JSON serialized array of objects
-
write_neo4j_cypher- Execute updating Cypher queries
- Input:
query(string): The Cypher update queryparams(object, optional): Parameters to pass to the Cypher query
- Returns: A JSON serialized result summary counter with update statistics
πΈοΈ Schema Tools
get_neo4j_schema- Get a list of all node types in the graph database, their attributes with name, type and relationships to other node types
- No input required
- Returns: JSON serialized list of node labels with two dictionaries: one for attributes and one for relationships
π·οΈ Namespacing
The server supports namespacing to allow multiple Neo4j MCP servers to be used simultaneously. When a namespace is provided, all tool names are prefixed with the namespace followed by a hyphen (e.g., mydb-read_neo4j_cypher).
π¦ Installation
- Clone this repository or copy the source files to your project
- Install dependencies:
cd neo4j-mcp-typesccript yarn install - Build the TypeScript code:
yarn build
π§ͺ Testing the Connection
Before running the server, you can test your Neo4j connection:
yarn test:connection
This will verify that the server can connect to your Neo4j instance.
π Usage
π₯οΈ Command Line
You can run the server directly from the command line:
# Using stdio transport (default)
node dist/index.js --db-url bolt://localhost:7687 --username neo4j --password password
# Using HTTP transport
node dist/index.js --transport http --server-host 0.0.0.0 --server-port 8000
# Using SSE transport
node dist/index.js --transport sse --server-host 0.0.0.0 --server-port 8000
π§ Environment Variables
You can also configure the server using environment variables:
# Neo4j Connection
export NEO4J_URI=bolt://localhost:7687
export NEO4J_USERNAME=neo4j
export NEO4J_PASSWORD=password
export NEO4J_DATABASE=neo4j
# MCP Server Configuration
export NEO4J_TRANSPORT=stdio
export NEO4J_NAMESPACE=mydb
export NEO4J_MCP_SERVER_HOST=127.0.0.1
export NEO4J_MCP_SERVER_PORT=8000
export NEO4J_MCP_SERVER_PATH=/mcp/
# Then run
node dist/index.js
π» Claude Desktop Integration
Add the server to your claude_desktop_config.json:
{
"mcpServers": {
"neo4j-typescript": {
"command": "node",
"args": ["/path/to/neo4j-mcp-typescript/dist/index.js"],
"env": {
"NEO4J_URI": "bolt://localhost:7687",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": "your-password",
"NEO4J_DATABASE": "neo4j"
}
}
}
}
π³ Docker Support
You can also run this in a Docker container. Create a Dockerfile:
FROM node:18-alpine
WORKDIR /app
# Copy package files
COPY package*.json ./
RUN npm install
# Copy source files
COPY . .
# Build TypeScript
RUN npm run build
# Set environment variables
ENV NEO4J_URI="bolt://host.docker.internal:7687"
ENV NEO4J_USERNAME="neo4j"
ENV NEO4J_PASSWORD="password"
ENV NEO4J_DATABASE="neo4j"
ENV NEO4J_TRANSPORT="http"
ENV NEO4J_MCP_SERVER_HOST="0.0.0.0"
ENV NEO4J_MCP_SERVER_PORT="8000"
ENV NEO4J_MCP_SERVER_PATH="/api/mcp/"
EXPOSE 8000
CMD ["node", "dist/index.js"]
π Transport Modes
The server supports different transport protocols:
- STDIO (default for local development): Standard input/output for Claude Desktop and local tools
- HTTP: RESTful HTTP for web deployments and microservices
- SSE: Server-Sent Events for web-based deployments
π§ Development
- Clone the repository
- Install dependencies:
yarn install - Run in development mode:
yarn dev - Build for production:
yarn build - Run tests:
yarn test(if tests are added)
π License
This MCP server is licensed under the MIT License.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.