# Letta

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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
