Trello卡片接口服务

一个用于与Trello API交互的模型上下文协议(MCP)服务器,使AI助手能够通过标准化接口从Trello卡片中检索信息。

  • by LorhanSohaky
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 LorhanSohaky/trello-mcp

使用说明

Trello MCP服务器

用于与Trello API交互的模型上下文协议(MCP)服务器。该服务器使AI助手能够通过标准化的界面从Trello卡中检索信息。

特性

  • 卡片检索:通过ID或直接链接获取Trello卡
  • 只读模式:用于安全操作的可选只读模式
  • 类型安全:使用TypeScript和Zod构建,用于强大的类型验证
  • 调试支持:用于故障排除的可选调试日志记录

安装

先决条件

  • Node.js≥22.7.0
  • npm≥10.8.2
  • 具有API访问权限的Trello帐户

设置

  1. 克隆存储库:
git clone https://github.com/LorhanSohaky/trello-mcp.git
cd trello-mcp
  1. 安装依赖项:
npm install
  1. 获取您的Trello API证书:

配置

服务器需要以下配置参数:

参数 类型 必填 默认 说明
apiKey string 是 - 您的Trello API密钥
apiToken string 是 - 您的Trello API代币
debug boolean 否 false 启用调试日志记录
readOnly boolean 否 假 启用只读模式

配置示例

{
  "apiKey": "your_trello_api_key_here",
  "apiToken": "your_trello_api_token_here",
  "debug": false,
  "readOnly": true
}

可用工具

getCardById

通过Trello卡的唯一ID检索Trello卡。

参数:

  • idCard (string):要检索的Trello卡的ID

例子:

{
  "tool": "getCardById",
  "input": { "idCard": "5f1a2b3c4d5e6f7g8h9i0j1k" }
}

getCardByLink

使用Trello卡的公共链接检索Trello卡。

参数:

  • link (string):要检索的Trello卡的URL

例子:

{
  "tool": "getCardByLink",
  "input": { "link": "https://trello.com/c/abc123def/123-card-title" }
}

发展

此项目使用 史密瑟里 用于MCP服务器开发和部署。

以开发模式运行

npm run dev

这将使用Smithery的开发工具通过热重新加载启动MCP服务器。

装订和格式化

该项目使用 生物群系 用于修剪和格式化:

# Format and fix linting issues
npm run lint:fix

# Check for linting issues only
npm run lint

项目结构

├── .editorconfig     # Editor configuration
├── .gitignore        # Git ignore rules
├── biome.json        # Biome linter/formatter config
├── lefthook.yaml     # Git hooks configuration
├── LICENSE.md        # MIT license
├── package.json      # Node.js dependencies and scripts
├── smithery.yaml     # Smithery MCP server configuration
├── README.md         # This file
└── src/
    ├── index.ts      # Main MCP server implementation
    └── trello/
        ├── index.ts  # Trello API client
        ├── cards.ts  # Cards API implementation
        └── schemas.ts # Zod schemas for type validation

使用AI助手

此MCP服务器旨在与支持模型上下文协议的AI助手配合使用。配置后,助手可以使用提供的工具:

  • 检索项目管理任务的完整卡片信息
  • 使用Trello链接获取详细的卡数据
  • 访问所有卡片属性,包括标签、会员、到期日期和附件
  • 将Trello数据集成到工作流程和自动化中

API响应格式

这两个工具都以JSON格式返回完整的卡对象,其中包含所有可用的卡信息,包括:

{
  "id": "card_id_here",
  "name": "Card Title",
  "desc": "Card Description",
  "url": "https://trello.com/c/...",
  "shortLink": "abc123",
  "idBoard": "board_id",
  "idList": "list_id",
  "labels": [...],
  "members": [...],
  "due": "2025-01-01T00:00:00.000Z",
  // ... and many other properties
}

工具与技术

错误处理

该服务器包括强大的错误处理功能,用于:

  • 卡ID无效
  • Trello链接格式错误
  • API身份验证失败
  • 网络连接问题

安全

  • 服务器支持只读模式,以防止意外修改
  • 所有操作都需要API凭据
  • 所有输入都使用Zod模式进行验证

贡献

  1. 分叉存储库
  2. 创建要素分支: git checkout -b feature-name
  3. 进行更改并添加测试
  4. 运行linting: npm run lint:fix
  5. 提交您的更改: git commit -am 'Add feature'
  6. 推到分支: git push origin feature-name
  7. 提交拉取请求

许可证

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

支持

对于问题和疑问:


此MCP服务器是使用 @模型上下文协议/sdk 并遵循MCP工具集成的最佳实践。