Skip to content

Commit 166a814

Browse files
committed
moved mcp-server-neo4j from neo4j-contrib/modelcontextprotocol-servers to here
1 parent 4bd52cf commit 166a814

File tree

14 files changed

+713
-0
lines changed

14 files changed

+713
-0
lines changed

DEVELOP.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
[Learn more about this workspace setup and its capabilities](https://nx.dev/nx-api/node?utm_source=nx_project&utm_medium=readme&utm_campaign=nx_projects) or run `npx nx graph` to visually explore what was created. Now, let's get you up to speed!
88

9+
Include python support via [@nxlv/python plugin](https://github.com/lucasvieirasilva/nx-plugins/tree/main/packages/nx-python)
10+
911
## Finish your CI setup
1012

1113
[Click here to finish setting up your workspace!](https://cloud.nx.app/connect/Wx1erwy80w)

nx.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
"servers/mcp-neo4j-memory-e2e/**/*",
4141
"servers/mcp-json-memory-e2e/**/*"
4242
]
43+
},
44+
{
45+
"plugin":"@nxlv/python"
4346
}
4447
],
4548
"release": {

package-lock.json

Lines changed: 98 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@nx/js": "20.1.4",
1818
"@nx/node": "20.1.4",
1919
"@nx/workspace": "20.1.4",
20+
"@nxlv/python": "^20.0.1",
2021
"@swc-node/register": "~1.9.1",
2122
"@swc/core": "~1.5.7",
2223
"@swc/helpers": "~0.5.11",

servers/mcp-json-memory/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"files": [],
44
"include": [],
55
"references": [
6+
// @ts-ignore -> https://github.com/nrwl/nx/issues/27292
67
{
78
"path": "./tsconfig.app.json"
89
},

servers/mcp-neo4j-cypher/.flake8

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[flake8]
2+
exclude =
3+
.git,
4+
__pycache__,
5+
build,
6+
dist,
7+
.tox,
8+
venv,
9+
.venv,
10+
.pytest_cache
11+
max-line-length = 120
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12.7

servers/mcp-neo4j-cypher/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Neo4j MCP Server
2+
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.
5+
6+
## Components
7+
8+
### Resources
9+
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
14+
15+
### Tools
16+
The server offers six core tools:
17+
18+
#### Query Tools
19+
- `read-neo4j-cypher`
20+
- Execute Cypher read queries to read data from the database
21+
- Input:
22+
- `query` (string): The Cypher query to execute
23+
- Returns: Query results as array of objects
24+
25+
- `write-neo4j-cypher`
26+
- Execute updating Cypher queries
27+
- Input:
28+
- `query` (string): The Cypher update query
29+
- Returns: a result summary counter with `{ nodes_updated: number, relationships_created: number, ... }`
30+
31+
#### Schema Tools
32+
- `get-neo4j-schema`
33+
- Get a list of all nodes types in the graph database, their attributes with name, type and relationships to other node types
34+
- No input required
35+
- Returns: List of node label with two dictionaries one for attributes and one for relationships
36+
37+
## Usage with Claude Desktop
38+
39+
```bash
40+
# Add the server to your claude_desktop_config.json
41+
"mcpServers": {
42+
"neo4j": {
43+
"command": "uv",
44+
"args": [
45+
"--directory",
46+
"parent_of_servers_repo/servers/src/neo4j",
47+
"run",
48+
"mcp-server-neo4j",
49+
"--db-url",
50+
"bolt://localhost",
51+
"--username",
52+
"neo4j",
53+
"--password",
54+
"<your-password>"
55+
]
56+
}
57+
}
58+
```
59+
60+
## License
61+
62+
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.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[project]
2+
name = "mcp-server-neo4j"
3+
version = "0.5.1"
4+
description = "A simple neo4j MCP server"
5+
readme = "README.md"
6+
requires-python = ">=3.10"
7+
dependencies = ["mcp>=0.9.1", "neo4j>=5.26.0"]
8+
9+
[build-system]
10+
requires = ["hatchling"]
11+
build-backend = "hatchling.build"
12+
13+
[tool.uv]
14+
dev-dependencies = ["pyright>=1.1.389"]
15+
16+
[project.scripts]
17+
mcp-server-neo4j = "mcp_server_neo4j:main"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from . import server
2+
import asyncio
3+
import argparse
4+
import os
5+
6+
7+
def main():
8+
"""Main entry point for the package."""
9+
parser = argparse.ArgumentParser(description='Neo4j MCP Server')
10+
parser.add_argument('--db-url',
11+
default="bolt://localhost:7687",
12+
help='Neo4j connection URL')
13+
parser.add_argument('--username',
14+
default="neo4j",
15+
help='Neo4j username')
16+
parser.add_argument('--password',
17+
default="password",
18+
help='Neo4j password')
19+
20+
args = parser.parse_args()
21+
asyncio.run(server.main(args.db_url, args.username, args.password))
22+
23+
24+
# Optionally expose other important items at package level
25+
__all__ = ["main", "server"]

0 commit comments

Comments
 (0)