Trello MCP服务器

一个连接Trello与AI助手(如Claude Desktop、GitHub Copilot Chat等)的模型上下文协议(MCP)服务器,支持查看、创建、移动卡片等操作。

  • by lzvxck
  • TypeScript
  • 本地部署
  • 7 星标
  • 更新于
在 GitHub 查看 lioarce01/trello-mcp-server

使用说明

Trello MCP服务器

一个模型上下文协议(MCP)服务器,将Trello与人工智能助手(如Claude Desktop、GitHub Copilot Chat和其他MCP兼容客户端)连接起来。

特性

  • 📋 列出您的所有Trello板
  • 🔍 读取板内容(列表和卡片)
  • ➕ 创建新卡
  • 🔄 在列表之间移动卡片
  • 💬 在卡片上添加评论
  • 🗃️ 档案卡
  • 🔗 接入板作为MCP资源
  • 🐳 Docker支持,易于部署

先决条件

  • 已安装Node.js 20+(用于本地开发)
  • Docker(用于容器化部署)
  • Trello账户
  • Trello API证书(API密钥和令牌)

安装

选项1:本地安装

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

选项2:Docker安装

  1. 克隆此存储库:
git clone https://github.com/lioarce01/trello-mcp-server.git
cd trello-mcp-server
  1. 构建Docker镜像:
docker build -t trello-mcp-server .

获取Trello API凭据

  1. 获取API密钥:

    • 首选https://trello.com/app-key
    • 复制API密钥
  2. 获取您的令牌:

    • 在同一页面上,点击“Token”链接
    • 授权应用程序并复制您的令牌

配置

适用于克劳德桌面

本地安装

将服务器配置添加到Claude Desktop配置文件中:

窗户: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json

{
  "mcp": {
    "servers": {
      "trello-mcp": {
        "command": "node",
        "args": ["absolute/path/to/the/project/dist/index.js"],
        "env": {
          "TRELLO_API_KEY": "your_api_key",
          "TRELLO_TOKEN": "your_token",
          "TRELLO_BASE_URL": "https://api.trello.com/1"
        }
      }
    }
  }
}

Docker配置

对于Docker部署,添加以下配置:

{
  "mcp": {
    "servers": {
      "trello-mcp": {
        "command": "docker",
        "args": [
          "run",
          "--rm",
          "-i",
          "-e",
          "TRELLO_API_KEY=your_api_key",
          "-e",
          "TRELLO_TOKEN=your_token",
          "-e",
          "TRELLO_BASE_URL=https://api.trello.com/1",
          "trello-mcp-server"
        ]
      }
    }
  }
}

通过GitHub Copilot聊天获取VS代码

本地安装

添加到您的VS代码设置.json:

{
  "mcp": {
    "servers": {
      "trello-mcp": {
        "command": "node",
        "args": ["absolute/path/to/the/project/dist/index.js"],
        "env": {
          "TRELLO_API_KEY": "your_api_key",
          "TRELLO_TOKEN": "your_token",
          "TRELLO_BASE_URL": "https://api.trello.com/1"
        }
      }
    }
  }
}

Docker配置

{
  "mcp": {
    "servers": {
      "trello-mcp": {
        "command": "docker",
        "args": [
          "run",
          "--rm",
          "-i",
          "-e",
          "TRELLO_API_KEY=your_api_key",
          "-e",
          "TRELLO_TOKEN=your_token",
          "-e",
          "TRELLO_BASE_URL=https://api.trello.com/1",
          "trello-mcp-server"
        ]
      }
    }
  }
}

重要提示:

  • 替换 absolute/path/to/the/project/dist/index.js 带有编译的服务器文件(本地安装)的实际绝对路径
  • 替换 YOUR_TRELLO_API_KEY 和 YOUR_TRELLO_TOKEN 使用您的真实Trello证书

Docker使用

使用Docker运行

# Build the image
docker build -t trello-mcp-server .

# Run with API key and token as arguments
docker run --rm -i --env-file .env trello-mcp-server

局部测试

要测试您的服务器是否正常工作:

  1. 构建项目:
npm run build
  1. 使用凭据运行:
node dist/index.js

Docker测试

  1. 使用Docker构建和运行:
docker build -t trello-mcp-server .
docker run --rm -i --env-file .env trello-mcp-server
  1. 您应该看到:
MCP server connected and ready.

注: 服务器将等待MCP客户端连接。要退出,请按 Ctrl+C.

配置后,您可以通过自然语言与Trello板进行交互:

列表板

Show me all my Trello boards

阅读董事会内容

What cards are in my "Project Management" board?

创建卡片

Create a new card called "Review documentation" in the "To Do" list

移动卡片

Move the "Bug fix" card to the "In Progress" list

添加注释

Add a comment to the card saying "This needs urgent attention"

档案卡

Archive the completed card "Setup database"

可用工具

工具 说明 参数
list_boards 列出所有打开的Trello板 无
read_board 读取特定板上的列表和卡片 boardId
create_list 创建列表 boardId, name
create_card 在特定列表中创建新卡 listId, name, desc (可选)
move_card 将卡片移动到其他列表 cardId, listId
add_comment 在卡片上添加评论 cardId, text
archive_card 将卡片存档 cardId
archive_list 存档列表 listId
delete_board 删除板 boardId
update_list_name 更新列表名称 listId, name
update_card_name 更新卡名 cardId, name

可用资源

服务器将您的Trello板暴露为可由AI助手读取的MCP资源:

  • 资源URI: board:{boardId}
  • 内容: JSON包含板的所有列表和卡片

发展

建筑

地方发展

npm run build

Docker开发

# Build Docker image
docker build -t trello-mcp-server .

在发展中奔跑

地方发展

要直接运行服务器(用于测试):

# With npm
npm run build
node dist/index.js

# With pnpm
pnpm run build
node dist/index.js

Docker开发

# Run with docker (pass credentials as arguments)
docker run --rm -i --env-file .env trello-mcp-server

开发脚本

您还可以在您的 package.json:

{
  "scripts": {
    "build": "tsc",
    "start": "node dist/index.js",
    "dev": "tsx ./src/index.ts",
    "docker:build": "docker build -t trello-mcp-server .",
    "docker:run": "docker run --rm -i --env-file .env trello-mcp-server"
  }
}

故障排除

服务器未连接

  1. 检查凭据: 确保将API密钥和令牌作为参数传递
  2. 验证文件路径: 确保MCP配置中的路径正确(本地安装)
  3. 先构建: 始终运行 npm run build 或 docker build 测试前
  4. 独立测试: 请先尝试独立运行服务器
  5. 重新启动客户端: 配置更改后重新启动MCP客户端(Claude Desktop/VS Code)

Docker特定问题

  1. 未找到图像: 确保您首先使用以下命令构建了Docker映像 docker build -t trello-mcp-server .
  2. 未传递的参数: 确保将API密钥和令牌作为参数传递到映像名称之后
  3. 权限: 检查Docker是否具有运行容器所需的权限

无效凭据错误

  • 双重检查您的Trello API密钥和令牌
  • 确保令牌具有必要的权限
  • 如果令牌已过期,请尝试重新生成它
  • 验证凭据是否作为参数正确传递

工具不工作

  • 验证板/卡/列表ID是否正确
  • 检查您是否具有Trello板的写入权限
  • 查看控制台日志以了解详细的错误消息

安全说明

  • 永远不要提交您的API证书 到版本控制
  • 安全地存储凭据并定期轮换
  • 使用 .env 文件并将其添加到 .gitignore
  • 服务器只需要您通过Trello令牌授予的权限
  • 考虑在生产中使用环境变量作为凭据
  • Docker容器使用非root用户运行以确保安全

许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

由以下材料制成❤️ 对于MCP社区