Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integrations/mcp-memgraph/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN uv pip install --system -e /app/integrations/mcp-memgraph

WORKDIR /app/integrations/mcp-memgraph/src

ENV FASTMCP_HOST=0.0.0.0
ENV MCP_HOST=0.0.0.0
ENV MCP_TRANSPORT=streamable-http
ENV MEMGRAPH_URL=bolt://host.docker.internal:7687

Expand Down
24 changes: 12 additions & 12 deletions integrations/mcp-memgraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Or you can open the config file in your favorite text editor. The location of th
%APPDATA%/Claude/claude_desktop_config.json
```

> [!NOTE]
> [!NOTE]
> You may need to put the full path to the uv executable in the command field. You can get this by running `which uv` on MacOS/Linux or `where uv` on Windows. Make sure you pass in the absolute path to your server.

### Chat with the database
Expand All @@ -63,49 +63,49 @@ The Memgraph MCP Server exposes the following tools over MCP. Each tool runs a M

### run_query(query: str)

Run any arbitrary Cypher query against the connected Memgraph database.
Run any arbitrary Cypher query against the connected Memgraph database.
Parameters:

- `query`: A valid Cypher query string.

### get_configuration()

Fetch the current Memgraph configuration settings.
Fetch the current Memgraph configuration settings.
Equivalent to running `SHOW CONFIGURATION`.

### get_index()

Retrieve information about existing indexes.
Retrieve information about existing indexes.
Equivalent to running `SHOW INDEX INFO`.

### get_constraint()

Retrieve information about existing constraints.
Retrieve information about existing constraints.
Equivalent to running `SHOW CONSTRAINT INFO`.

### get_schema()

Fetch the graph schema (labels, relationships, property keys).
Fetch the graph schema (labels, relationships, property keys).
Equivalent to running `SHOW SCHEMA INFO`.

### get_storage()

Retrieve storage usage metrics for nodes, relationships, and properties.
Retrieve storage usage metrics for nodes, relationships, and properties.
Equivalent to running `SHOW STORAGE INFO`.

### get_triggers()

List all database triggers.
List all database triggers.
Equivalent to running `SHOW TRIGGERS`.

### get_betweenness_centrality()

Compute betweenness centrality on the entire graph.
Compute betweenness centrality on the entire graph.
Uses `BetweennessCentralityTool` under the hood.

### get_page_rank()

Compute PageRank scores for all nodes.
Compute PageRank scores for all nodes.
Uses `PageRankTool` under the hood.

### get_node_neighborhood(node_id: str, max_distance: int = 1, limit: int = 100)
Expand Down Expand Up @@ -188,9 +188,9 @@ The following environment variables can be used to configure the Memgraph MCP Se
- `MEMGRAPH_USER`: The username for authentication. Default: `memgraph`
- `MEMGRAPH_PASSWORD`: The password for authentication. Default: empty
- `MEMGRAPH_DATABASE`: The database name to connect to. Default: `memgraph`
- `MCP_TRANSPORT`: The transport protocol to use. Options: `http` (default), `stdio`
- `MCP_TRANSPORT`: The transport protocol to use. Options: `streamable-http` (default), `stdio`

You can set these environment variables in your shell, in your Docker run command, or in your deployment environment.
You can set these environment variables in your shell, in your Docker run command, or in your deployment environment.

### Connecting from VS Code (HTTP server)

Expand Down
2 changes: 1 addition & 1 deletion integrations/mcp-memgraph/src/mcp_memgraph/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


def main():
transport = os.environ.get("MCP_TRANSPORT", "stdio")
transport = os.environ.get("MCP_TRANSPORT", "streamable-http")
logger.info(f"Starting MCP server with transport: {transport}")
mcp.run(transport=transport)

Expand Down
3 changes: 2 additions & 1 deletion integrations/mcp-memgraph/src/mcp_memgraph/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
# Configure logging
logger = logger_init("mcp-memgraph")

MCP_HOST = os.environ.get("MCP_HOST")

# Initialize FastMCP server with stateless HTTP (for streamable-http transport)
mcp = FastMCP("mcp-memgraph", stateless_http=True)
mcp = FastMCP("mcp-memgraph", host=MCP_HOST, stateless_http=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also make the stateless_http part configurable, and I think the default should be False because it seems that elicitations don't work if stateless_http=True 🤔


MEMGRAPH_URL = os.environ.get("MEMGRAPH_URL", "bolt://localhost:7687")
MEMGRAPH_USER = os.environ.get("MEMGRAPH_USER", "")
Expand Down
Loading