Letta Cloud MCP服务器
英语| 日本语
用于连接的MCP(模型上下文协议)服务器 莱塔云.
使用来自MCP兼容代理(如Factory Droid、Claude Code和Cursor)的Letta Cloud的有状态内存系统。
特性
- 本地Letta云支持 -无需自托管,只需使用API密钥即可连接
- 内存块操作 -读写角色、人类、项目等记忆块
- 代理交互 -发送消息以触发代理学习
- 档案存储器 -搜索并添加长期记忆
安装
# Clone the repository
git clone https://github.com/wasedaigo/letta-cloud-mcp.git
cd letta-cloud-mcp
# Install dependencies
npm install
# Build
npm run build全局安装(可选)
npm install -g .配置
环境变量
| 变量 | 必填 | 描述 |
|---|---|---|
LETTA_API_KEY | ✅ | Letta Cloud API密钥(拿过来) |
LETTA_DEFAULT_AGENT_ID | - | 要使用的默认代理ID |
工厂Droid配置
~/.factory/mcp.json 或 .factory/mcp.json:
{
"mcpServers": {
"letta-cloud": {
"type": "stdio",
"command": "node",
"args": ["/path/to/letta-cloud-mcp/dist/index.js"],
"env": {
"LETTA_API_KEY": "your-api-key-here",
"LETTA_DEFAULT_AGENT_ID": "agent-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
}
}
}Claude代码配置
claude mcp add letta-cloud \
--command "node /path/to/letta-cloud-mcp/dist/index.js" \
--env LETTA_API_KEY=your-api-key-here \
--env LETTA_DEFAULT_AGENT_ID=agent-xxx光标配置
~/.cursor/mcp.json:
{
"mcpServers": {
"letta-cloud": {
"command": "node",
"args": ["/path/to/letta-cloud-mcp/dist/index.js"],
"env": {
"LETTA_API_KEY": "your-api-key-here",
"LETTA_DEFAULT_AGENT_ID": "agent-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
}
}
}可用工具
代理管理
| 工具 | 说明 |
|---|---|
list_agents | 列出您帐户中的所有代理 |
get_agent | 获取代理的详细信息 |
消息传递
| 工具 | 说明 |
|---|---|
send_message | 向代理发送消息(触发学习) |
get_conversation_history | 从对话中检索最近的消息历史记录 |
内存块操作
| 工具 | 说明 |
|---|---|
list_memory_blocks | 列出附加到代理的内存块 |
get_memory_block | 获取特定内存块的内容 |
update_memory_block | 直接更新内存块 |
append_to_block | 在不覆盖的情况下将内容附加到内存块 |
档案存储器
| 工具 | 说明 |
|---|---|
search_memory | 搜索存档内存 |
add_to_archival | 将内容添加到存档内存 |
用法示例
使用Droid
> List my Letta agents
(Droid calls list_agents tool)
> Save what I learned today to Letta:
> Understood the importance of preload scripts in ipcMain implementation
(Droid sends the learning via send_message tool → Letta autonomously updates memory)
> Show me the project memory block
(Droid calls get_memory_block tool for the project block)编程式用法
// From an MCP client
await mcpClient.callTool("send_message", {
message: "Remember: Adopted ESLint flat config because..."
});
// Direct memory update (external injection)
await mcpClient.callTool("update_memory_block", {
block_id: "block-xxx",
value: "Updated content..."
});建筑
┌─────────────┐ MCP Protocol ┌──────────────────┐ REST API ┌──────────────┐
│ Droid │ ◄──────────────────► │ letta-cloud-mcp │ ◄──────────────► │ Letta Cloud │
│ Claude Code │ (stdio) │ │ (HTTPS) │ │
│ Cursor │ │ @letta-ai/ │ │ app.letta.com│
└─────────────┘ │ letta-client │ └──────────────┘
└──────────────────┘Letta Cloud与自托管
| Aspect | Letta Cloud | 自托管 |
|---|---|---|
| 设置 | 仅限API密钥 | Docker+DB |
| 管理 | 不需要 | 自我管理 |
| 定价 | 现收现付 | 基础设施成本 |
| 此MCP | ✅ 支持 | ❌ 不支持(使用 眼媒体版) |
故障排除
“需要LETTA_API_KEY环境变量”
未设置API密钥。从以下位置获取一个 莱塔云.
“agent_id是必需的”
集 LETTA_DEFAULT_AGENT_ID 或指定 agent_id 调用工具时。
连接错误
- 验证API密钥是否有效
- 检查 Letta云状态
- 验证网络连接
许可证
麻省理工学院
