A Model Control Protocol (MCP) server for Memgraph databases that allows Claude to interact with your Memgraph graph databases.
The easiest way to use this server with Claude Code:
# Generate MCP config and add it to Claude
JSON=$(memgraph-mcp-server --json --connection-uri 'bolt://localhost:7687') \
&& claude mcp add-json "$JSON"# Add the tap
brew tap mgorunuch/memgraph-mcp-server https://github.com/mgorunuch/memgraph-mcp-server
# Install the server
brew install mgorunuch/memgraph-mcp-server/memgraph-mcp-server# Clone the repository
git clone https://github.com/mgorunuch/memgraph-mcp-server.git
# Build the server
cd memgraph-mcp-server
go buildThere are two ways to use this server:
- Set your Memgraph connection parameters as environment variables (optional):
export MEMGRAPH_URI="bolt://localhost:7687"
export MEMGRAPH_USER="username"
export MEMGRAPH_PASSWORD="password"If not provided, defaults to bolt://localhost:7687 with no authentication.
- Launch the server:
memgraph-mcp-server- Use with Claude by setting up the MCP connection to this server.
- Generate the MCP configuration JSON:
memgraph-mcp-server --json --connection-uri "bolt://localhost:7687" --username "username" --password "password"This will output a JSON configuration you can use with Claude's MCP tools.
Example output:
{"type":"stdio","command":"/path/to/memgraph-mcp-server","args":["--connection-uri","bolt://localhost:7687","--username","username","--password","password"],"env":{}}- Copy this JSON output and use it to configure the MCP connection in Claude.
--version: Displays version information--json: Outputs MCP configuration JSON for use with Claude--connection-uri: Memgraph connection URI (e.g., bolt://localhost:7687)--username: Memgraph username--password: Memgraph password
For safety, potentially destructive queries (DELETE, REMOVE, DROP, CREATE, MERGE, SET) are blocked by default.
To execute these queries, you must explicitly set unsafe: true when using the run_query tool.
Executes a Cypher query against Memgraph.
Parameters:
query(required): The Cypher query to executeunsafe(optional): Set to true to allow potentially unsafe queries
Example:
run_query(query="MATCH (n) RETURN n LIMIT 10")
Retrieves schema information from the Memgraph database.
Example:
get_schema()
- Go 1.21 or higher
- Memgraph database (compatible with Bolt protocol)
