Connecting Letta to Remote MCP Servers
Remote MCP servers work with both Letta Cloud and self-hosted deployments. Streamable HTTP is recommended for new integrations; SSE is deprecated but supported for legacy compatibility.
Streamable HTTP
Streamable HTTP is the recommended transport with support for MCP servers that use Bearer authorization, API keys, or OAuth 2.1. Letta also supports passing in custom headers for additional configuration.

ADE: Tool Manager → Add MCP Server → Streamable HTTP
Agent Id Header
When Letta makes tool calls to an MCP server, it includes the following in the HTTP request header:
x-agent-id
: The ID of the agent making the tool call
If you’re implementing your own MCP server, this can be used to make requests against your Letta Agent via our API/SDK.
Agent Scoped Variables
Letta recognizes templated variables in the custom header and auth token fields to allow for agent-scoped parameters defined in your tool variables:
- For example,
{{ AGENT_API_KEY }}
will use theAGENT_API_KEY
tool variable if available. - To provide a default value,
{{ AGENT_API_KEY | api_key }}
will fallback toapi_key
ifAGENT_API_KEY
is not set. - This is supported in the ADE as well when configuring API key/access tokens and custom headers.
SSE (Deprecated)
SSE is deprecated. Use Streamable HTTP for new integrations if available.
For legacy MCP servers that only support SSE.
ADE: Tool Manager → Add MCP Server → SSE
Agent Id Header
When Letta makes tool calls to an MCP server, it includes the following in the HTTP request header:
x-agent-id
: The ID of the agent making the tool call
If you’re implementing your own MCP server, this can be used to make requests against your Letta Agent via our API/SDK.
Agent Scoped Variables
Letta recognizes templated variables in the custom header and auth token fields to allow for agent-scoped parameters defined in your tool variables:
- For example,
{{ AGENT_API_KEY }}
will use theAGENT_API_KEY
tool variable if available. - To provide a default value,
{{ AGENT_API_KEY | api_key }}
will fallback toapi_key
ifAGENT_API_KEY
is not set. - This is supported in the ADE as well when configuring API key/access tokens and custom headers.
Using MCP Tools
ADE: Agent → Tools → Select MCP tools