T

Trello助手

@delorenj/mcp-server-trello
0 Stars 415 次浏览 delorenj 更新于 2026-08-23

通过 Trello API 促进与 Trello 看板的交互,提供诸如速率限制、类型安全、输入验证和错误处理等功能,以实现卡片、列表和看板活动的无缝管理。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

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

该服务需要配置环境变量:TRELLO_API_KEY、TRELLO_BOARD_ID、TRELLO_TOKEN

可用工具 (9 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

get_cards_by_list_id 1 个参数 需填 1 项

Fetch cards from a specific Trello list

必填参数:listId

get_lists

Retrieve all lists from the specified board

该工具无需必填参数,直接调用即可

get_recent_activity 1 个参数

Fetch recent activity on the Trello board

该工具无需必填参数,直接调用即可

add_card_to_list 5 个参数 需填 2 项

Add a new card to a specified list

必填参数:listId、name

update_card_details 5 个参数 需填 1 项

Update an existing card's details

必填参数:cardId

archive_card 1 个参数 需填 1 项

Send a card to the archive

必填参数:cardId

add_list_to_board 1 个参数 需填 1 项

Add a new list to the board

必填参数:name

archive_list 1 个参数 需填 1 项

Send a list to the archive

必填参数:listId

get_my_cards

Fetch all cards assigned to the current user

该工具无需必填参数,直接调用即可

服务介绍

MCP Server Trello

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

特性

  • 完整的Trello看板集成:与卡片、列表和看板活动进行交互
  • 内置速率限制:遵守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中找到)

可用工具

get_cards_by_list_id

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

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

get_lists

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

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

get_recent_activity

获取看板上的最新活动。

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

add_card_to_list

向指定列表添加新卡片。

{
  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
  }
}

update_card_details

更新现有卡片的详细信息。

{
  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
  }
}

archive_card

将卡片归档。

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

add_list_to_board

向看板添加新列表。

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

archive_list

将列表归档。

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

get_my_cards

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

{
  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

贡献

欢迎贡献!请阅读我们的贡献指南,了解我们的行为准则以及提交拉取请求的过程。

许可证

该项目根据MIT许可证发布 - 详情请参阅 LICENSE 文件。

致谢

相关 MCP 服务