neo4j-gds

neo4j-gds

Enables LLMs to run complex graph algorithms on Neo4j databases, answering graph-related questions by selecting and executing appropriate parameterised graph algorithms.

Category
访问服务器

README

GDS Agent

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: gds-agent-example

Table of Contents

For Users

For Developers

Use GDS Agent

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.

By default the server uses STDIO transport for local MCP clients. For HTTP-native clients, run the server with streamable HTTP:

gds-agent --transport http --host 127.0.0.1 --port 8000 --path /mcp

The equivalent environment variables are GDS_AGENT_TRANSPORT, GDS_AGENT_HOST, GDS_AGENT_PORT, and GDS_AGENT_PATH. The Neo4j MCP-style NEO4J_TRANSPORT and NEO4J_MCP_SERVER_* names are also supported.

GDS Aura Graph Analytics (sessions)

The server detects whether the connected Neo4j has the GDS plugin installed or whether to use a GDS Aura Graph Analytics session. Detection runs gds.session.list() on startup; if it succeeds, session mode is used and graph projections fall back to gds.graph.project.remote.

Session mode requires Aura API credentials. Add them to the same .env file (or env block in your MCP config) used for the database credentials:

AURA_API_CLIENT_ID=...
AURA_API_CLIENT_SECRET=...
AURA_API_PROJECT_ID=...
# optional
SESSION_MEMORY_GB=8
SESSION_NAME=mcp_gds_session
SESSION_TTL_HOURS=24

The session is created lazily on the first algorithm/projection call. Three extra tools become available in session mode: list_sessions, delete_session, and recreate_session (the last is useful to bump memory after an OOM).

Example dataset

To load the London underground example dataset:

  1. Fork and clone the repository
  2. Install necessary packages in your python environment with pip install -r requirements.txt
  3. Install the Neo4j database with GDS plugin: Download the Neo4j Desktop from Neo4j Download Center Install the GDS plugin from the Neo4j Desktop Create a new database and start it
  4. Populate .env file with necessary credentials:
    NEO4J_URI=bolt://localhost:7687  # or your database URI
    NEO4J_USERNAME=neo4j  # or your db username
    NEO4J_PASSWORD=your_password
    
  5. Load the London Underground dataset with the following command:
    python import_data.py --undirected
    

Connect to your DB and querying the graph from Neo4j workspace, you should see: London Underground Graph

Start the server for dev

  1. When inside the /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.

How to contribute

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.

Feature request and bug reports

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.

Additional resources

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

Arxiv paper including details about the architecture and benchmark results: https://arxiv.org/abs/2508.20637.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选