Skip to content

Commit 639ae31

Browse files
authored
docs: Add Docker Compose setup as recommended MCP configuration method (MemMachine#711)
1 parent eeea1f2 commit 639ae31

File tree

1 file changed

+75
-6
lines changed

1 file changed

+75
-6
lines changed

docs/examples/mcp.mdx

Lines changed: 75 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,58 @@ To configure the Claude Desktop App to connect to your MCP server, follow these
190190

191191
5. The configuration file is named `claude_desktop_config.json`. Edit the file to include the MCP stdio mode.
192192

193-
Here is an example of working in the development environment with `uv`. In order to call the command,
194-
you need to have `uv` installed and issue `uv build` to build the project first.
193+
#### Option 1: Using Docker Compose (Recommended)
194+
195+
This is the recommended method for running MemMachine locally using Docker. It's the easiest way to get started.
196+
197+
**Step 1: Start MemMachine with Docker Compose**
198+
199+
First, start MemMachine using the provided script:
200+
201+
```
202+
./memmachine-compose.sh
203+
```
204+
205+
This will start all required services (PostgreSQL, Neo4j, and MemMachine) in Docker containers. The MemMachine container will be named `memmachine-app`.
206+
207+
**Step 2: Configure Claude Desktop**
208+
209+
Edit `claude_desktop_config.json` with the following configuration:
210+
211+
```
212+
{
213+
"mcpServers": {
214+
"memmachine": {
215+
"command": "docker",
216+
"args": [
217+
"exec",
218+
"-e",
219+
"MM_USER_ID=Your Name",
220+
"-i",
221+
"memmachine-app",
222+
"/app/.venv/bin/memmachine-mcp-stdio"
223+
],
224+
"env": {
225+
"MEMORY_CONFIG": "/app/configuration.yml",
226+
"PYTHONUNBUFFERED": "1"
227+
}
228+
}
229+
}
230+
}
231+
```
232+
233+
Replace `Your Name` with your desired user ID. The `memmachine-app` is the default container name created by the Docker Compose setup.
234+
235+
**Configuration Details:**
236+
- `memmachine-app`: The Docker container name (default from `memmachine-compose.sh`)
237+
- `MEMORY_CONFIG`: Path to the configuration file inside the container
238+
- `MM_USER_ID`: Your user identifier for memory sessions
239+
- `PYTHONUNBUFFERED`: Ensures immediate output from Python
240+
241+
#### Option 2: Using UV (Development Environment)
242+
243+
Here is an example of working in the development environment with `uv`. In order to call the command,
244+
you need to have `uv` installed and issue `uv build` to build the project first.
195245

196246
```
197247
{
@@ -234,7 +284,26 @@ memmachine-mcp-stdio
234284

235285
<img height="200" src="../images/claude-mcp-stdio.png" />
236286

237-
9. If you want to connect to a MCP running in HTTP mode. You can replace the configuration with this:
287+
9. Add a Global Prompt in Claude Desktop
288+
289+
This step helps Claude consistently call MemMachine MCP in every conversation.
290+
291+
Claude Desktop lets you set a personal preference prompt. If you want Claude to use MemMachine MCP on every question, add the following line:
292+
293+
```
294+
you MUST actively use MemMachine MCP on EVERY Question
295+
```
296+
297+
**How to add it:**
298+
299+
1. Open Claude Desktop
300+
2. Go to **Settings**
301+
3. Click **General**
302+
4. Find "What personal preferences should Claude consider in responses?"
303+
5. Paste the sentence into the text box
304+
6. Save your settings
305+
306+
10. If you want to connect to a MCP running in HTTP mode. You can replace the configuration with this:
238307

239308
```
240309
{
@@ -263,16 +332,16 @@ memmachine-mcp-stdio
263332
* `proj-id`: (Optional) Project ID, default to `mcp-<user-id>` if not specified.
264333
* `org-id`: (Optional) Organization ID, default to `mcp-universal`
265334

266-
10. If something went wrong, you will see an error message popup when you start Claude Desktop App.
335+
11. If something went wrong, you will see an error message popup when you start Claude Desktop App.
267336
You can also check the logs by clicking on `View Logs` button in the `Developer` tab.
268337

269-
11. Now we can go back to the main screen and start a new conversation. You can say something like "I like Disneyland"
338+
12. Now we can go back to the main screen and start a new conversation. You can say something like "I like Disneyland"
270339
and Claude should be able to remember that in the next conversation. You may need to allow the model to call MCP for
271340
the first time.
272341

273342
<img height="200" src="../images/claude-add-memory.png" />
274343

275-
12. Restart the Claude Desktop App and start a new conversation. Ask about your favorite places and see if Claude can
344+
13. Restart the Claude Desktop App and start a new conversation. Ask about your favorite places and see if Claude can
276345
remember them.
277346

278347
<img height="200" src="../images/claude-remember.png" />

0 commit comments

Comments
 (0)