Claude 模型协议 Trello 服务
一种模型上下文协议服务器,提供与Trello看板交互的工具,能够无缝管理卡片、列表和活动,同时处理速率限制和类型安全。
服务介绍
Claude MCP Trello
一个提供与 Trello 看板交互工具的 Model Context Protocol (MCP) 服务器。该服务器在无缝集成 Trello API 的同时,自动处理速率限制、类型安全和错误处理。
特性
- 完整的 Trello 看板集成:与卡片、列表和看板活动进行交互
- 内置速率限制:遵守 Trello 的 API 限制(每个 API 密钥每 10 秒 300 次请求,每个令牌每 10 秒 100 次请求)
- 类型安全实现:使用 TypeScript 编写,并具有全面的类型定义
- 输入验证:对所有 API 输入进行强大的验证
- 错误处理:优雅的错误处理并附有信息性的消息
可用工具
trello_get_cards_by_list
检索指定列表 ID 中包含的所有卡片。
{
name: "trello_get_cards_by_list",
arguments: {
listId: string; // Trello list ID
}
}
trello_get_lists
检索看板中的所有列表。
{
name: "trello_get_lists",
arguments: {}
}
trello_get_recent_activity
检索最近的看板活动。limit 参数可以指定要检索的数量(默认为 10)。
{
name: "trello_get_recent_activity",
arguments: {
limit?: number; // Optional: number of activities to retrieve
}
}
trello_add_card
向指定列表添加一张卡片。
{
name: "trello_add_card",
arguments: {
listId: string; // The ID of the list to add to
name: string; // The title of the card
description?: string; // Optional: details of the card
dueDate?: string; // Optional: due date (e.g., ISO8601)
labels?: string[]; // Optional: array of label IDs
}
}
trello_update_card
更新卡片的内容。
{
name: "trello_update_card",
arguments: {
cardId: string; // The ID of the card to be updated
name?: string; // Optional: updated title
description?: string; // Optional: updated description
dueDate?: string; // Optional: updated due date (e.g., ISO8601)
labels?: string[]; // Optional: updated array of label IDs
}
}
trello_archive_card
归档(关闭)指定的卡片。
{
name: "trello_archive_card",
arguments: {
cardId: string; // The ID of the card to archive
}
}
trello_add_list
向看板中添加一个新的列表。
{
name: "trello_add_list",
arguments: {
name: string; // Name of the new list
}
}
trello_archive_list
归档(关闭)指定的列表。
{
name: "trello_archive_list",
arguments: {
listId: string; // The ID of the list to archive
}
}
trello_get_my_cards
检索与您的账户相关的所有卡片。
{
name: "trello_get_my_cards",
arguments: {}
}
trello_search_all_boards
根据计划/权限,在工作区(组织)中的所有看板上执行跨看板搜索。
{
name: "trello_search_all_boards",
arguments: {
query: string; // Search keyword
limit?: number; // Optional: max number of results (default: 10)
}
}
速率限制
服务器采用令牌桶算法来实现速率限制,以符合 Trello 的 API 限制:
- 每个 API 密钥每 10 秒 300 次请求
- 每个令牌每 10 秒 100 次请求
速率限制会自动处理,如果达到限制,请求将被排队。
错误处理
服务器针对各种场景提供了详细的错误消息:
- 无效的输入参数
- 超过速率限制
- API 认证错误
- 网络问题
- 无效的看板/列表/卡片 ID
开发
前提条件
- Node.js 16 或更高版本
- npm 或 yarn
设置
-
克隆仓库:
git clone https://github.com/hrs-asano/claude-mcp-trello.git cd claude-mcp-trello -
安装依赖项:
npm install -
构建项目:
npm run build
运行测试
npm test
与 Claude Desktop 集成
要将此 MCP 服务器与 Claude Desktop 集成,请在您的
~/Library/Application\ Support/Claude/claude_desktop_config.json 文件中添加以下配置:
{
"mcpServers": {
"trello": {
"command": "{YOUR_NODE_PATH}", // for example: /opt/homebrew/bin/node
"args": [
"{YOUR_PATH}/claude-mcp-trello/build/index.js"
],
"env": {
"TRELLO_API_KEY": "{YOUR_KEY}",
"TRELLO_TOKEN": "{YOUR_TOKEN}",
"TRELLO_BOARD_ID": "{YOUR_BOARD_ID}"
}
}
}
}
请确保将 {YOUR_NODE_PATH}、{YOUR_PATH}、{YOUR_KEY}、{YOUR_TOKEN} 和 {YOUR_BOARD_ID} 替换为您环境中的适当值。
贡献
欢迎贡献!请阅读我们的贡献指南,了解行为准则以及提交拉取请求的流程详情。
许可证
本项目根据 MIT 许可证发布 - 详情请参阅 LICENSE 文件。
致谢
- 使用 Model Context Protocol SDK 构建
- 利用了 Trello REST API