Letta
HTTP-SSESTDIOAgent management and memory operations server for Letta system integration
Agent management and memory operations server for Letta system integration
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.
Create a .env file with the following variables:
# Required LETTA_BASE_URL=https://your-letta-instance.com/v1 LETTA_PASSWORD=your-secure-password # Optional PORT=3001 NODE_ENV=production
# Global installation (recommended for CLI usage) npm install -g letta-mcp-server # Or local installation npm install letta-mcp-server
After installing globally, add to your Claude Desktop configuration:
{ "mcpServers": { "letta": { "command": "letta-mcp", "args": [], "env": { "LETTA_BASE_URL": "https://your-letta-instance.com/v1", "LETTA_PASSWORD": "your-secure-password" } } } }
# Install globally npm install -g letta-mcp-server # Set environment variables export LETTA_BASE_URL=https://your-letta-instance.com/v1 export LETTA_PASSWORD=your-secure-password # Run the server letta-mcp # stdio (for Claude Desktop) letta-mcp --http # HTTP transport letta-mcp --sse # SSE transport
This repository provides three different implementations of the Letta MCP server, allowing you to choose the best option for your use case:
Branch: master
The original implementation with individual tools for each API endpoint.
Best for:
Docker Images:
# Latest master branch build docker pull ghcr.io/oculairmedia/letta-mcp-server:master
Features:
Branch: nodejs-consolidated-tools
Modern implementation with 7 consolidated tools using the discriminator pattern.
Best for:
Docker Images:
# Latest stable release docker pull ghcr.io/oculairmedia/letta-mcp-server:latest # Specific version docker pull ghcr.io/oculairmedia/letta-mcp-server:2.0.1 # Development branch docker pull ghcr.io/oculairmedia/letta-mcp-server:nodejs-consolidated-tools
Features:
operation parameter)Branch: rust-implementation
High-performance implementation built with Rust and the TurboMCP framework.
Best for:
Docker Images:
# Latest Rust build docker pull ghcr.io/oculairmedia/letta-mcp-server-rust:rust-latest # Development branch docker pull ghcr.io/oculairmedia/letta-mcp-server-rust:rust-implementation
Features:
| 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 | 
Use Classic (master) if:
Use Node.js Consolidated if:
Use Rust if:
All three implementations provide identical functionality and MCP protocol compliance. You can switch between them at any time without changing your Letta instance configuration.
# Clone the repository git clone https://github.com/oculairmedia/letta-MCP-server.git cd letta-MCP-server # Install dependencies npm install # Development npm run dev # Default (stdio) transport npm run dev:sse # SSE transport npm run dev:http # HTTP transport (recommended) # Production npm run start # Default (stdio) transport npm run start:sse # SSE transport npm run start:http # HTTP transport (recommended)
Available tags:
latest - Latest stable release2.0.1, 2.0, 2 - Specific version tagsmaster - Latest master branch build# Pull the latest image docker pull ghcr.io/oculairmedia/letta-mcp-server:latest # Run with environment variables docker run -d \ -p 3001:3001 \ -e LETTA_BASE_URL=https://your-letta-instance.com/v1 \ -e LETTA_PASSWORD=your-secure-password \ -e PORT=3001 \ -e NODE_ENV=production \ --name letta-mcp \ ghcr.io/oculairmedia/letta-mcp-server:latest # Or use a specific version docker run -d \ -p 3001:3001 \ -e LETTA_BASE_URL=https://your-letta-instance.com/v1 \ -e LETTA_PASSWORD=your-secure-password \ --name letta-mcp \ ghcr.io/oculairmedia/letta-mcp-server:2.0.1
version: '3.8' services: letta-mcp: image: ghcr.io/oculairmedia/letta-mcp-server:latest container_name: letta-mcp ports: - "3001:3001" environment: - LETTA_BASE_URL=https://your-letta-instance.com/v1 - LETTA_PASSWORD=your-secure-password - PORT=3001 - NODE_ENV=production restart: unless-stopped
# Clone and build locally git clone https://github.com/oculairmedia/letta-MCP-server.git cd letta-MCP-server docker build -t letta-mcp-server . docker run -d -p 3001:3001 --env-file .env --name letta-mcp letta-mcp-server
# Create startup script chmod +x /opt/stacks/letta-MCP-server/start-mcp.sh # Add to Claude claude mcp add --transport stdio letta-tools "/opt/stacks/letta-MCP-server/start-mcp.sh"
See the Architecture Documentation for detailed system diagrams and component relationships.
This server implements the full MCP specification with all three capabilities:
All tools include:
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 agentsAccess 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 referenceResource 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| Tool | Description | Annotations | 
|---|---|---|
create_agent | Create a new Letta agent | 💰 Medium cost, ⚡ Fast | 
list_agents | List all available agents | 👁️ Read-only, 💰 Low cost | 
prompt_agent | Send a message to an agent | 💰 High cost, ⏱️ Variable time, 🔒 Rate limited | 
retrieve_agent | Get agent details by ID | 👁️ Read-only, ⚡ Fast | 
get_agent_summary | Get agent summary information | 👁️ Read-only, ⚡ Fast | 
modify_agent | Update an existing agent | ✏️ Modifies state, ⚡ Fast | 
delete_agent | Delete an agent | ⚠️ Dangerous, 🗑️ Permanent | 
clone_agent | Clone an existing agent | 💰 Medium cost, ⏱️ Medium time | 
bulk_delete_agents | Delete multiple agents | ⚠️ Dangerous, 📦 Bulk operation | 
export_agent | Export agent configuration and memory | 👁️ Read-only, ⚡ Fast, 📦 Full backup | 
import_agent | Import agent from backup | 💰 High cost, ⏱️ Slow, ✏️ Creates state | 
| Tool | Description | Annotations | 
|---|---|---|
list_memory_blocks | List all memory blocks | 👁️ Read-only, ⚡ Fast | 
create_memory_block | Create a new memory block | ✏️ Creates state, ⚡ Fast | 
read_memory_block | Read a memory block | 👁️ Read-only, ⚡ Fast | 
update_memory_block | Update a memory block | ✏️ Modifies state, ⚡ Fast | 
attach_memory_block | Attach memory to an agent | ✏️ Links resources, ⚡ Fast | 
| Tool | Description | Annotations | 
|---|---|---|
list_passages | Search archival memory | 👁️ Read-only, ⚡ Fast | 
create_passage | Create archival memory | 💰 Medium cost (embeddings), ⚡ Fast | 
modify_passage | Update archival memory | 💰 Medium cost (re-embedding), ⚡ Fast | 
delete_passage | Delete archival memory | 🗑️ Permanent, ⚡ Fast | 
| Tool | Description | Annotations | 
|---|---|---|
list_agent_tools | List tools for an agent | 👁️ Read-only, ⚡ Fast | 
attach_tool | Attach tools to an agent | ✏️ Modifies capabilities, ⚡ Fast | 
upload_tool | Upload a custom tool | 🔒 Security: Executes code, ⚡ Fast | 
bulk_attach_tool_to_agents | Attach tool to multiple agents | 📦 Bulk operation, ⏱️ Slow | 
| Tool | Description | Annotations | 
|---|---|---|
list_llm_models | List available LLM models | 👁️ Read-only, ⚡ Fast | 
list_embedding_models | List available embedding models | 👁️ Read-only, ⚡ Fast | 
| Tool | Description | Annotations | 
|---|---|---|
list_mcp_servers | List configured MCP servers | 👁️ Read-only, ⚡ Fast | 
list_mcp_tools_by_server | List tools from an MCP server | 👁️ Read-only, ⚡ Fast | 
add_mcp_tool_to_letta | Import MCP tool to Letta | ✏️ Creates tool, ⚡ Fast | 
| Tool | Description | Annotations | 
|---|---|---|
list_prompts | List available prompt templates | 👁️ Read-only, ⚡ Fast | 
use_prompt | Execute a prompt template | 💰 Variable cost, ⏱️ Variable time | 
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 hintssrc/transports/ - Server transport implementationsThe server supports three transport protocols:
HTTP (Recommended) - Streamable HTTP transport with full duplex communication
http://your-server:3001/mcp/healthSSE (Server-Sent Events) - Real-time event streaming
http://your-server:3001/ssestdio - Standard input/output
Add the server to your mcp_settings.json:
"letta": { "command": "node", "args": [ "--no-warnings", "--experimental-modules", "path/to/letta-server/src/index.js" ], "env": { "LETTA_BASE_URL": "https://your-letta-instance.com", "LETTA_PASSWORD": "yourPassword" }, "disabled": false, "alwaysAllow": [ "upload_tool", "attach_tool", "list_agents", "list_memory_blocks" ], "timeout": 300 }
For remote instances with HTTP transport (recommended):
"remote_letta_tools": { "url": "http://your-server:3001/mcp", "transport": "http", "disabled": false, "alwaysAllow": [ "attach_tool", "list_agents", "list_tools", "get_agent" ], "timeout": 120 }
# View container logs docker logs -f letta-mcp # Stop the container docker stop letta-mcp # Update to latest version docker pull ghcr.io/oculairmedia/letta-mcp-server:latest docker stop letta-mcp docker rm letta-mcp docker run -d -p 3001:3001 -e PORT=3001 -e NODE_ENV=production --name letta-mcp ghcr.io/oculairmedia/letta-mcp-server:latest
Connection refused errors
Authentication failures
/v1 suffix"env": { "LETTA_BASE_URL": "http://localhost:8283", "LETTA_PASSWORD": "", "LOG_LEVEL": "info" }
Tool execution timeouts
The HTTP transport provides a health endpoint:
curl http://your-server:3001/health
Response:
{ "status": "healthy", "transport": "streamable_http", "protocol_version": "2025-06-18", "sessions": 0, "uptime": 12345.678 }
# Run tests npm test # Run tests with coverage npm run test:coverage # Run linter npm run lint
We welcome contributions! Please see our Contributing Guide for details on:
For security vulnerabilities, please see our Security Policy.
MIT License - see LICENSE file for details