Neo4j MCP Server

Neo4j MCP Server

By dandelionmayday123 GitHub

Neo4j MCP Server - A microservice for Neo4j database operations

Overview

What is Neo4j MCP Server?

Neo4j MCP Server is a microservice designed for performing operations on a Neo4j database, enabling efficient database management and interaction.

How to use Neo4j MCP Server?

To use the Neo4j MCP Server, install it via pip, configure the necessary environment variables, and start the server. You can then interact with the server using an MCP client to execute queries and manage data.

Key features of Neo4j MCP Server?

  • Supports asynchronous operations for improved performance.
  • Provides basic operation interfaces for Neo4j database management.
  • Allows configuration of proxy servers for network requests.
  • Includes comprehensive logging for tracking operations.

Use cases of Neo4j MCP Server?

  1. Executing complex Cypher queries on Neo4j databases.
  2. Creating and managing nodes and relationships in a graph database.
  3. Integrating with other services that require database operations.

FAQ from Neo4j MCP Server?

  • What programming language is Neo4j MCP Server written in?

Neo4j MCP Server is written in Python.

  • How do I install Neo4j MCP Server?

You can install it using the command: pip install -e .

  • Is there a license for Neo4j MCP Server?

Yes, it is licensed under the MIT License.

Content

Neo4j MCP Server

这是一个基于MCP框架的Neo4j数据库操作服务。

功能特性

  • 支持异步操作
  • 提供Neo4j数据库的基本操作接口
  • 支持代理服务器配置
  • 完整的日志记录

安装

pip install -e .

配置

创建.env文件并设置以下环境变量:

NEO4J_URI=http://your-neo4j-server:7474
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your-password
HTTP_PROXY=http://your-proxy:port  # 可选
HTTPS_PROXY=http://your-proxy:port  # 可选

使用方法

  1. 启动服务器:
python src/server.py
  1. 使用MCP客户端调用服务:
from mcp.client import Client

async with Client() as client:
    # 执行Cypher查询
    result = await client.execute_query("MATCH (n) RETURN n LIMIT 5")
    
    # 创建节点
    node = await client.create_node("Person", {"name": "张三", "age": 30})
    
    # 创建关系
    rel = await client.create_relationship(1, 2, "KNOWS", {"since": "2024"})

开发

  1. 创建虚拟环境:
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
.venv\Scripts\activate  # Windows
  1. 安装开发依赖:
pip install -e ".[dev]"
  1. 运行测试:
python -m pytest

许可证

MIT

No tools information available.
No content found.