Back to MCP Catalog

Memgraph MCP Server

DatabasesPython
Connect to and query Memgraph graph database from LLMs
Available Tools

run_query

Run a Cypher query against Memgraph database

get_schema

Get Memgraph schema information (requires --schema-info-enabled=True)

Memgraph MCP Server provides a lightweight implementation of the Model Context Protocol (MCP) designed to connect Memgraph graph database with Large Language Models. It enables AI assistants to directly interact with graph data stored in Memgraph, allowing them to run Cypher queries and retrieve schema information. With this integration, LLMs can analyze graph relationships, perform complex queries, and work with connected data structures without requiring manual data extraction. The server bridges the gap between graph database capabilities and natural language interfaces, making it easier to build graph-powered AI applications.

Overview

Memgraph MCP Server enables AI assistants to interact directly with Memgraph, a high-performance graph database. This integration allows LLMs to run Cypher queries against your graph data and retrieve schema information, making it possible to build sophisticated graph-powered AI applications.

Prerequisites

Before setting up the Memgraph MCP Server, ensure you have:

  1. A running Memgraph instance (preferably with MAGE extensions)
  2. Python installed on your system
  3. The uv package manager installed
  4. An MCP-compatible client like Claude for Desktop

Installation

Setting up the Server

  1. Clone the repository:

    git clone https://github.com/memgraph/mcp-memgraph.git
    cd mcp-memgraph
    
  2. Create and activate a virtual environment:

    uv venv
    # On Windows
    .venv\Scripts\activate
    # On macOS/Linux
    source .venv/bin/activate
    
  3. Install dependencies:

    uv add "mcp[cli]" httpx
    
  4. Run the Memgraph MCP server:

    uv run server.py
    

Running Memgraph

To get the most out of this integration, run Memgraph with schema information enabled:

docker run -p 7687:7687 memgraph/memgraph-mage --schema-info-enabled=True

The --schema-info-enabled=True configuration is essential as it allows the LLM to run the SHOW SCHEMA INFO query to understand your graph structure.

Configuring Claude for Desktop

  1. Install Claude for Desktop
  2. Add the Memgraph server to Claude's configuration:

On macOS/Linux:

code ~/Library/Application\ Support/Claude/claude_desktop_config.json

On Windows:

code $env:AppData\Claude\claude_desktop_config.json
  1. Add the Memgraph MCP server configuration to the JSON file:
{
  "mcpServers": {
    "mcp-memgraph": {
      "command": "/path/to/uv",
      "args": [
        "--directory",
        "/path/to/mcp-memgraph",
        "run",
        "server.py"
      ]
    }
  }
}

Replace /path/to/uv with the full path to your uv executable (find it using which uv on macOS/Linux or where uv on Windows) and /path/to/mcp-memgraph with the absolute path to your cloned repository.

Usage

Once everything is set up:

  1. Start your Memgraph instance with schema information enabled
  2. Run the MCP server
  3. Open Claude Desktop
  4. You should see Memgraph tools listed in Claude's capabilities
  5. You can now ask Claude to interact with your graph database

Example prompts:

  • "Show me the schema of my graph database"
  • "Run a query to find all nodes with label 'Person'"
  • "Create a visualization of connections between users in my graph"

Troubleshooting

  • If Claude doesn't show the Memgraph tools, check that your MCP server is running and properly configured in Claude's settings
  • Ensure Memgraph is running with --schema-info-enabled=True to enable schema retrieval
  • Verify connection details in the server configuration match your Memgraph instance
  • Check server logs for any connection errors or authentication issues

Related MCPs

Milvus Vector Database
DatabasesPython

Connect to Milvus vector database for semantic search and vector operations

MotherDuck DuckDB
DatabasesPython

SQL analytics with DuckDB and MotherDuck for AI assistants

Alibaba Cloud Tablestore
DatabasesJava, Python

Connect to Alibaba Cloud Tablestore for vector search and RAG applications

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.