Skip to main content
Glama

Letta MCP 서버

npm version Rust Tests Coverage Docker Build License: MIT

Letta AI를 위한 고성능 Model Context Protocol (MCP) 서버로, Rust와 TurboMCP 프레임워크로 구축되었습니다.

기능

  • 7개의 통합 도구: 판별자(discriminator) 패턴을 사용하여 103개의 작업을 처리

  • 고성능 -- Rust 기반, 약 10-30MB 메모리 사용, 500ms 미만의 시작 시간, tokio::join! 및 buffer_unordered를 통한 병렬 팬아웃

  • 이중 전송 -- stdio (Claude Desktop, Cursor 등) 및 HTTP (프로덕션 배포)

  • 응답 크기 최적화 -- LLM 컨텍스트 효율성을 위해 응답 크기를 68-96% 감소

  • 타입이 지정된 스키마 -- 매개변수별 설명이 포함된 구체적인 object/array 타입 (일반 Value 매개변수 없음)

  • 멀티 플랫폼 -- macOS, Linux, Windows (x64 및 arm64)

  • Letta 0.16.x 호환 -- 아카이브, 대화, MCP 서버 v2

  • MCP 2025-11-25 준수 -- SSE를 통한 스트리밍 가능한 HTTP 전송

  • 컴파일 타임 라우팅 -- TurboMCP v3 매크로를 통한 도구 디스패치 시 런타임 오버헤드 제로

Related MCP server: A2A Client MCP Server

빠른 시작

npm (권장)

npm install -g letta-mcp-server

사용 중인 플랫폼에 맞는 바이너리가 자동으로 설치됩니다.

플랫폼

패키지

macOS Intel

letta-mcp-darwin-x64

macOS Apple Silicon

letta-mcp-darwin-arm64

Linux x64

letta-mcp-linux-x64

Linux arm64

letta-mcp-linux-arm64

Windows x64

letta-mcp-windows-x64

Docker

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

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

환경 변수

변수

필수

기본값

설명

LETTA_BASE_URL

예

—

Letta API URL (예: http://localhost:8283)

LETTA_PASSWORD

예

—

Letta API 비밀번호

TRANSPORT

아니오

stdio

전송 모드: stdio 또는 http

PORT

아니오

6507

HTTP 포트 (TRANSPORT=http일 때)

RUST_LOG

아니오

info

로그 레벨: debug, info, warn, error

RUST_BACKTRACE

아니오

0

백트레이스 활성화 (0 또는 1)

LETTA_MCP_MAX_VALUE_LEN

아니오

500

블록/구절/검색 값의 최대 문자 수

LETTA_MCP_CORE_MEMORY_PREVIEW_LEN

아니오

200

코어 메모리 미리보기의 최대 문자 수

사용 가능한 도구

이 서버는 103개의 작업을 수행하는 7개의 통합 도구를 제공합니다:

도구

작업 수

설명

letta_agent_advanced

28

에이전트 수명 주기, 메시징, 대화, 컨텍스트, 내보내기/가져오기

letta_memory_unified

24

코어 메모리, 블록, 아카이브 구절, 아카이브, 검색

letta_tool_manager

13

도구 CRUD, 연결/해제, 대량 작업

letta_source_manager

15

데이터 소스, 파일, 구절, 첨부 파일

letta_job_monitor

4

작업 추적, 취소, 활성 모니터링

letta_file_folder_ops

8

파일 세션, 폴더 관리

letta_mcp_ops

11

MCP 서버 수명 주기, 도구 검색, v2 API 지원

도구 작업

letta_agent_advanced (28개 작업)

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개 작업)

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개 작업)

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개 작업)

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개 작업)

list, get, cancel, list_active

letta_file_folder_ops (8개 작업)

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

letta_mcp_ops (11개 작업)

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

응답 크기 최적화

Rust 구현체에는 LLM 컨텍스트 효율성을 위한 상당한 응답 크기 최적화가 포함되어 있습니다:

작업

최적화

크기 감소

에이전트 목록

기본 페이지네이션 (15개 항목), 요약 모드

68-85%

도구 목록

기본 페이지네이션 (25개 항목), 잘린 설명

70-90%

메모리 블록

목록 모드에서 무거운 필드 제외

60-80%

소스 목록

요약 모드, 페이지네이션

75-95%

페이지네이션

모든 목록 작업은 페이지네이션을 지원합니다:

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

요약 모드 vs 전체 모드

목록 작업은 기본적으로 요약 데이터를 반환합니다. 전체 세부 정보를 보려면 특정 ID와 함께 get 작업을 사용하세요:

// 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 클라이언트 설정

Claude Desktop

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

Cursor / Windsurf

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

OpenCode (HTTP)

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

소스에서 빌드하기

사전 요구 사항

  • Rust nightly (2024 에디션 지원) - rustup을 통해 설치

  • Docker (선택 사항, 컨테이너 빌드용)

로컬 빌드

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

Docker 빌드

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

아키텍처

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

주요 의존성

  • TurboMCP v3 -- 컴파일 타임 라우팅 및 스트리밍 가능한 HTTP를 지원하는 MCP 프레임워크

  • letta-rs -- Vendored Rust Letta API 클라이언트 (0.16.x)

  • Tokio -- 비동기 런타임

  • Futures -- 스트림 결합기 (병렬 팬아웃을 위한 buffer_unordered)

  • Serde -- 직렬화/역직렬화

문제 해결

연결 거부 (Connection Refused)

  1. 서버가 실행 중인지 확인: docker ps | grep letta-mcp

  2. 로그 확인: docker logs letta-mcp

  3. 포트 접근 가능 여부 확인: curl http://localhost:6507/mcp

인증 오류

  1. LETTA_BASE_URL이 Letta 인스턴스를 가리키는지 확인

  2. LETTA_PASSWORD가 올바른지 확인

  3. 컨테이너에서 Letta 서버에 접근할 수 있는지 확인

도구를 찾을 수 없음

  1. MCP를 통해 사용 가능한 도구 목록 확인: tools/list

  2. 올바른 작업 이름을 사용 중인지 확인 (예: list_agents가 아닌 list)

로그

# View server logs
docker logs -f letta-mcp

# Enable debug logging
RUST_LOG=debug letta-mcp

기여하기

  1. 저장소를 포크하세요

  2. 기능 브랜치를 만드세요: git checkout -b feature/my-feature

  3. 변경 사항을 적용하고 테스트를 추가하세요

  4. 테스트 실행: cargo test

  5. 풀 리퀘스트를 제출하세요

라이선스

MIT 라이선스 - 자세한 내용은 LICENSE 파일을 참조하세요.

관련 프로젝트

Available Tools

36 tools
add_mcp_tool_to_lettaA

Registers a tool from a connected MCP server as a native Letta tool AND attaches it to a specified agent. Use list_mcp_tools_by_server to find available tools, and list_agents to get agent IDs.

Inputs: tool_name (required), agent_id (required). Returns: success, tool_id, agent_id, tool_name, +1 more

attach_memory_blockA

Attach a memory block to an agent. Use list_memory_blocks to find blocks, create_memory_block to make new ones. Common labels: "persona", "human", "system".

Inputs: block_id (required), agent_id (required), label. Returns: label, success, agent_id, block_id

attach_toolA

Attach one or more tools (by ID or name) to an agent. If a name corresponds to an MCP tool not yet in Letta, it will be registered first. Find tools with list_mcp_tools_by_server or create custom ones with upload_tool. Use list_agent_tools to verify attachment.

Inputs: agent_id (required), tool_id, tool_ids, tool_names. Returns: errors, success, attached_tools

bulk_attach_tool_to_agentsA

Attaches a specified tool to multiple agents based on filter criteria (name or tags). Use list_agents to find agents and list_mcp_tools_by_server or upload_tool to get tool IDs.

Inputs: tool_id (required), agent_name_filter, agent_tag_filter. Returns: results, tool_id, total_agents, failed_attachments, +1 more

bulk_delete_agentsA

Deletes multiple agents based on filter criteria (name or tags) or a specific list of IDs. Use list_agents first to identify agents to delete. WARNING: This action is permanent.

Inputs: agent_ids, agent_name_filter, agent_tag_filter. Returns: failed, deleted, results, total_agents

clone_agentA

Creates a new agent by cloning the configuration of an existing agent. Use list_agents to find source agent ID. Alternative to export_agent + import_agent workflow. Modify the clone with modify_agent afterwards.

Inputs: source_agent_id (required), new_agent_name (required), override_existing_tools, project_id. Returns: success, new_agent_id, new_agent_name, original_agent_id

create_agentA

Create a new Letta agent with specified configuration. After creation, use attach_tool to add capabilities, attach_memory_block to configure memory, or prompt_agent to start conversations.

Inputs: name (required), description (required), model, embedding. Returns: agent_id, capabilities

create_conversation_entryA

Store a conversation entry in an agent's archival memory. Use this to record conversations from external sources (like Claude Code sessions) that should be searchable via search_archival_memory. Entries are formatted with metadata for easy filtering.

Inputs: agent_id (required), role (required), content (required), timestamp, +2 more.

create_memory_blockA

Create a new memory block in the Letta system. Common labels: "persona", "human", "system". Use attach_memory_block to link to agents, or update_memory_block to modify later.

Inputs: name (required), label (required), value (required), agent_id, +1 more. Returns: id, name, label, value, +1 more

create_passageA

Insert a memory into an agent's archival memory store. Use list_passages to view existing memories, modify_passage to edit, or delete_passage to remove.

Inputs: agent_id (required), text (required), include_embeddings. Returns: id, text, metadata, created_at, +1 more

delete_agentA

Delete a specific agent by ID. Use list_agents to find agent IDs. For bulk deletion, use bulk_delete_agents. WARNING: This action is permanent.

Inputs: agent_id (required). Returns: message, success, agent_id

delete_memory_blockA

Delete a memory block by ID. Use list_memory_blocks to find block IDs. WARNING: This action is permanent and cannot be undone.

Inputs: block_id (required), agent_id.

delete_passageA

Delete a memory from an agent's archival memory store. Use list_passages to find memory IDs. WARNING: This action is permanent.

Inputs: agent_id (required), memory_id (required). Returns: message, success, passage_id

export_agentA

Export an agent's configuration to a JSON file and optionally upload it. Use import_agent to recreate the agent later, or clone_agent for a quick copy. Use list_agents to find agent IDs.

Inputs: agent_id (required), output_path, return_base64, upload_to_xbackbone, +2 more. Returns: success, file_path, agent_data, upload_url, +1 more

get_agent_summaryA

Provides a concise summary of an agent's configuration, including core memory snippets and attached tool/source names. Use list_agents to find agent IDs. Follow up with modify_agent to change settings or attach_tool to add capabilities.

Inputs: agent_id (required). Returns: name, model, tools, agent_id, +3 more

import_agentA

Import a serialized agent JSON file and recreate the agent in the system. Use export_agent to create the JSON file, then modify_agent or attach_tool to customize the imported agent.

Inputs: file_path (required), append_copy_suffix, override_existing_tools, project_id. Returns: name, success, agent_id, warnings

list_agentsA

List all available agents in the Letta system. Use with create_agent to add new ones, get_agent_summary for details, or prompt_agent to interact with them.

Inputs: filter. Returns: agents

list_agent_toolsA

List all tools available for a specific agent. Use attach_tool to add more tools or list_mcp_tools_by_server to discover available tools.

Inputs: agent_id (required). Returns: tools, agent_id

list_embedding_modelsA

List available embedding models configured on the Letta server. Use with create_agent or modify_agent to set agent embedding preferences.

Inputs: no named parameters. Returns: models

list_llm_modelsA

List available LLM models configured on the Letta server. Use with create_agent or modify_agent to set agent model preferences.

Inputs: no named parameters. Returns: models

list_mcp_serversA

List all configured MCP servers on the Letta server. Use with list_mcp_tools_by_server to explore available tools from each server.

Inputs: no named parameters. Returns: servers

list_mcp_tools_by_serverA

List all available tools for a specific MCP server. Use list_mcp_servers first to see available servers, then add_mcp_tool_to_letta to import tools into Letta.

Inputs: mcp_server_name (required), filter, page, pageSize. Returns: tools, total, server_name

list_memory_blocksA

List all memory blocks available in the Letta system. Use create_memory_block to add new ones, update_memory_block to modify, or attach_memory_block to link them to agents.

Inputs: filter, agent_id, page, pageSize, +4 more. Returns: page, total, blocks, pageSize

list_messagesB

Retrieve messages from an agent's conversation history. Returns paginated message history including user messages, assistant responses, tool calls, and system messages. Use for reviewing past conversations or debugging agent behavior.

Inputs: agent_id (required), limit, order, before, +2 more.

list_passagesA

Retrieve the memories in an agent's archival memory store (paginated query). Use create_passage to add new memories, modify_passage to edit, or delete_passage to remove them.

Inputs: agent_id (required), after, before, limit, +4 more. Returns: total, has_more, passages

list_promptsB

List all available prompt templates including wizards and workflows

Inputs: no named parameters. Returns: prompts, total_prompts

modify_agentA

Update an existing agent by ID with provided data. Use get_agent_summary to see current config, list_llm_models/list_embedding_models for model options. For tools, use attach_tool instead.

Inputs: agent_id (required), update_data (required). Returns: success, agent_id, updated_fields

modify_passageA

Modify a memory in the agent's archival memory store. Use list_passages to find memory IDs. Currently only supports updating the text content.

Inputs: agent_id (required), memory_id (required), update_data (required), include_embeddings. Returns: success, new_text, passage_id

prompt_agentA

Send a message to an agent and get a response. Ensure the agent has necessary tools attached (see attach_tool) first. Use list_agents to find agent IDs.

Inputs: agent_id (required), message (required). Returns: usage, messages

read_memory_blockA

Get full details of a specific memory block by ID. Use list_memory_blocks to find block IDs. After reading, use update_memory_block to modify content.

Inputs: block_id (required), agent_id. Returns: id, name, label, value, +1 more

retrieve_agentA

Get the full state of a specific agent by ID. Similar to get_agent_summary but returns complete details. Use list_agents to find agent IDs.

Inputs: agent_id (required). Returns: id, name, model, tools, +4 more

search_archival_memoryA

Search an agent's archival memory using semantic similarity. Returns passages most similar to the query. Use list_passages for text-based search or pagination, create_passage to add memories.

Inputs: agent_id (required), query (required), tags, tag_match_mode, +4 more.

search_memoryA

Search an agent's memory across both archival passages and conversation messages. Supports text search with optional date filtering. Use source parameter to search only archival or messages for better performance.

Inputs: agent_id (required), query (required), source, start_date, +2 more.

update_memory_blockA

Update the contents and metadata of a memory block. Use list_memory_blocks to find block IDs, or read_memory_block to see current content before updating.

Inputs: block_id (required), value, metadata, agent_id. Returns: success, block_id, updated_fields

upload_toolA

Upload a new tool to the Letta system. Use with attach_tool to add it to agents, or list_agent_tools to verify attachment.

Inputs: name (required), description (required), source_code (required), category, +1 more. Returns: name, tool_id, category, attached_to_agent

use_promptB

Execute a registered prompt template. Use this to run wizards, workflows, and guided interactions.

Inputs: prompt_name (required), arguments. Returns: messages, description, prompt_name

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 36 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap that could cause confusion. For example, 'list_passages' and 'search_archival_memory' both deal with archival memory, and 'get_agent_summary' and 'retrieve_agent' both provide agent details with unclear differentiation in their descriptions. However, the descriptions generally help clarify the intended use cases.

    Naming Consistency5/5

    The tool names follow a highly consistent verb_noun pattern throughout, such as 'create_agent', 'list_agents', 'modify_agent', and 'delete_agent'. There are no deviations in naming conventions, making the set predictable and easy to understand.

    Tool Count2/5

    With 36 tools, the count is excessive for the domain of agent management and memory handling. This many tools can overwhelm users and agents, making it difficult to navigate and select the right tool efficiently. A more streamlined set would improve usability.

    Completeness5/5

    The tool set provides comprehensive coverage for managing agents, tools, memory, and conversations in the Letta system. It includes full CRUD operations for agents, memory blocks, and passages, along with advanced features like cloning, importing/exporting, and searching. No obvious gaps are present for the stated purpose.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers