The Letta MCP Server provides comprehensive tools for agent management, memory operations, and tool integration within the Letta system.
Agent Management: Create, list, prompt, modify, delete, clone, and bulk delete agents with specific configurations
Memory Management: Create, list, read, update, and attach memory blocks to agents
Tool Management: List, attach (individually or in bulk), and upload tools for agents
Additional Features: Manage models (LLM and embedding), archive passages, other MCP servers, and import/export agent configurations
Deployment: Run locally with Node.js or Docker, configurable via
mcp_settings.json
Uses .env files for configuration, allowing storage of Letta API credentials and endpoints securely outside of the codebase.
Repository hosting for the Letta MCP server, enabling version control, contribution workflows, and distribution of the server code.
Provides package management for the Letta MCP server, managing dependencies and offering scripts for building and running the server.
Used as the implementation language for the Letta MCP server, with build scripts to compile TypeScript code before execution.
Letta MCP Server
A Model Context Protocol (MCP) server that provides comprehensive tools for agent management, memory operations, and integration with the Letta system. This server implements the full MCP specification including tools, prompts, and resources, with enhanced descriptions, output schemas, and behavioral annotations.
Features
🤖 Agent Management - Create, modify, clone, and manage Letta agents
🧠 Memory Operations - Handle memory blocks and passages
🔧 Tool Integration - Attach and manage tools for agents with full MCP support
💬 Prompts - Interactive wizards and assistants for common workflows
📚 Resources - Access system information, documentation, and agent data
🌐 Multiple Transports - HTTP, SSE, and stdio support
🔗 MCP Server Integration - Integrate with other MCP servers
📊 Enhanced Metadata - Output schemas and behavioral annotations for all tools
📦 Docker Support - Easy deployment with Docker
Related MCP server: A2A Client MCP Server
Environment Configuration
Create a .env file with the following variables:
Installation
Install from npm
Use with Claude Desktop
After installing globally, add to your Claude Desktop configuration:
Quick Start with npm
Implementation Options
This repository provides three different implementations of the Letta MCP server, allowing you to choose the best option for your use case:
🔵 Classic Individual Tools (master branch)
Branch: master
The original implementation with individual tools for each API endpoint.
Best for:
Users who prefer individual, focused tools
Compatibility with existing integrations
Granular tool selection and control
Learning the Letta API one operation at a time
Docker Images:
Features:
70+ individual tools, each handling one specific operation
Direct mapping to Letta API endpoints
Simple, straightforward tool names
Full MCP protocol support (tools, prompts, resources)
Multiple transport protocols (HTTP, SSE, stdio)
🟢 Node.js Consolidated Tools (Recommended for most users)
Branch: nodejs-consolidated-tools
Modern implementation with 7 consolidated tools using the discriminator pattern.
Best for:
Production deployments
Claude Desktop integration
npm package consumers
Teams who want fewer tools with more functionality
Docker Images:
Features:
7 consolidated tools covering 87 operations
93% SDK coverage with official @letta-ai/letta-client
Discriminator pattern (use
operationparameter)Enhanced error handling and validation
Full MCP protocol support (tools, prompts, resources)
Comprehensive test suite and documentation
🦀 Rust Implementation (Performance-focused alternative)
Branch: rust-implementation
High-performance implementation built with Rust and the TurboMCP framework.
Best for:
Resource-constrained environments
Maximum performance requirements
Low memory footprint needs
Teams familiar with Rust
Docker Images:
Features:
Same 7 consolidated tools with full feature parity
Built on TurboMCP framework for MCP protocol
Compile-time type safety and validation
Lower memory usage and faster execution
Multi-architecture Docker builds (amd64, arm64)
Comparison
Feature | Classic (master) | Node.js Consolidated | Rust |
Tool Count | 70+ individual | 7 consolidated | 7 consolidated |
API Pattern | One tool per endpoint | Discriminator pattern | Discriminator pattern |
Maturity | ✅ Original | ✅ Production-ready | 🟡 Stable, newer |
Performance | Good | Good | Excellent |
Memory Usage | ~50-100MB | ~50-100MB | ~10-30MB |
Startup Time | ~1-2s | ~1-2s | ~100-500ms |
SDK Integration | Direct API calls | 93% official SDK | Custom API client |
Type Safety | Runtime validation | TypeScript (runtime) | Rust (compile-time) |
Package Manager | npm | npm | Docker/Cargo |
Use Case | Simple, focused | Production, feature-rich | Performance-critical |
Choosing an Implementation
Use Classic (master) if:
You prefer individual, single-purpose tools
You're already using the original implementation
You want simple, straightforward tool names
You're learning the Letta API
Use Node.js Consolidated if:
You need a battle-tested, production-ready solution
You want fewer tools with comprehensive functionality
You're using npm packages or Claude Desktop
You want SDK-powered reliability and type safety
Use Rust if:
You need maximum performance
You're running in resource-constrained environments (edge, embedded)
You prefer compile-time safety guarantees
You're comfortable with Docker-based deployment
All three implementations provide identical functionality and MCP protocol compliance. You can switch between them at any time without changing your Letta instance configuration.
Quick Setup
Option 1: Run from source
Option 2: Run with Docker
Using the prebuilt image from GitHub Container Registry
Available tags:
latest- Latest stable release2.0.1,2.0,2- Specific version tagsmaster- Latest master branch build
Using Docker Compose
Building from source
Option 3: Run with stdio for local MCP
Architecture
See the Architecture Documentation for detailed system diagrams and component relationships.
MCP Protocol Support
This server implements the full MCP specification with all three capabilities:
🔧 Tools
All tools include:
Enhanced Descriptions: Detailed explanations with use cases and best practices
Output Schemas: Structured response definitions for predictable outputs
Behavioral Annotations: Hints about tool behavior (readOnly, costLevel, executionTime, etc.)
💬 Prompts
Interactive prompts for common workflows:
letta_agent_wizard- Guided agent creation with memory and tool setupletta_memory_optimizer- Analyze and optimize agent memory usageletta_debug_assistant- Troubleshoot agent issuesletta_tool_config- Discover, attach, create, or audit toolsletta_migration- Export, import, upgrade, or clone agents
📚 Resources
Access system information and documentation:
letta://system/status- System health and version infoletta://system/models- Available LLM and embedding modelsletta://agents/list- Overview of all agentsletta://tools/all/docs- Complete tool documentation with examplesletta://docs/mcp-integration- Integration guideletta://docs/api-reference- API quick reference
Resource templates for dynamic content:
letta://agents/{agent_id}/config- Agent configurationletta://agents/{agent_id}/memory/{block_id}- Memory block contentletta://tools/{tool_name}/docs- Individual tool documentation
Available Tools
Agent Management
Tool | Description | Annotations |
| Create a new Letta agent | 💰 Medium cost, ⚡ Fast |
| List all available agents | 👁️ Read-only, 💰 Low cost |
| Send a message to an agent | 💰 High cost, ⏱️ Variable time, 🔒 Rate limited |
| Get agent details by ID | 👁️ Read-only, ⚡ Fast |
| Get agent summary information | 👁️ Read-only, ⚡ Fast |
| Update an existing agent | ✏️ Modifies state, ⚡ Fast |
| Delete an agent | ⚠️ Dangerous, 🗑️ Permanent |
| Clone an existing agent | 💰 Medium cost, ⏱️ Medium time |
| Delete multiple agents | ⚠️ Dangerous, 📦 Bulk operation |
| Export agent configuration and memory | 👁️ Read-only, ⚡ Fast, 📦 Full backup |
| Import agent from backup | 💰 High cost, ⏱️ Slow, ✏️ Creates state |
Memory Management
Tool | Description | Annotations |
| List all memory blocks | 👁️ Read-only, ⚡ Fast |
| Create a new memory block | ✏️ Creates state, ⚡ Fast |
| Read a memory block | 👁️ Read-only, ⚡ Fast |
| Update a memory block | ✏️ Modifies state, ⚡ Fast |
| Attach memory to an agent | ✏️ Links resources, ⚡ Fast |
Passage Management
Tool | Description | Annotations |
| Search archival memory | 👁️ Read-only, ⚡ Fast |
| Create archival memory | 💰 Medium cost (embeddings), ⚡ Fast |
| Update archival memory | 💰 Medium cost (re-embedding), ⚡ Fast |
| Delete archival memory | 🗑️ Permanent, ⚡ Fast |
Tool Management
Tool | Description | Annotations |
| List tools for an agent | 👁️ Read-only, ⚡ Fast |
| Attach tools to an agent | ✏️ Modifies capabilities, ⚡ Fast |
| Upload a custom tool | 🔒 Security: Executes code, ⚡ Fast |
| Attach tool to multiple agents | 📦 Bulk operation, ⏱️ Slow |
Model Management
Tool | Description | Annotations |
| List available LLM models | 👁️ Read-only, ⚡ Fast |
| List available embedding models | 👁️ Read-only, ⚡ Fast |
MCP Integration
Tool | Description | Annotations |
| List configured MCP servers | 👁️ Read-only, ⚡ Fast |
| List tools from an MCP server | 👁️ Read-only, ⚡ Fast |
| Import MCP tool to Letta | ✏️ Creates tool, ⚡ Fast |
Prompt Tools
Tool | Description | Annotations |
| List available prompt templates | 👁️ Read-only, ⚡ Fast |
| Execute a prompt template | 💰 Variable cost, ⏱️ Variable time |
Directory Structure
src/index.js- Main entry pointsrc/core/- Core server functionalitysrc/handlers/- Prompt and resource handlerssrc/examples/- Example prompts and resourcessrc/tools/- Tool implementations organized by category:agents/- Agent management toolsmemory/- Memory block toolspassages/- Passage management toolstools/- Tool attachment and managementmcp/- MCP server integration toolsmodels/- Model listing toolsenhanced-descriptions.js- Detailed tool descriptionsoutput-schemas.js- Structured output definitionsannotations.js- Behavioral hints
src/transports/- Server transport implementations
Transport Protocols
The server supports three transport protocols:
HTTP (Recommended) - Streamable HTTP transport with full duplex communication
Endpoint:
http://your-server:3001/mcpBest for production use and remote connections
Supports health checks at
/health
SSE (Server-Sent Events) - Real-time event streaming
Endpoint:
http://your-server:3001/sseGood for unidirectional server-to-client updates
stdio - Standard input/output
Direct process communication
Best for local development and Claude integration
Configuration with MCP Settings
Add the server to your mcp_settings.json:
For remote instances with HTTP transport (recommended):
Docker Operations
Troubleshooting
Common Issues
Connection refused errors
Ensure the server is running and accessible
Check firewall settings for port 3001
Verify the correct transport protocol is being used
Authentication failures
Verify LETTA_BASE_URL includes
/v1suffixCheck LETTA_PASSWORD is correct
Ensure environment variables are loaded
When self-hosting the Letta-Server, set environment variables accordingly:
"env": { "LETTA_BASE_URL": "http://localhost:8283", "LETTA_PASSWORD": "", "LOG_LEVEL": "info" }
Tool execution timeouts
Increase timeout values in MCP configuration
Check network latency for remote connections
Consider using HTTP transport for better reliability
Health Check
The HTTP transport provides a health endpoint:
Response:
Development
Testing
Contributing
We welcome contributions! Please see our Contributing Guide for details on:
Development setup
Code style and standards
Adding new tools
Testing requirements
Pull request process
Security
For security vulnerabilities, please see our Security Policy.
License
MIT License - see LICENSE file for details