ローカルNeo4jコンテナ

Manages personal knowledge using a local Neo4j container, with data imported from JSON files.

ローカルNeo4jコンテナ

  1. JSONファイルを作成
    persons.json, domains.json, observations.json, relations.json を neo4j-container/import/ ディレクトリに配置します。

  2. Neo4jコンテナを起動

    cd neo4j-container
    docker compose up -d
    
  1. コンテナに入る

    docker exec -it neo4j-container-neo4j-1 /bin/bash
    
  2. Cypher Shellでファイルを実行

    cypher-shell -u neo4j -p mypassword
    
  3. 登録結果の確認

    cypher-shell -u neo4j -p mypassword "MATCH (n) RETURN n LIMIT 50;"
    

importフォルダのJSONデータ登録手順

  1. Neo4jコンテナに入る
# PowerShellの場合
# (コンテナ名は docker ps で確認)
docker exec -it neo4j-container-neo4j-1 /bin/bash
  1. Cypher ShellでJSONを登録(例: persons.json)
cat /import/persons.cypher | cypher-shell -u neo4j -p mypassword
cat /import/domains.cypher | cypher-shell -u neo4j -p mypassword
cat /import/relations.cypher | cypher-shell -u neo4j -p mypassword
cat /import/observations.cypher | cypher-shell -u neo4j -p mypassword

※<パスワード>はneo4jのパスワードに置き換えてください。

  1. 登録結果の確認**
cypher-shell -u neo4j -p mypassword "MATCH (n) RETURN n LIMIT 50;"

Claude Desktopでの実行方法

まず、Pythonのmcp-neo4j-memoryモジュールをインストールしておきます。

pip install mcp-neo4j-memory

claude_desktop_config.json

"mcpServers": {
  "neo4j": {
    "command": "uvx",
    "args": [
      "mcp-neo4j-memory@0.1.4",
      "--db-url",
      "neo4j+s://xxxx.databases.neo4j.io",
      "--username",
      "<your-username>",
      "--password",
      "<your-password>"
    ]
  }
}

Related Servers