MCP Server Trello

Integrations

  • Enables comprehensive Trello board management with capabilities for interacting with cards, lists, and board activities. Supports creating and updating cards, managing lists, tracking recent activity, and handling assigned tasks while respecting Trello's API rate limits.

MCP 服务器 Trello

一个模型上下文协议 (MCP) 服务器,提供与 Trello 看板交互的工具。该服务器能够与 Trello 的 API 无缝集成,同时自动处理速率限制、类型安全和错误处理。

特征

  • 完整的 Trello Board 集成:与卡片、列表和板活动进行交互
  • 内置速率限制:遵守 Trello 的 API 限制(每个 API 密钥 300 个请求/10 秒,每个令牌 100 个请求/10 秒)
  • 类型安全实现:用 TypeScript 编写,具有全面的类型定义
  • 输入验证:对所有 API 输入进行强大的验证
  • 错误处理:优雅的错误处理,提供信息丰富的消息

安装

npm install @modelcontextprotocol/mcp-server-trello

配置

使用以下配置将服务器添加到您的 MCP 设置文件中:

{ "mcpServers": { "trello": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-trello"], "env": { "TRELLO_API_KEY": "your-api-key", "TRELLO_TOKEN": "your-token", "TRELLO_BOARD_ID": "your-board-id" } } } }

必需的环境变量

  • TRELLO_API_KEY :您的 Trello API 密钥(从https://trello.com/app-key获取)
  • TRELLO_TOKEN :您的 Trello 令牌(使用您的 API 密钥生成)
  • TRELLO_BOARD_ID :要交互的 Trello 板的 ID(可在板 URL 中找到)

可用工具

通过列表ID获取卡片

从特定列表中获取所有卡片。

{ name: 'get_cards_by_list_id', arguments: { listId: string // ID of the Trello list } }

获取列表

从配置的板中检索所有列表。

{ name: 'get_lists', arguments: {} }

获取最近的活动

获取论坛上的最近活动。

{ name: 'get_recent_activity', arguments: { limit?: number // Optional: Number of activities to fetch (default: 10) } }

将卡片添加到列表

将新卡片添加到指定列表。

{ name: 'add_card_to_list', arguments: { listId: string, // ID of the list to add the card to name: string, // Name of the card description?: string, // Optional: Description of the card dueDate?: string, // Optional: Due date (ISO 8601 format) labels?: string[] // Optional: Array of label IDs } }

更新卡片详情

更新现有卡的详细信息。

{ name: 'update_card_details', arguments: { cardId: string, // ID of the card to update name?: string, // Optional: New name for the card description?: string, // Optional: New description dueDate?: string, // Optional: New due date (ISO 8601 format) labels?: string[] // Optional: New array of label IDs } }

存档卡

将卡片发送到档案馆。

{ name: 'archive_card', arguments: { cardId: string // ID of the card to archive } }

将列表添加到板

向板上添加新列表。

{ name: 'add_list_to_board', arguments: { name: string // Name of the new list } }

存档列表

将列表发送至档案馆。

{ name: 'archive_list', arguments: { listId: string // ID of the list to archive } }

获取我的卡片

获取分配给当前用户的所有卡。

{ name: 'get_my_cards', arguments: {} }

速率限制

服务器实现了令牌桶算法来进行速率限制,以符合 Trello 的 API 限制:

  • 每个 API 密钥每 10 秒 300 个请求
  • 每个令牌每 10 秒 100 个请求

速率限制是自动处理的,如果达到限制,请求将排队。

错误处理

服务器针对各种场景提供了详细的错误消息:

  • 输入参数无效
  • 超出速率限制
  • API 身份验证错误
  • 网络问题
  • 无效的看板/列表/卡片 ID

发展

先决条件

  • Node.js 16 或更高版本
  • npm 或 yarn

设置

  1. 克隆存储库
git clone https://github.com/modelcontextprotocol/server-trello.git cd server-trello
  1. 安装依赖项
npm install
  1. 构建项目
npm run build

运行测试

npm test

贡献

欢迎贡献代码!请阅读我们的贡献指南,详细了解我们的行为准则以及提交 Pull Request 的流程。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

致谢

ID: 4q0b9jcp2f