Run a Cypher query against Memgraph database
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.
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.
Before setting up the Memgraph MCP Server, ensure you have:
uv
package manager installedClone the repository:
git clone https://github.com/memgraph/mcp-memgraph.git
cd mcp-memgraph
Create and activate a virtual environment:
uv venv
# On Windows
.venv\Scripts\activate
# On macOS/Linux
source .venv/bin/activate
Install dependencies:
uv add "mcp[cli]" httpx
Run the Memgraph MCP server:
uv run server.py
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.
On macOS/Linux:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows:
code $env:AppData\Claude\claude_desktop_config.json
{
"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.
Once everything is set up:
Example prompts:
--schema-info-enabled=True
to enable schema retrieval