MCP API Examples
Hello World: A Guide to the MemMachine MCP Server API
This guide provides a quick and simple way to get started with the MemMachine Model Content Protocol (MCP) Server API usingcurl commands. It can also be found in our Quick Start Guide.
Prerequisites
First, ensure your stand alone MCP server is up and running. You can use this sample command to start it:config.yml is your MemMachine configuration file. localhost and 8080 are the host and port
where the MCP server will listen for requests.
If you want to check that the server is running correctly, you can use following steps to query the tools
available on the server with curl.
1
Establish SSE connection and get session ID
We need a session id to work with the MCP server. We can obtain one by establishing a Server-Sent Events (SSE)
connection.Here is a sample response you might see:In this output, looking for the
mcp-session-id header, you can see the session ID is 8f82399b29ba42d495ff44d5a9cf7862.2
Initialize the session
Now that we have a session id, we can initialize the session by sending an Here is a sample response you might see:
initialize request to the MCP server.3
Send initialized notification
After initializing the session, we need to send an The request should succeed without any errors.
initialized notification to the MCP server.4
List available tools
Now we can list the available tools by sending a Here is a sample response you might see:
tools/list request to the MCP server.Working with Claude Desktop App
The Claude Desktop App allows the developer to easily interact with the MCP server. To configure the Claude Desktop App to connect to your MCP server, follow these steps:- Open the Claude Desktop App.
- Navigate to the settings section.
-
Navigate to the
Developertab. -
Click
Edit Configand it will pop up the location of the configuration file. -
The configuration file is named
claude_desktop_config.json. Edit the file to include the MCP stdio mode.
config.yml is your MemMachine configuration file. user is the user ID you want to use for the session.
- If you installed MemMachine as a python package, you can replace the command with:
- Save the configuration file and restart the Claude Desktop App.
-
If you navigate to the
Developertab again, you should seememmachineas an option in theMCP Serverdropdown.

- If you want to connect to a MCP running in HTTP mode. You can replace the configuration with this:
localhost and 8080 are the host and port where your MCP server is running.
user is the user ID you want to use for the session.
Note that you need node v20+ and npx installed to use the mcp-remote command. It basically acts as a proxy between
the Claude Desktop App and the MCP HTTP server.
-
If something went wrong, you will see an error message popup when you start Claude Desktop App.
You can also check the logs by clicking on
View Logsbutton in theDevelopertab. - Now we can go back to the main screen and start a new conversation. You can say something like “I like Disneyland” and Claude should be able to remember that in the next conversation. You may need to allow the model to call MCP for the first time.

- Restart the Claude Desktop App and start a new conversation. Ask about your favorite places and see if Claude can remember them.


