NG

neo4j-graphacademy/genai-mcp-neo4j-tools

分析与监控

本页由 AI 翻译,技术细节请以原文为准。 查看原文

10 stars 7 forks 质量 61 趋势 16MIT

https://graphacademy.neo4j.com/courses/genai-mcp-neo4j-tools

概览

[quote] Learn how to use the Model Context Protocol to create intelligent AI applications link:https://graphacademy.neo4j.com/courses/genai-mcp-neo4j-tools/[Enroll for free at Neo4j GraphAcademy^]. // tag::setup[] The server is written in Python, so you will use the uvx command to install the server from PyPI and run the server locally, and configure VS Code to communicate with the server using the Standard Input/Output (stdio) transport method. To install the Neo4j Cypher MCP server in VS Code, open the .vscode/mcp.json file and add the server configuration: .mcp.json [source,json] ---- { "servers": { "neo4j-cypher": { "command": "uvx", "args": [ "mcp-neo4j-cypher" ] } } } ---- The Neo4j Cypher MCP server will require environment variables to allow it to connect to an instance. * NEO4J_URI - The connection URI for your Neo4j database (e.g., neo4j+s://dbid.databases.neo4j.

README

以下为原文 README 节选,完整内容请查看原文。

Developing with Neo4j MCP Tools

[quote] Learn how to use the Model Context Protocol to create intelligent AI applications

link:https://graphacademy.neo4j.com/courses/genai-mcp-neo4j-tools/[Enroll for free at Neo4j GraphAcademy^].

== Set up the Neo4j Cypher MCP Server

// tag::setup[] The server is written in Python, so you will use the uvx command to install the server from PyPI and run the server locally, and configure VS Code to communicate with the server using the Standard Input/Output (stdio) transport method.

== Step 1: Install the server

To install the Neo4j Cypher MCP server in VS Code, open the .vscode/mcp.json file and add the server configuration:

.mcp.json [source,json]

{ “servers”: { “neo4j-cypher”: { “command”: “uvx”, “args”: [ “mcp-neo4j-cypher” ] } } }

== Step 2: Set environment variables

The Neo4j Cypher MCP server will require environment variables to allow it to connect to an instance.

  • NEO4J_URI - The connection URI for your Neo4j database (e.g., neo4j+s://dbid.databases.neo4j.io)
  • NEO4J_USERNAME - Your Neo4j username (typically neo4j)
  • NEO4J_PASSWORD - Your Neo4j password

You can set these variables by adding a new env section to the neo4j-cypher entry in the mcp.json file.

.mcp.json [source, json, subs=“attributes+”]

{ “servers”: { “neo4j-cypher”: { “command”: “uvx”, “args”: [ “mcp-neo4j-cypher” ], “env”: { ifdef::instance-ip[] “NEO4J_URI”: “{instance-scheme}://{instance-ip}:7687”, “NEO4J_USERNAME”: “{instance-username}”, “NEO4J_PASSWORD”: “{instance-password}”, ifdef::instance-database[] “NEO4J_DATABASE”: “{instance-database}” endif::[] ifndef::instance-database[] “NEO4J_DATABASE”: “neo4j” endif::[] endif::[] ifndef::instance-ip[] “NEO4J_URI”: “neo4j+s://dbid.databases.neo4j.io:7687”, “NEO4J_USERNAME”: “neo4j”, “NEO4J_PASSWORD”: “”, “NEO4J_DATABASE”: “neo4j” endif::[] } } } }

[TIP]

You can also use the VS Code MCP: Add Server command to setup the .vscode/mcp.json file, and then add the env section manually.

ifndef::instance-ip[] [TIP] You can obtain a Neo4j Aura instance by enrolling to the link:https://graphacademy.neo4j.com/courses/genai-mcp-neo4j-tools/[Developing with Neo4j MCP Tools course on Neo4j GraphAcademy^]. endif::[]

// end::setup[]

// tag::managing[]

== Managing the Server

Once configured, you can manage the MCP server using VS Code’s built-in commands:

  • Run MCP: List Servers from the Command Palette to view all configured servers
  • Start, Stop, or Restart servers as needed
  • Show Output to view server logs for troubleshooting
  • Browse Resources to see what the server provides

== Using the tools

Now, when you ask GitHub Copilot Chat to interact with your Neo4j database, the following sequence will occur:

在 GitHub 查看完整 README

安装

uvx mcp-neo4j-cypher
新手?先看 mcpskill.org 教程 →