Skip to content

Commit 76e4f0a

Browse files
committed
Dockerfile for mcp-cypher-neo4j
1 parent ff415de commit 76e4f0a

File tree

3 files changed

+157
-20
lines changed

3 files changed

+157
-20
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# Virtual Environment
24+
venv/
25+
env/
26+
ENV/
27+
28+
# IDE
29+
.idea/
30+
.vscode/
31+
*.swp
32+
*.swo
33+
34+
# Git
35+
.git
36+
.gitignore
37+
38+
# Docker
39+
Dockerfile
40+
.dockerignore
41+
42+
# Documentation
43+
docs/
44+
*.md
45+
!README.md
46+
!pyproject.toml
47+
48+
# Tests
49+
tests/
50+
test/
51+
testing/
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM python:3.11-slim
2+
3+
# Set working directory
4+
WORKDIR /app
5+
6+
# Install build dependencies
7+
RUN pip install --no-cache-dir hatchling
8+
9+
COPY pyproject.toml /app/
10+
11+
# Install dependencies
12+
RUN pip install --no-cache-dir neo4j>=5.26.0 mcp>=1.6.0
13+
14+
15+
# Copy the source code
16+
COPY src/ /app/src/
17+
COPY README.md /app/
18+
19+
RUN pip install --no-cache-dir -e .
20+
21+
# Environment variables for Neo4j connection
22+
ENV NEO4J_URL="bolt://host.docker.internal:7687"
23+
ENV NEO4J_USERNAME="neo4j"
24+
ENV NEO4J_PASSWORD="password"
25+
26+
# Command to run the server using the package entry point
27+
CMD ["sh", "-c", "mcp-neo4j-cypher --db-url ${NEO4J_URL} --username ${NEO4J_USERNAME} --password ${NEO4J_PASSWORD}"]

servers/mcp-neo4j-cypher/README.md

Lines changed: 79 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
1-
# Neo4j MCP Server
1+
# 🔍⁉️ Neo4j MCP Server
22

3-
## Overview
4-
A Model Context Protocol (MCP) server implementation 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 when an Anthropic API key is provided.
3+
## 🌟 Overview
54

6-
## Components
5+
A Model Context Protocol (MCP) server implementation 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.
76

8-
### Resources
7+
## 🧩 Components
98

10-
### Prompts
11-
The server provides a demonstration prompt:
12-
- `mcp-demo`: Interactive prompt that guides users through database operations
13-
- Generates appropriate database schemas and sample data
9+
### 🛠️ Tools
1410

15-
### Tools
16-
The server offers six core tools:
11+
The server offers these core tools:
1712

18-
#### Query Tools
13+
#### 📊 Query Tools
1914
- `read-neo4j-cypher`
2015
- Execute Cypher read queries to read data from the database
2116
- Input:
@@ -26,21 +21,21 @@ The server offers six core tools:
2621
- Execute updating Cypher queries
2722
- Input:
2823
- `query` (string): The Cypher update query
29-
- Returns: a result summary counter with `{ nodes_updated: number, relationships_created: number, ... }`
24+
- Returns: A result summary counter with `{ nodes_updated: number, relationships_created: number, ... }`
3025

31-
#### Schema Tools
26+
#### 🕸️ Schema Tools
3227
- `get-neo4j-schema`
3328
- Get a list of all nodes types in the graph database, their attributes with name, type and relationships to other node types
3429
- No input required
3530
- Returns: List of node label with two dictionaries one for attributes and one for relationships
3631

37-
## Usage with Claude Desktop
32+
## 🔧 Usage with Claude Desktop
3833

39-
### Released Package
34+
### 💾 Released Package
4035

4136
Can be found on PyPi https://pypi.org/project/mcp-neo4j-cypher/
4237

43-
Add the server to your `claude_desktop_config.json` with configuration of
38+
Add the server to your `claude_desktop_config.json` with configuration of:
4439

4540
* db-url
4641
* username
@@ -63,7 +58,7 @@ Add the server to your `claude_desktop_config.json` with configuration of
6358
}
6459
```
6560

66-
Here is an example connection for the movie database with Movie, Person (Actor, Director), Genre, User and ratings.
61+
Here is an example connection for the movie database with Movie, Person (Actor, Director), Genre, User and ratings:
6762

6863
```json
6964
{
@@ -79,7 +74,56 @@ Here is an example connection for the movie database with Movie, Person (Actor,
7974
}
8075
```
8176

82-
### Development
77+
### 🐳 Using with Docker
78+
79+
```json
80+
"mcpServers": {
81+
"neo4j": {
82+
"command": "docker",
83+
"args": [
84+
"run",
85+
"--rm",
86+
"-e", "NEO4J_URL=bolt://host.docker.internal:7687",
87+
"-e", "NEO4J_USERNAME=neo4j",
88+
"-e", "NEO4J_PASSWORD=<your-password>",
89+
"mcp/neo4j-cypher:0.1.1"
90+
]
91+
}
92+
}
93+
```
94+
95+
## 🚀 Development
96+
97+
### 📦 Prerequisites
98+
99+
1. Install `uv` (Universal Virtualenv):
100+
```bash
101+
# Using pip
102+
pip install uv
103+
104+
# Using Homebrew on macOS
105+
brew install uv
106+
107+
# Using cargo (Rust package manager)
108+
cargo install uv
109+
```
110+
111+
2. Clone the repository and set up development environment:
112+
```bash
113+
# Clone the repository
114+
git clone https://github.com/yourusername/mcp-neo4j-cypher.git
115+
cd mcp-neo4j-cypher
116+
117+
# Create and activate virtual environment using uv
118+
uv venv
119+
source .venv/bin/activate # On Unix/macOS
120+
.venv\Scripts\activate # On Windows
121+
122+
# Install dependencies including dev dependencies
123+
uv pip install -e ".[dev]"
124+
```
125+
126+
### 🔧 Development Configuration
83127

84128
```json
85129
# Add the server to your claude_desktop_config.json
@@ -102,6 +146,21 @@ Here is an example connection for the movie database with Movie, Person (Actor,
102146
}
103147
```
104148

105-
## License
149+
### 🐳 Docker
150+
151+
Build and run the Docker container:
152+
153+
```bash
154+
# Build the image
155+
docker build -t mcp/neo4j-cypher:0.1.1 .
156+
157+
# Run the container
158+
docker run -e NEO4J_URL="bolt://host.docker.internal:7687" \
159+
-e NEO4J_USERNAME="neo4j" \
160+
-e NEO4J_PASSWORD="your-password" \
161+
mcp/neo4j-cypher:0.1.1
162+
```
163+
164+
## 📄 License
106165

107166
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

0 commit comments

Comments
 (0)