Connecting Letta to a SSE MCP Server
Many remote MCP servers use unauthenticated URLs (meaning that anyone with the URL is able to use the tools on the MCP server), so make sure you keep your MCP server URLs private.
Connecting to a remote MCP server is as simple as adding the URL to your ~/.letta/mcp_config.json
file.
For example, if you have the URL of an MCP server that looks like https://mcp-server-123456.externaldomain.com
, simply add it to your ~/.letta/mcp_config.json
file like so:
To add more servers, simply add more entries to the config:
Example: connecting to the Everything MCP server
The “Everything MCP server” (repo link) is an example server made by Anthropic intended to showcase the full featureset of the MCP protocol.
The source code for the server includes the option to run it in SSE mode, so we can use it as an example for how to connect Letta to a locally running SSE server.
Step 1: Install the Everything MCP server
Step 2: Launch the MCP server in SSE mode
In the same directory, run npm run
(make sure to specify SSE mode with :sse
):
Once started, you’ll see this output in your terminal:
Step 3: Modify your ~/.letta/mcp_config.json
file
~/.letta/mcp_config.json
fileBy default, the Everything MCP server will run on port 3001
. It will listen for SSE connections on :3001/SSE
, so that’s the address we’ll use.
If we’re using Docker, we’ll need to modify the address to be host.docker.internal
instead of localhost
:
Step 4: Launch the MCP server in SSE mode
In this example, we’ll use Docker to show you how to read your ~/.letta/mcp_config.json
file.
To mount your ~/.letta/mcp_config.json
file into Docker, when we run docker run
we need to add -v ~/.letta/mcp_config.json:/root/.letta/mcp_config.json
:
Attaching an MCP tool to an agent
Once your Letta server has ingested your ~/.letta/mcp_config.json
file and registered the tools, you still need to attach your tools to your agent (if your mcp_config.json
was set up correctly, then the tools will now be available to attach).
This can be done via the ADE (by opening the tool browser), or programatically via the API / SDKs. For a complete example of using the Python SDK to , check our GitHub.