Skip to main content
Glama

MCP Server Trello

MCP 服务器 Trello

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

变更日志

0.3.0

  • 增加了董事会和工作区管理功能:
    • list_boards - 列出用户有权访问的所有板块
    • set_active_board - 设置活动板以供将来操作
    • list_workspaces - 列出用户有权访问的所有工作区
    • set_active_workspace - 设置活动工作区以供将来操作
    • list_boards_in_workspace - 列出特定工作区中的所有板
    • get_active_board_info - 获取有关当前活动板的信息
  • 添加了持久配置存储以记住活动的板/工作区
  • 改进了所有新操作的错误处理

0.2.1

  • 为速率限制器功能添加了详细的 JSDoc 注释
  • 改进了图像附件功能的错误处理
  • 更新了attach_image_to_card工具的文档

0.2.0

  • 添加了attach_image_to_card工具,用于将图像从URL附加到卡片
  • 增加了对多阶段构建的 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文件,其中包含以下变量:

# Required: Your Trello API credentials TRELLO_API_KEY=your-api-key TRELLO_TOKEN=your-token # Required: Initial board ID (can be changed later using set_active_board) TRELLO_BOARD_ID=your-board-id # Optional: Initial workspace ID (can be changed later using set_active_workspace) TRELLO_WORKSPACE_ID=your-workspace-id

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

董事会和工作空间管理

从 0.3.0 版本开始,MCP 服务器支持动态板和工作区选择:

  • .env文件中的TRELLO_BOARD_ID在服务器启动时用作初始板 ID
  • 您可以随时使用set_active_board工具更改活动板
  • 选定的板在服务器重启后仍然存在(存储在~/.trello-mcp/config.json中)
  • 类似地,您可以使用set_active_workspace设置并保留活动工作区

这使得您无需重新启动服务器或更改环境变量即可使用多个板和工作区。

示例工作流程
  1. 首先列出可用的主板:
{ name: 'list_boards', arguments: {} }
  1. 设置您的活跃板:
{ name: 'set_active_board', arguments: { boardId: "abc123" // ID from list_boards response } }
  1. 如果需要,列出工作区:
{ name: 'list_workspaces', arguments: {} }
  1. 如果需要,设置活动工作区:
{ name: 'set_active_workspace', arguments: { workspaceId: "xyz789" // ID from list_workspaces response } }
  1. 检查当前活跃的董事会信息:
{ name: 'get_active_board_info', arguments: {} }

可用工具

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

将图像附加到卡片

直接从 URL 将图像附加到卡片。

{ name: 'attach_image_to_card', arguments: { cardId: string, // ID of the card to attach the image to imageUrl: string, // URL of the image to attach name?: string // Optional: Name for the attachment (defaults to "Image Attachment") } }

列表板

列出用户有权访问的所有板块。

{ name: 'list_boards', arguments: {} }

设置活动板

设置活动板以供将来的操作。

{ name: 'set_active_board', arguments: { boardId: string // ID of the board to set as active } }

列出工作区

列出用户有权访问的所有工作区。

{ name: 'list_workspaces', arguments: {} }

设置活动工作区

为将来的操作设置活动工作区。

{ name: 'set_active_workspace', arguments: { workspaceId: string // ID of the workspace to set as active } }

列出工作区中的板

列出特定工作区中的所有板。

{ name: 'list_boards_in_workspace', arguments: { workspaceId: string // ID of the workspace to list boards from } }

获取活动板信息

获取有关当前活跃板的信息。

{ name: 'get_active_board_info', arguments: {} }

速率限制

服务器实现了令牌桶算法来进行速率限制,以符合 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文件。

致谢

Related MCP Servers

  • A
    security
    F
    license
    A
    quality
    Enables interaction with Trello boards, lists, and cards through Model Context Protocol (MCP) tools, leveraging TypeScript for type safety and asynchronous operations.
    Last updated -
    5
    JavaScript
  • A
    security
    A
    license
    A
    quality
    A Model Context Protocol server that provides tools for interacting with Trello boards, enabling seamless management of cards, lists, and activities while handling rate limiting and type safety.
    Last updated -
    10
    3
    JavaScript
    MIT License
    • Apple
  • -
    security
    A
    license
    -
    quality
    Connects to Trello with all the tools available that I was able to find in API reference
    Last updated -
    3
    1
    TypeScript
    MIT License
  • A
    security
    A
    license
    A
    quality
    Enables seamless integration with Trello boards, allowing users to manage cards, lists, and activities while automatically handling rate limiting and providing type safety.
    Last updated -
    9
    TypeScript
    MIT License

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/delorenj/mcp-server-trello'

If you have feedback or need assistance with the MCP directory API, please join our Discord server