MCP服务器Trello
一种模型上下文协议(MCP)服务器,提供与Trello板交互的工具。该服务器能够与Trello的API无缝集成,同时自动处理速率限制、类型安全和错误处理。
特性
- Trello板完全集成:与卡片、列表和棋盘活动交互
- 内置速率限制:遵守Trello的API限制(每个API密钥300个请求/10秒,每个令牌100个请求/10 s)
- 类型安全实施:用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
}
}档案卡
向档案馆发送一张卡片。
{
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
}
}归档列表
将列表发送到存档。
{
name: 'archive_list',
arguments: {
listId: string // ID of the list to archive
}
}get_my_card
获取分配给当前用户的所有卡片。
{
name: 'get_my_cards',
arguments: {}
}速率限制
服务器实现用于速率限制的令牌桶算法,以符合Trello的API限制:
- 每个API密钥每10秒300个请求
- 每个令牌每10秒100个请求
速率限制是自动处理的,如果达到限制,请求将被排队。
错误处理
服务器为各种场景提供详细的错误消息:
- 输入参数无效
- 请求频率超限
- API身份验证错误
- 网络问题
- 板/列表/卡ID无效
发展
先决条件
- Node.js 16或更高版本
- npm或纱线
设置
- 克隆存储库
git clone https://github.com/modelcontextprotocol/server-trello.git
cd server-trello- 安装依赖项
npm install- 构建项目
npm run build运行测试
npm test贡献
欢迎投稿!请阅读我们的 贡献指南 有关我们的行为准则和提交pull请求流程的详细信息。
许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
