Letta MCP Server logo

Letta MCP Server

Community
oculairmedia

MCP server to manage letta server and comunicate with agents

Publisheroculairmedia
RepositoryLetta-MCP-server
LanguageRust
Forks
20
Stars
79
Available tools
0
Transport typestdio, streamable-http
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Letta MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    79 stars and 20 forks from the linked repository.

Letta MCP Server

npm version Rust Tests Coverage Docker Build License: MIT

A high-performance Model Context Protocol (MCP) server for Letta AI, built with Rust and the TurboMCP framework.

Features

  • 7 Consolidated Tools covering 103 operations using the discriminator pattern
  • High Performance -- Rust, ~10-30MB memory, <500ms startup, parallel fan-out via tokio::join! and buffer_unordered
  • Dual Transport -- stdio (Claude Desktop, Cursor, etc.) and HTTP (production deployments)
  • Response Size Optimization -- 68-96% reduction in response sizes for LLM context efficiency
  • Type-Narrowed Schemas -- specific object/array types with per-parameter descriptions (no generic Value params)
  • Multi-Platform -- macOS, Linux, Windows (x64 and arm64)
  • Letta 0.16.x Compatible -- archives, conversations, MCP servers v2
  • MCP 2025-11-25 Compliant -- streamable HTTP transport with SSE
  • Compile-Time Routing -- zero runtime overhead for tool dispatch via TurboMCP v3 macros

Quick Start

npm (Recommended)

bash
npm install -g letta-mcp-server

The correct binary for your platform is installed automatically.

PlatformPackage
macOS Intelletta-mcp-darwin-x64
macOS Apple Siliconletta-mcp-darwin-arm64
Linux x64letta-mcp-linux-x64
Linux arm64letta-mcp-linux-arm64
Windows x64letta-mcp-windows-x64

Docker

bash
docker pull ghcr.io/oculairmedia/letta-mcp-server-rust:rust-latest

docker run -d \
  -p 6507:6507 \
  -e LETTA_BASE_URL=http://your-letta-instance:8283 \
  -e LETTA_PASSWORD=your-password \
  -e TRANSPORT=http \
  --name letta-mcp \
  ghcr.io/oculairmedia/letta-mcp-server-rust:rust-latest

Docker Compose

yaml
services:
  letta-mcp:
    image: ghcr.io/oculairmedia/letta-mcp-server-rust:rust-latest
    container_name: letta-mcp
    restart: unless-stopped
    ports:
      - '6507:6507'
    environment:
      LETTA_BASE_URL: ${LETTA_BASE_URL}
      LETTA_PASSWORD: ${LETTA_PASSWORD}
      TRANSPORT: http
      PORT: 6507
      RUST_LOG: info
    env_file:
      - .env
    healthcheck:
      test: ['CMD-SHELL', "timeout 1 bash -c '</dev/tcp/localhost/6507' || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3

Environment Variables

VariableRequiredDefaultDescription
LETTA_BASE_URLYes—Letta API URL (e.g. http://localhost:8283)
LETTA_PASSWORDYes—Letta API password
TRANSPORTNostdioTransport mode: stdio or http
PORTNo6507HTTP port (when TRANSPORT=http)
RUST_LOGNoinfoLog level: debug, info, warn, error
RUST_BACKTRACENo0Enable backtraces (0 or 1)
LETTA_MCP_MAX_VALUE_LENNo500Max characters for block/passages/search values
LETTA_MCP_CORE_MEMORY_PREVIEW_LENNo200Max characters for core memory previews

Available Tools

The server provides 7 consolidated tools with 103 operations:

ToolOperationsDescription
letta_agent_advanced28Agent lifecycle, messaging, conversations, context, export/import
letta_memory_unified24Core memory, blocks, archival passages, archives, search
letta_tool_manager13Tool CRUD, attach/detach, bulk operations
letta_source_manager15Data sources, files, passages, attachments
letta_job_monitor4Job tracking, cancellation, active monitoring
letta_file_folder_ops8File sessions, folder management
letta_mcp_ops11MCP server lifecycle, tool discovery, v2 API support

Tool Operations

letta_agent_advanced (28 operations)

list, create, get, update, delete, search, list_tools, send_message,
export, import, clone, get_config, bulk_delete, context, reset_messages,
summarize, stream, async_message, cancel_message, preview_payload,
search_messages, get_message, count, list_conversations,
get_conversation, send_conversation_message, cancel_conversation,
compact_conversation

letta_memory_unified (24 operations)

get_core_memory, update_core_memory, get_block_by_label, list_blocks,
create_block, get_block, update_block, attach_block, detach_block,
list_agents_using_block, search_archival, list_passages, create_passage,
update_passage, delete_passage, search_memory, list_archives,
get_archive, create_archive, update_archive, delete_archive,
attach_archive, detach_archive, list_agents_using_archive

letta_tool_manager (13 operations)

list, get, create, update, delete, upsert, attach, detach, bulk_attach,
generate_from_prompt, generate_schema, run_from_source, add_base_tools

letta_source_manager (15 operations)

list, get, create, update, delete, count, attach, detach, list_attached,
upload, delete_files, list_files, list_folders, get_folder_contents,
list_agents_using

letta_job_monitor (4 operations)

list, get, cancel, list_active

letta_file_folder_ops (8 operations)

list_files, open_file, close_file, close_all_files, list_folders,
attach_folder, detach_folder, list_agents_in_folder

letta_mcp_ops (11 operations)

add, update, delete, test, connect, resync, list_servers, list_tools,
register_tool, execute, attach_mcp_server

Response Size Optimizations

The Rust implementation includes significant response size optimizations for LLM context efficiency:

OperationOptimizationSize Reduction
Agent ListDefault pagination (15 items), summary mode68-85%
Tool ListDefault pagination (25 items), truncated descriptions70-90%
Memory BlocksExcludes heavy fields in list mode60-80%
Source ListSummary mode, pagination75-95%

Pagination

All list operations support pagination:

json
{
  "operation": "list",
  "pagination": {
    "limit": 25,
    "offset": 0
  }
}

Summary vs Full Mode

List operations return summary data by default. Use get operation with specific ID for full details:

json
// Summary (default for list)
{
  "id": "agent-123",
  "name": "My Agent",
  "model": "gpt-4",
  "tool_count": 5
}

// Full (with get operation)
{
  "id": "agent-123",
  "name": "My Agent",
  "model": "gpt-4",
  "system_prompt": "...",
  "tools": [...],
  "memory_blocks": [...]
}

MCP Client Configuration

Claude Desktop

json
{
  "mcpServers": {
    "letta": {
      "command": "letta-mcp",
      "env": {
        "LETTA_BASE_URL": "http://localhost:8283",
        "LETTA_PASSWORD": "your-password"
      }
    }
  }
}

Cursor / Windsurf

json
{
  "mcpServers": {
    "letta": {
      "command": "letta-mcp",
      "env": {
        "LETTA_BASE_URL": "http://localhost:8283",
        "LETTA_PASSWORD": "your-password"
      }
    }
  }
}

OpenCode (HTTP)

json
{
  "mcp": {
    "letta-mcp": {
      "type": "remote",
      "url": "http://localhost:6507/mcp",
      "enabled": true
    }
  }
}

Building from Source

Prerequisites

  • Rust nightly (edition 2024 support) - install via rustup
  • Docker (optional, for containerized builds)

Local Build

bash
git clone https://github.com/oculairmedia/Letta-MCP-server.git
cd Letta-MCP-server

cargo build --release

LETTA_BASE_URL=http://your-letta:8283 \
LETTA_PASSWORD=your-password \
./target/release/letta-server

For local development, the Rust binary also loads a repo-level .env automatically, so cargo run -p letta-server works without manually exporting variables first.

Docker Build

bash
docker build -f Dockerfile.rust -t letta-mcp .

docker run -d \
  -p 6507:6507 \
  -e LETTA_BASE_URL=http://your-letta:8283 \
  -e LETTA_PASSWORD=your-password \
  -e TRANSPORT=http \
  letta-mcp

Architecture

letta-server/
├── src/
│   ├── main.rs                        # Entry point, transport selection
│   ├── lib.rs                         # Server init, compile-time tool registration
│   └── tools/
│       ├── mod.rs                     # Tool module exports
│       ├── response_utils.rs          # Unified ToolResponse, pagination helpers
│       ├── validation_utils.rs        # require_field, require_id, sdk_err
│       ├── id_utils.rs               # ID parsing utilities
│       ├── agent_advanced/            # Agent operations (28 ops)
│       │   ├── crud.rs               #   list, create, get, update, delete, search
│       │   ├── messaging.rs           #   send_message, stream, async, preview
│       │   ├── conversations.rs       #   list, get, send, cancel, compact
│       │   └── management.rs          #   export, import, clone, config, bulk_delete
│       ├── memory_unified/            # Memory operations (24 ops)
│       │   ├── core.rs               #   get/update core memory
│       │   ├── blocks.rs             #   block CRUD, attach/detach
│       │   ├── passages.rs           #   archival passage CRUD
│       │   ├── archives.rs           #   archive CRUD, attach/detach
│       │   └── search.rs             #   search_archival, search_memory
│       ├── tool_manager.rs            # Tool operations (13 ops)
│       ├── source_manager.rs          # Source operations (15 ops)
│       ├── job_monitor.rs             # Job operations (4 ops)
│       ├── file_folder_ops.rs         # File/folder operations (8 ops)
│       └── mcp_ops.rs                # MCP server v2 operations (11 ops)
├── tests/                             # Integration tests
└── Cargo.toml

Key Dependencies

  • TurboMCP v3 -- MCP framework with compile-time routing and streamable HTTP
  • letta-rs -- Vendored Rust Letta API client (0.16.x)
  • Tokio -- Async runtime
  • Futures -- Stream combinators (buffer_unordered for parallel fan-out)
  • Serde -- Serialization/deserialization

Troubleshooting

Connection Refused

  1. Ensure the server is running: docker ps | grep letta-mcp
  2. Check logs: docker logs letta-mcp
  3. Verify port is accessible: curl http://localhost:6507/mcp

Authentication Errors

  1. Verify LETTA_BASE_URL points to your Letta instance
  2. Check LETTA_PASSWORD or LETTA_API_TOKEN is correct
  3. Ensure Letta server is accessible from the container

Tool Not Found

  1. List available tools via MCP: tools/list
  2. Verify you're using correct operation names (e.g., list not list_agents)

Logs

bash
# View server logs
docker logs -f letta-mcp

# Enable debug logging
RUST_LOG=debug letta-mcp

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Make changes and add tests
  4. Run tests: cargo test
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Related Projects

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "oculairmedia-letta-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "Letta-MCP-server"
      ]
    }
  }
}

Use Letta MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Letta MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: Use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Letta MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Letta MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "oculairmedia-letta-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "Letta-MCP-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Letta MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Letta MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Letta MCP Server to help me with this task?
Letta MCP Server
Sure. I read it.
Here is what I found using Letta MCP Server.

Option 2: Add an MCP server URL

Use this when Letta MCP Server is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter your server URL in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste your server URL into the Server URL field.
  2. Enter a connection name for Letta MCP Server.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the Letta MCP Server connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the Letta MCP Server tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the Letta MCP Server tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Letta MCP Server to help me with this task?
Letta MCP Server
Sure. I read it.
Here is what I found using Letta MCP Server.

Frequently asked questions

What is the Letta MCP Server MCP server used for?

Letta MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Letta MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Letta MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Letta MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Letta MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Letta MCP Server MCP to TypingMind?

Letta MCP Server can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does Letta MCP Server MCP provide in TypingMind?

Letta MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Letta MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Letta MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇