Skip to content

Commit 6fd30ff

Browse files
authored
update mcp docs (#1326)
1 parent 11a668a commit 6fd30ff

File tree

2 files changed

+159
-12
lines changed

2 files changed

+159
-12
lines changed

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.

pages/ai-ecosystem/integrations.mdx

Lines changed: 158 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Callout } from 'nextra/components'
44
import GitHub from '/components/icons/GitHub'
55
import { SocialCards } from '/components/social-card/SocialCards'
66
import { SocialCard } from '/components/social-card/SocialCard'
7+
import { Steps } from 'nextra/components'
78

89
# Integrations
910

@@ -28,20 +29,19 @@ Memgraph's officially supported integrations:
2829
</Cards>
2930

3031
Memgraph offers Memgraph the [Memgraph MCP
31-
Server](https://github.com/memgraph/ai-toolkit/tree/main/integrations/mcp-memgraph) - a lightweight server
32-
implementation of the Model Context Protocol (MCP) designed to connect Memgraph
33-
with LLMs.
32+
Server](https://github.com/memgraph/ai-toolkit/tree/main/integrations/mcp-memgraph)
33+
- a lightweight server implementation of the Model Context Protocol (MCP)
34+
designed to connect Memgraph with LLMs.
3435

3536
![mcp-server](/pages/ai-ecosystem/integrations/mcp-server.png)
3637

3738

38-
<h2 className="custom-header">Run Memgraph MCP server</h2>
39+
### Run Memgraph MCP server
3940

4041
1. Install [`uv`](https://docs.astral.sh/uv/getting-started/installation/)
4142
2. Install [Claude for Desktop](https://claude.ai/download).
4243
3. Add the Memgraph server to Claude config:
4344

44-
4545
Open the config file in your favorite text editor. The location of the config
4646
file depends on your operating system:
4747

@@ -75,23 +75,170 @@ Add the following config:
7575
}
7676
```
7777

78-
<Callout type="info">
79-
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.
78+
<Callout type="info">
79+
You may need to put the full path to the uv executable in
80+
the command field. You can get this by running `which uv` on MacOS/Linux or
81+
`where uv` on Windows. Make sure you pass in the absolute path to your server.
8082
</Callout>
8183

82-
<h2 className="custom-header"> Chat with the database</h2>
84+
<h4 className="custom-header"> Chat with the database</h4>
85+
8386
1. Run Memgraph MAGE:
8487
```bash
8588
docker run -p 7687:7687 memgraph/memgraph-mage --schema-info-enabled=True
8689
```
8790

88-
The `--schema-info-enabled` configuration setting is set to `True` to allow LLM to run `SHOW SCHEMA INFO` query.
89-
2. Open Claude Desktop and see the Memgraph tools and resources listed. Try it out! (You can load dummy data from Memgraph Lab [Datasets](/memgraph-lab/getting-started/data-migration#datasets))
91+
The `--schema-info-enabled` configuration setting is set to `True` to allow
92+
LLM to run `SHOW SCHEMA INFO` query.
93+
2. Open Claude Desktop and see the Memgraph tools and resources listed. Try it
94+
out! (You can load dummy data from Memgraph Lab
95+
[Datasets](/memgraph-lab/getting-started/data-migration#datasets))
96+
97+
98+
### Run Memgraph MCP server with Docker
99+
100+
<Steps>
101+
102+
<h3 className="custom-header">Build the Docker image</h3>
103+
104+
To build the Docker image using your local `memgraph-toolbox` code, run from the
105+
root of the monorepo:
106+
107+
```
108+
cd /path/to/ai-toolkit
109+
docker build -f integrations/mcp-memgraph/Dockerfile -t mcp-memgraph:latest .
110+
```
111+
112+
This will install your local `memgraph-toolbox` into the image.
113+
114+
115+
<h3 className="custom-header">Run the Docker image</h3>
116+
117+
**1. Streamable HTTP mode (recommended)**
118+
119+
To expose the MCP HTTP server locally:
120+
121+
```
122+
docker run --rm mcp-memgraph:latest
123+
```
124+
125+
The server will be available at `http://localhost:8000/mcp/`
126+
127+
**2. Stdio mode (for integration with MCP stdio clients)**
128+
129+
Configure your MCP host to run the docker command and utilize stdio:
130+
131+
```
132+
docker run --rm -i -e MCP_TRANSPORT=stdio mcp-memgraph:latest
133+
```
134+
135+
<Callout type="info">
136+
By default, the server will connect to a Memgraph instance running on
137+
localhost docker network `bolt://host.docker.internal:7687`. If you have a
138+
Memgraph instance running on a different host or port, you can specify it
139+
using environment variables.
140+
</Callout>
141+
142+
**3. Custom Memgraph connection (external instance, no host network)**
143+
144+
To avoid using host networking, or to connect to an external Memgraph instance:
145+
146+
```
147+
docker run --rm \
148+
-p 8000:8000 \
149+
-e MEMGRAPH_URL=bolt://memgraph:7687 \
150+
-e MEMGRAPH_USER=myuser \
151+
-e MEMGRAPH_PASSWORD=password \
152+
mcp-memgraph:latest
153+
```
154+
155+
<h3 className="custom-header">Connect from developer tools</h3>
156+
157+
**Visual Studio Code (HTTP MCP extension)**
158+
159+
If you are using VS Code MCP extension or similar, your configuration for an
160+
HTTP server would look like:
161+
162+
```json
163+
{
164+
"servers": {
165+
"mcp-memgraph-http": {
166+
"url": "http://localhost:8000/mcp/"
167+
}
168+
}
169+
}
170+
```
171+
172+
<Callout type="info">
173+
The URL must end in /mcp/
174+
</Callout>
175+
176+
**Visual Studio Code (stdio using Docker)**
177+
178+
You can also run the server using stdio for integration with MCP stdio clients:
179+
180+
1. Open Visual Studio Code, open Command Palette (Ctrl+Shift+P or Cmd+Shift+P on
181+
Mac), and select `MCP: Add server...`.
182+
2. Choose `Command (stdio)`
183+
3. Enter `docker` as the command to run.
184+
4. For Server ID enter `mcp-memgraph`.
185+
5. Choose "User" (adds to user-space `settings.json`) or "Workspace" (adds to
186+
`.vscode/mcp.json`).
187+
188+
When the settings open, enhance the args as follows:
189+
190+
```json
191+
{
192+
"servers": {
193+
"mcp-memgraph": {
194+
"type": "stdio",
195+
"command": "docker",
196+
"args": [
197+
"run",
198+
"--rm",
199+
"-i",
200+
"-e", "MCP_TRANSPORT=stdio",
201+
"mcp-memgraph:latest"
202+
]
203+
}
204+
}
205+
}
206+
```
207+
208+
To connect to a remote Memgraph instance with authentication, add environment
209+
variables to the `args` list:
210+
211+
```json
212+
{
213+
"servers": {
214+
"mcp-memgraph": {
215+
"type": "stdio",
216+
"command": "docker",
217+
"args": [
218+
"run",
219+
"--rm",
220+
"-i",
221+
"-e", "MCP_TRANSPORT=stdio",
222+
"-e", "MEMGRAPH_URL=bolt://memgraph:7687",
223+
"-e", "MEMGRAPH_USER=myuser",
224+
"-e", "MEMGRAPH_PASSWORD=mypassword",
225+
"mcp-memgraph:latest"
226+
]
227+
}
228+
}
229+
}
230+
```
231+
232+
Then open GitHub Copilot in Agent mode, and interact with Memgraph using natural
233+
language.
90234

235+
</Steps>
91236

92237
<h3 className="custom-header">Resources</h3>
93238

94-
- [Introducing the Memgraph MCP Server](https://memgraph.com/blog/introducing-memgraph-mcp-server): A blog post on how to run Memgraph MCP Server and what are the future plans.
239+
- [Introducing the Memgraph MCP
240+
Server](https://memgraph.com/blog/introducing-memgraph-mcp-server): A blog
241+
post on how to run Memgraph MCP Server and what are the future plans.
95242

96243
## LlamaIndex
97244

0 commit comments

Comments
 (0)