Skip to content

Commit f2ca24c

Browse files
authored
cypher - update docker docs, add workflow image and desc (#147)
1 parent 1194069 commit f2ca24c

File tree

2 files changed

+57
-33
lines changed

2 files changed

+57
-33
lines changed

servers/mcp-neo4j-cypher/README.md

Lines changed: 57 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22

33
## 🌟 Overview
44

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.
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 further with an application's analysis tools.
6+
7+
This MCP server facilitates Text2Cypher workflows like the one detailed below.
8+
9+
* Blue steps are handled by the agent
10+
* Purple by the Cypher or another MCP server
11+
* Green by the user
12+
13+
A user question is input to the process and the output is an answer generated by the agent.
14+
15+
![text2cypher-workflow](./assets/images/text2cypher-process.png)
16+
617

718
## 🧩 Components
819

@@ -47,7 +58,7 @@ This is useful when you need to connect to multiple Neo4j databases or instances
4758
Build and run locally for testing or remote deployment:
4859

4960
```bash
50-
# Build the Docker image with a custom name
61+
# Build the Docker image with a custom name from your local version of the server
5162
docker build -t mcp-neo4j-cypher:latest .
5263

5364
# Run locally (uses http transport by default for Docker)
@@ -87,15 +98,17 @@ Can be found on PyPi https://pypi.org/project/mcp-neo4j-cypher/
8798
Add the server to your `claude_desktop_config.json` with the database connection configuration through environment variables. You may also specify the transport method and namespace with cli arguments or environment variables.
8899

89100
```json
90-
"mcpServers": {
91-
"neo4j-database": {
92-
"command": "uvx",
93-
"args": [ "[email protected]", "--transport", "stdio" ],
94-
"env": {
95-
"NEO4J_URI": "bolt://localhost:7687",
96-
"NEO4J_USERNAME": "neo4j",
97-
"NEO4J_PASSWORD": "<your-password>",
98-
"NEO4J_DATABASE": "neo4j"
101+
{
102+
"mcpServers": {
103+
"neo4j-database": {
104+
"command": "uvx",
105+
"args": [ "[email protected]", "--transport", "stdio" ],
106+
"env": {
107+
"NEO4J_URI": "bolt://localhost:7687",
108+
"NEO4J_USERNAME": "neo4j",
109+
"NEO4J_PASSWORD": "<your-password>",
110+
"NEO4J_DATABASE": "neo4j"
111+
}
99112
}
100113
}
101114
}
@@ -190,32 +203,43 @@ Syntax with `--db-url`, `--username`, `--password` and other command line argume
190203

191204
### 🐳 Using with Docker
192205

206+
Here we use the Docker Hub hosted Cypher MCP server image with stdio transport for use with Claude Desktop.
207+
208+
**Config details:**
209+
* `-i`: Interactive mode - keeps STDIN open for stdio transport communication
210+
* `--rm`: Automatically remove container when it exits (cleanup)
211+
* `-p 8000:8000`: Port mapping - maps host port 8000 to container port 8000
212+
* `NEO4J_TRANSPORT=stdio`: Uses stdio transport for Claude Desktop compatibility
213+
* `NEO4J_NAMESPACE=neo4j`: Prefixes tools with "neo4j-" (e.g., `neo4j-read_neo4j_cypher`)
214+
* `NEO4J_URI=bolt://host.docker.internal:7687`: Allows Docker container to connect to Neo4j running on host machine
215+
193216
```json
194-
"mcpServers": {
195-
"neo4j": {
196-
"command": "docker",
197-
"args": [
198-
"run",
199-
"--rm",
200-
"-e", "NEO4J_URI=bolt://host.docker.internal:7687",
201-
"-e", "NEO4J_USERNAME=neo4j",
202-
"-e", "NEO4J_PASSWORD=<your-password>",
203-
"-e", "NEO4J_NAMESPACE=mydb",
204-
"-e", "NEO4J_TRANSPORT=http",
205-
"-e", "NEO4J_MCP_SERVER_HOST=0.0.0.0",
206-
"-e", "NEO4J_MCP_SERVER_PORT=8000",
207-
"-e", "NEO4J_MCP_SERVER_PATH=/api/mcp/",
208-
"mcp/neo4j-cypher:latest"
209-
]
217+
{
218+
"mcpServers": {
219+
"neo4j": {
220+
"command": "docker",
221+
"args": [
222+
"run",
223+
"-i",
224+
"--rm",
225+
"-p",
226+
"8000:8000",
227+
"-e", "NEO4J_URI=bolt://host.docker.internal:7687",
228+
"-e", "NEO4J_USERNAME=neo4j",
229+
"-e", "NEO4J_PASSWORD=password",
230+
"-e", "NEO4J_NAMESPACE=neo4j",
231+
"-e", "NEO4J_TRANSPORT=stdio",
232+
"mcp/neo4j-cypher:latest"
233+
]
234+
}
210235
}
211236
}
212237
```
213238

214-
**Note**: This assumes you've built the image locally with `docker build -t mcp-neo4j-cypher:latest .`. Docker transport defaults to HTTP mode.
215239

216240
## 🐳 Docker Deployment
217241

218-
The Neo4j MCP server can be deployed using Docker for remote deployments. Docker deployment uses HTTP transport by default for web accessibility.
242+
The Neo4j MCP server can be deployed using Docker for remote deployments. Docker deployment uses HTTP transport by default for web accessibility. In order to integrate this deployment with applications like Claude Desktop, you will have to use a proxy in your MCP configuration such as `mcp-remote`.
219243

220244
### 📦 Using Your Built Image
221245

@@ -231,7 +255,7 @@ docker run --rm -p 8000:8000 \
231255
-e NEO4J_TRANSPORT="http" \
232256
-e NEO4J_MCP_SERVER_HOST="0.0.0.0" \
233257
-e NEO4J_MCP_SERVER_PORT="8000" \
234-
-e NEO4J_MCP_SERVER_PATH="/api/mcp/" \
258+
-e NEO4J_MCP_SERVER_PATH="/mcp/" \
235259
mcp/neo4j-cypher:latest
236260
```
237261

@@ -243,9 +267,9 @@ docker run --rm -p 8000:8000 \
243267
| `NEO4J_USERNAME` | `neo4j` | Neo4j username |
244268
| `NEO4J_PASSWORD` | `password` | Neo4j password |
245269
| `NEO4J_DATABASE` | `neo4j` | Neo4j database name |
246-
| `NEO4J_TRANSPORT` | `stdio` (local), `http` (Docker) | Transport protocol (`stdio`, `http`, or `sse`) |
270+
| `NEO4J_TRANSPORT` | `stdio` (local), `http` (remote) | Transport protocol (`stdio`, `http`, or `sse`) |
247271
| `NEO4J_NAMESPACE` | _(empty)_ | Tool namespace prefix |
248-
| `NEO4J_MCP_SERVER_HOST` | `127.0.0.1` (local), `0.0.0.0` (Docker) | Host to bind to |
272+
| `NEO4J_MCP_SERVER_HOST` | `127.0.0.1` (local) | Host to bind to |
249273
| `NEO4J_MCP_SERVER_PORT` | `8000` | Port for HTTP/SSE transport |
250274
| `NEO4J_MCP_SERVER_PATH` | `/api/mcp/` | Path for accessing MCP server |
251275

@@ -332,7 +356,7 @@ For Claude Desktop integration with a Dockerized server using http transport:
332356
}
333357
```
334358

335-
**Note**: First start your Docker container with HTTP transport, then Claude Desktop can connect to it via the HTTP endpoint.
359+
**Note**: First start your Docker container with HTTP transport, then Claude Desktop can connect to it via the HTTP endpoint and proxy server like `mcp-remote`.
336360

337361
## 🚀 Development
338362

87.8 KB
Loading

0 commit comments

Comments
 (0)