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:

1{
2 "mcpServers": {
3 "myRemoteServerName": {
4 "url": "https://mcp-server-123456.externaldomain.com"
5 }
6 }
7}

To add more servers, simply add more entries to the config:

1{
2 "mcpServers": {
3 "myRemoteServerName": {
4 "url": "https://mcp-server-123456.externaldomain.com"
5 },
6 "myRemoteServerName2": {
7 "url": "https://mcp-server-78910.externaldomain.com"
8 }
9 }
10}

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.

If you don’t have npm installed, install it here.

Then follow these steps:

$# First clone the GitHub repo
>git clone https://github.com/modelcontextprotocol/servers.git
>
># Navigate to the directory
>cd servers/src/everything
>
># Install with npm
>npm install
>npm run build

In the same directory, run npm run (make sure to specify SSE mode with :sse):

$npm run start:sse

Once started, you’ll see this output in your terminal:

> @modelcontextprotocol/server-everything@0.6.2 start:sse
> node dist/sse.js
Server is running on port 3001

By 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.

1{
2 "mcpServers": {
3 "everything": {
4 "url": "http://localhost:3001/sse"
5 }
6 }
7}

If we’re using Docker, we’ll need to modify the address to be host.docker.internal instead of localhost:

1{
2 "mcpServers": {
3 "everything": {
4 "url": "http://host.docker.internal:3001/sse"
5 }
6 }
7}

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:

$docker run \
> -v ~/.letta/.persist/pgdata:/var/lib/postgresql/data \
> -v ~/.letta/mcp_config.json:/root/.letta/mcp_config.json \
> -p 8283:8283 \
> letta/letta:latest

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.