MCP Server Trello

by delorenj
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Provides tools for interacting with Trello boards, including fetching cards and lists, adding new cards and lists, updating card details, archiving cards and lists, and fetching recent activity.

MCP 服务器 Trello

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

变更日志

0.1.2

  • 增加了对多阶段构建的 Docker 支持
  • 通过将环境变量移动到.env来提高安全性
  • 添加了 Docker Compose 配置
  • 添加了.env.template以便于设置

0.1.1

  • 添加了move_card工具以在列表之间移动卡片
  • 改进的文档

0.1.0

  • 初始版本具有基本的 Trello 板管理功能

特征

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

安装

Docker 安装(推荐)

运行服务器的最简单方法是使用 Docker:

  1. 克隆存储库:
git clone https://github.com/delorenj/mcp-server-trello cd mcp-server-trello
  1. 复制环境模板并填写您的 Trello 凭据:
cp .env.template .env
  1. 使用 Docker Compose 构建并运行:
docker compose up --build

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Trello 服务器:

npx -y @smithery/cli install @modelcontextprotocol/mcp-server-trello --client claude

手动安装

npm install @delorenj/mcp-server-trello

配置

可以使用环境变量配置服务器。在根目录中创建一个.env文件,其中包含以下变量:

TRELLO_API_KEY=your-api-key TRELLO_TOKEN=your-token TRELLO_BOARD_ID=your-board-id

您可以从以下位置获取这些值:

可用工具

通过列表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: {} }

移动卡

将卡片移至不同的列表。

{ name: 'move_card', arguments: { cardId: string, // ID of the card to move listId: string // ID of the target list } }

速率限制

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

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

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

错误处理

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

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

发展

先决条件

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

设置

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

贡献

欢迎投稿!

执照

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

致谢

ID: klqkamy7wt