> For the complete documentation index, see [llms.txt](https://www.cakewalk.security/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.cakewalk.security/docs/ai-agent-access/connections-and-integrations/agent-platforms/letta.md).

# Letta

Add Cakewalk's MCP Gateway to Letta from the Agent Development Environment. Letta supports OAuth 2.1 over Streamable HTTP with templated per-agent variables.

Letta reads remote MCP servers from the Agent Development Environment (ADE). Add Cakewalk's gateway as a Streamable HTTP server with OAuth 2.1, and the tools become available to any agent that includes them.

## Install Method

Custom form in the ADE Tool Manager. Letta supports Streamable HTTP with Bearer, API key, or OAuth 2.1 authentication. Custom headers and templated variables let you scope credentials per agent.

## Step 1: Open Tool Manager

1. Open the Letta ADE.
2. Open the ADE's Tool Manager.

## Step 2: Add the Cakewalk Gateway

1. Add a new MCP server.
2. Choose Streamable HTTP as the transport.
3. Enter the server URL: `https://mcp-gateway.getcakewalk.io/mcp`.
4. Set authentication to OAuth 2.1.

## Step 3: Authenticate

Letta initiates the OAuth flow with Cakewalk's gateway. Sign in with your Cakewalk account and approve the Connection. Letta stores the credentials on the MCP server record.

## Step 4: Attach Tools to an Agent

After the server connects, Letta lists the tools the gateway exposes. Attach the tools you want this agent to access through the agent's tool list.

## Verifying It Works

In a Letta conversation with the agent, the tools surfaced through the Cakewalk gateway appear in the agent's available tools. In Cakewalk, the Letta card on **My Agents** flips to **Connected** after the first agent call.

## Per Agent Scoping with Templated Variables

Letta supports templated variables in auth headers for per-agent credentials. Example: `Authorization: Bearer {{USER_API_KEY | default_key}}`. For OAuth 2.1 flows, Cakewalk's gateway is the authorization server, so per-agent scoping happens in Cakewalk's policy layer, not in Letta's templates.

## Troubleshooting

* **Add MCP Server option is missing:** confirm you are in the ADE Tool Manager, not the SDK reference page. The ADE is at the workspace level.
* **OAuth flow does not initiate:** confirm the transport is set to Streamable HTTP. The stdio transport does not run OAuth flows.

## Learn more

* [MCP tools](https://docs.letta.com/guides/mcp/setup) from Letta.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.cakewalk.security/docs/ai-agent-access/connections-and-integrations/agent-platforms/letta.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
