-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved mcp-server-neo4j from neo4j-contrib/modelcontextprotocol-server…
…s to here
- Loading branch information
1 parent
4bd52cf
commit 166a814
Showing
14 changed files
with
713 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[flake8] | ||
exclude = | ||
.git, | ||
__pycache__, | ||
build, | ||
dist, | ||
.tox, | ||
venv, | ||
.venv, | ||
.pytest_cache | ||
max-line-length = 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.12.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Neo4j MCP Server | ||
|
||
## Overview | ||
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. | ||
|
||
## Components | ||
|
||
### Resources | ||
|
||
### Prompts | ||
The server provides a demonstration prompt: | ||
- `mcp-demo`: Interactive prompt that guides users through database operations | ||
- Generates appropriate database schemas and sample data | ||
|
||
### Tools | ||
The server offers six core tools: | ||
|
||
#### Query Tools | ||
- `read-neo4j-cypher` | ||
- Execute Cypher read queries to read data from the database | ||
- Input: | ||
- `query` (string): The Cypher query to execute | ||
- Returns: Query results as array of objects | ||
|
||
- `write-neo4j-cypher` | ||
- Execute updating Cypher queries | ||
- Input: | ||
- `query` (string): The Cypher update query | ||
- Returns: a result summary counter with `{ nodes_updated: number, relationships_created: number, ... }` | ||
|
||
#### Schema Tools | ||
- `get-neo4j-schema` | ||
- Get a list of all nodes types in the graph database, their attributes with name, type and relationships to other node types | ||
- No input required | ||
- Returns: List of node label with two dictionaries one for attributes and one for relationships | ||
|
||
## Usage with Claude Desktop | ||
|
||
```bash | ||
# Add the server to your claude_desktop_config.json | ||
"mcpServers": { | ||
"neo4j": { | ||
"command": "uv", | ||
"args": [ | ||
"--directory", | ||
"parent_of_servers_repo/servers/src/neo4j", | ||
"run", | ||
"mcp-server-neo4j", | ||
"--db-url", | ||
"bolt://localhost", | ||
"--username", | ||
"neo4j", | ||
"--password", | ||
"<your-password>" | ||
] | ||
} | ||
} | ||
``` | ||
|
||
## License | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[project] | ||
name = "mcp-server-neo4j" | ||
version = "0.5.1" | ||
description = "A simple neo4j MCP server" | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
dependencies = ["mcp>=0.9.1", "neo4j>=5.26.0"] | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.uv] | ||
dev-dependencies = ["pyright>=1.1.389"] | ||
|
||
[project.scripts] | ||
mcp-server-neo4j = "mcp_server_neo4j:main" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from . import server | ||
import asyncio | ||
import argparse | ||
import os | ||
|
||
|
||
def main(): | ||
"""Main entry point for the package.""" | ||
parser = argparse.ArgumentParser(description='Neo4j MCP Server') | ||
parser.add_argument('--db-url', | ||
default="bolt://localhost:7687", | ||
help='Neo4j connection URL') | ||
parser.add_argument('--username', | ||
default="neo4j", | ||
help='Neo4j username') | ||
parser.add_argument('--password', | ||
default="password", | ||
help='Neo4j password') | ||
|
||
args = parser.parse_args() | ||
asyncio.run(server.main(args.db_url, args.username, args.password)) | ||
|
||
|
||
# Optionally expose other important items at package level | ||
__all__ = ["main", "server"] |
Binary file added
BIN
+1.24 KB
servers/mcp-neo4j-cypher/src/mcp_server_neo4j/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file added
BIN
+7.91 KB
servers/mcp-neo4j-cypher/src/mcp_server_neo4j/__pycache__/server.cpython-312.pyc
Binary file not shown.
Oops, something went wrong.