MCP Neo4j Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Provides integration between Neo4j graph database and Claude Desktop, enabling graph database operations through natural language interactions. It allows executing Cypher queries, creating nodes and relationships, and performing complex graph operations via natural language commands.

MCP Neo4j サーバー

Neo4j グラフ データベースと Claude Desktop の統合を提供し、自然言語による対話を通じてグラフ データベースの操作を可能にする MCP サーバーです。

クイックスタート

npx を使用してこの MCP サーバーを直接実行できます。

npx @alanse/mcp-neo4j

または、Claude Desktop 構成に追加します。

{ "mcpServers": { "neo4j": { "command": "npx", "args": ["@alanse/mcp-neo4j-server"], "env": { "NEO4J_URI": "bolt://localhost:7687", "NEO4J_USERNAME": "neo4j", "NEO4J_PASSWORD": "your-password" } } } }

特徴

このサーバーは、Neo4j データベースと対話するためのツールを提供します。

ツール

  • execute_query : Neo4j データベースで Cypher クエリを実行する
    • すべてのタイプの Cypher クエリ (READ、CREATE、UPDATE、DELETE) をサポートします
    • クエリ結果を構造化された形式で返します
    • インジェクション攻撃を防ぐためにパラメータを渡すことができる
  • create_node : グラフデータベースに新しいノードを作成する
    • ノードラベルとプロパティを指定する
    • 作成されたノードをその内部IDとともに返します
    • プロパティのすべてのNeo4jデータ型をサポート
  • create_relationship : 既存の2つのノード間に関係を作成する
    • 関係の種類と方向を定義する
    • 関係にプロパティを追加する
    • ソースノードとターゲットノードのノードIDが必要です

インストール

Smithery経由でインストール

Smithery経由で Claude Desktop 用の MCP Neo4j Server を自動的にインストールするには:

npx -y @smithery/cli install @alanse/mcp-neo4j-server --client claude

開発のために

  1. リポジトリをクローンします。
git clone https://github.com/da-okazaki/mcp-neo4j-server.git cd mcp-neo4j-server
  1. 依存関係をインストールします:
npm install
  1. プロジェクトをビルドします。
npm run build

構成

サーバーには次の環境変数が必要です。

  • NEO4J_URI : Neo4j データベース URI (デフォルト: bolt://localhost:7687)
  • NEO4J_USERNAME : Neo4j ユーザー名 (デフォルト: neo4j)
  • NEO4J_PASSWORD : Neo4j パスワード (必須)

使用例

自然言語を使用して Neo4j データベースと対話する方法の例を次に示します。

データのクエリ

次のような質問をすることができます。

  • 「営業部の従業員全員を表示」
  • 「最も年長の顧客上位5人を見つける」
  • 「先月3つ以上の商品を購入した人は誰ですか?」

例:

User: "Show me all employees in the Sales department" Claude: Let me query the database for Sales department employees. [Executes query internally: MATCH (e:Employee)-[:WORKS_IN]->(d:Department {name: 'Sales'}) RETURN e.name, e.position] Result: - John Smith (Sales Manager) - Sarah Johnson (Sales Representative) - Mike Brown (Account Executive)

データの作成

次のような指示を与えることができます:

  • 「30歳のJohn Doeという新しい人物を追加します」
  • 「価格24.99ドルの『プレミアムコーヒー』という商品を作成する」
  • 「『研究開発』という新しい部門を追加する」

例:

User: "Add a new person named John Doe who is 30 years old" Claude: I'll create a new Person node with the provided information. [Creates node internally with label 'Person' and properties {name: 'John Doe', age: 30}] Result: Created new person node with ID: 123

関係を築く

次のような関係をリクエストできます:

  • 「ジョン・ドウをジェーン・スミスと友達にする」
  • 「製品Aを製品Bのコンポーネントとして設定する」
  • 「John Doeを営業部に割り当てる」

例:

User: "Make John Doe friends with Jane Smith" Claude: I'll create a friendship relationship between these two people. [Creates relationship internally: MATCH (a:Person {name: 'John Doe'}), (b:Person {name: 'Jane Smith'}) CREATE (a)-[:FRIENDS_WITH {since: '2024-01-05'}]->(b)] Result: Created friendship relationship between John Doe and Jane Smith

複雑な操作

自然言語を使用すると、より複雑な操作を実行できます。

  • 「ニューヨーク在住の顧客が購入したすべての商品を検索する」
  • 「John Doeの友達の友達を表示」
  • 「各部門の従業員の平均年齢を計算する」

例:

User: "Find all products purchased by customers who live in New York" Claude: I'll query the database for this information. [Executes query internally: MATCH (c:Customer {city: 'New York'})-[:PURCHASED]->(p:Product) RETURN c.name, collect(p.name) as products] Result: - Alice Wilson: [Premium Coffee, Tea Set, Cookies] - Bob Miller: [Premium Coffee, Water Bottle]

テスト

テスト スイートを実行します。

npm test

ライセンス

マサチューセッツ工科大学

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

このサーバーは、Neo4j データベースと Claude Desktop 間の相互作用を可能にし、ユーザーが Cypher クエリを実行し、ノードを作成し、データベース内で関係を確立できるようにします。

  1. Quick Start
    1. Features
      1. Tools
    2. Installation
      1. Installing via Smithery
      2. For Development
    3. Configuration
      1. Usage Examples
        1. Querying Data
        2. Creating Data
        3. Creating Relationships
        4. Complex Operations
      2. Testing
        1. License
          ID: qjpsxn4zlh