Neo4j graph data science server with comprehensive graph algorithms that enables complex graph reasoning and Q&A.
Neither LLMs nor any existing toolings (MCP Servers) are capable of complex reasoning on graphs at the moment.
This MCP Server includes toolings from Neo4j Graph Data Science (GDS) library, which allows you to run all common graph algorithms.
Once the server is running, you are able to ask any graph questions about your Neo4j graph and get answers. LLMs equipped with GDS agent can decide and accurately execute the appropriate parameterised graph algorithms over the graph you have in your Neo4j database.
An example where an LLM with GDS Agent is able to pick shortest path and Yen's algorithm to answer my question about travel plan:
If you have uvx
installed, add the following config to your claude_desktop_config.json
{
"mcpServers": {
"neo4j-gds": {
"command": "/opt/homebrew/bin/uvx",
"args": [ "gds-agent" ],
"env": {
"NEO4J_URI": "bolt://localhost:7687",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": ""
}
}
}
}
Replace command with your uvx
location. Find out by running which uvx
in the command line.
Replace NEOJ_URI
, NEO4J_USERNAME
, NEO4J_PASSWORD
with your database login details. You can also optionally specify NEO4J_DATABASE
.
To load the London underground example dataset:
pip install -r requirements.txt
NEO4J_URI=bolt://localhost:7687 # or your database URI
NEO4J_USERNAME=neo4j # or your db username
NEO4J_PASSWORD=your_password
python import_data.py
Connect to your DB and querying the graph from Neo4j workspace,
you should see:
/mcp_server
directory, run uv sync --dev
and run uv run gds-agent
to start the MCP server standalone, or run claude
to start claude-cli with the agent.Open a pull request from a branch of your forked repository into the main branch of this repo, for example mygithubid:add-new-algo -> neo4j-contrib:main
.
The CI build in github action requires all codestyle checks and tests to pass.
To run and fix codestyle checks locally, in the /mcp_server
directory, run:
uv sync --dev
to setup the python environment. And then,
uv run pytest tests -v -s
uv run ruff check
uv run ruff format
for all tests and codestyle fixes.
To report a bug or a new feature request, raise an issue.
If it is a bug, include the full stacktrace and errors.
When available, attach relevant logs in mcp_server_neo4j_gds.log
. This file is located inside the /mcp_server/src_mcp_server_neo4j_gds
directory if the gds agent is running from source, or inside the logging path for Claude (e.g /Library/Logs/Claude
for Claude Desktop on Mac). Include relevant minimal dataset that can be used to reproduce the issue if possible.
The GDS agent can be used with other MCP servers, such as those that provide additional Neo4j toolings: https://github.com/neo4j-contrib/mcp-neo4j