Prerequisites

  • Docker installed (for running the MCP server image)
  • Meshagent CLI installed and authenticated (Get Started)
  • Neo4j database running (local or remote instance)
  • Meshagent account

Required Environment Variables

Set these environment variables with your Neo4j database credentials and connection string:

  • NEO4J_URL – e.g. bolt://host.docker.internal:7687
  • NEO4J_USERNAME – e.g. neo4j
  • NEO4J_PASSWORD – e.g. password

Steps

  1. Install Meshagent with all plugins:

    pip install "meshagent[all]"
    
  2. Sign up and authenticate with Meshagent:

  3. Launch the MCP server as a Meshagent service in a room:

    meshagent service test \
      --room=test \
      --role=agent \
      --image=meshagent/mcp-neo4j-memory:latest \
      --env MESHAGENT_PORT=8001 \
      --env NEO4J_URL=<bolt://your-neo4j-host:7687> \
      --env NEO4J_USERNAME=<your-neo4j-username> \
      --env NEO4J_PASSWORD=<your-neo4j-password> \
      --port="num=8001 path=/webhook liveness=/ type=meshagent.callable" \
      --name=mcp-neo4j-memory-service
    
    • This launches the Neo4j Memory MCP server within the Meshagent room.
    • Note: Replace the angle-bracket values (<...>) with your actual Neo4j instance details.
    • Rooms will close if they go inactive.
  4. Start a chatbot in the Meshagent room with the Neo4j-memory toolkit:

    meshagent chatbot join \
      --room=test \
      --agent-name=sample \
      --name=sample \
      --toolkit=mcp-neo4j-memory
    
    • This starts a chatbot with access to all mcp-neo4j-memory tools.
    • You can load multiple toolkits for an agent in the same room.
    • After running, a link to the room will be provided in the output for browser-based interaction.

Tools Available

Below is an overview of the tools this MCP server provides for graph-based memory with Neo4j:

Tool NameShort Description
add_observationsAdd new observations to existing entities in the knowledge graph
create_entitiesCreate multiple new entities in the knowledge graph
create_relationsCreate multiple new relations between entities
delete_entitiesDelete multiple entities and their associated relations
delete_observationsDelete specific observations from entities
delete_relationsDelete multiple relations from the knowledge graph
find_nodesFind specific nodes by name
open_nodesOpen specific nodes by name
read_graphRead the entire knowledge graph
search_nodesSearch nodes based on a query

Tools Details

add_observations

Add new observations to existing entities in the knowledge graph

ParameterTypeDescription
observationsarray

create_entities

Create multiple new entities in the knowledge graph

ParameterTypeDescription
entitiesarray

create_relations

Create multiple new relations between entities in the knowledge graph. Relations should be in active voice.

ParameterTypeDescription
relationsarray

delete_entities

Delete multiple entities and their associated relations from the knowledge graph

ParameterTypeDescription
entityNamesarrayAn array of entity names to delete

delete_observations

Delete specific observations from entities in the knowledge graph

ParameterTypeDescription
deletionsarray

delete_relations

Delete multiple relations from the knowledge graph

ParameterTypeDescription
relationsarrayAn array of relations to delete

find_nodes

Find specific nodes in the knowledge graph by their names

ParameterTypeDescription
namesarrayAn array of entity names to find

open_nodes

Open specific nodes in the knowledge graph by their names

ParameterTypeDescription
namesarrayAn array of entity names to open

read_graph

Read the entire knowledge graph


search_nodes

Search for nodes in the knowledge graph based on a query

ParameterTypeDescription
querystringThe search query to match against entity names, types, and observation content

Meshagent & Neo4j Memory MCP Resources