一个强大的MCP服务器,通过AI主机与Trello看板、列表和卡片进行交互。
uv轻松管理设置Trello API凭证:
将项目根目录中的.env.example文件重命名为.env并设置您刚刚获取的变量:
TRELLO_API_KEY=您的API密钥
TRELLO_TOKEN=您的Token
curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/m0xai/trello-mcp-server.git
cd trello-mcp-server
uv run mcp install main.py
此MCP服务器可以在两种不同的模式下运行:
此模式直接与Claude桌面应用程序集成:
.env文件中设置USE_CLAUDE_APP=true(这是默认值)uv run mcp install main.py
此模式作为独立的SSE服务器运行,可与任何兼容MCP的客户端一起使用,包括Cursor:
.env文件中设置USE_CLAUDE_APP=falsepython main.py
http://localhost:8000上可用(或您配置的端口)您还可以使用Docker Compose运行服务器:
.env文件docker-compose up -d
docker-compose logs -f
docker-compose down
服务器可以通过.env文件中的环境变量进行配置:
| 变量 | 描述 | 默认值 |
|---|---|---|
| TRELLO_API_KEY | 您的Trello API密钥 | 必填 |
| TRELLO_TOKEN | 您的Trello API令牌 | 必填 |
| MCP_SERVER_NAME | MCP服务器名称 | Trello MCP Server |
| MCP_SERVER_HOST | SSE模式下的主机地址 | 0.0.0.0 |
| MCP_SERVER_PORT | SSE模式下的端口 | 8000 |
| USE_CLAUDE_APP | 是否使用Claude应用模式 | true |
您可以根据需要编辑这些值以自定义服务器。
USE_CLAUDE_APP=true)要将您的MCP服务器连接到Cursor:
USE_CLAUDE_APP=false)http://localhost:8000(或您配置的主机/端口)您也可以将此配置添加到您的Cursor设置JSON文件中(通常位于~/.cursor/mcp.json):
{
"mcpServers": {
"trello": {
"url": "http://localhost:8000/sse"
}
}
}
对于其他兼容MCP的客户端,指向SSE端点http://localhost:8000。
这是一个最小的Python示例,用于连接到SSE端点:
import asyncio
import httpx
async def connect_to_mcp_server():
url = "http://localhost:8000/sse"
headers = {"Accept": "text/event-stream"}
async with httpx.AsyncClient() as client:
async with client.stream("GET", url, headers=headers) as response:
# 从第一个SSE消息中获取会话ID
session_id = None
async for line in response.aiter_lines():
if line.startswith("data:"):
data = line[5:].strip()
if "session_id=" in data and not session_id:
session_id = data.split("session_id=")[1]
# 使用会话ID发送消息
message_url = f"http://localhost:8000/messages/?session_id={session_id}"
message = {
"role": "user",
"content": {
"type": "text",
"text": "显示我的Trello看板"
}
}
await client.post(message_url, json=message)
if __name__ == "__main__":
asyncio.run(connect_to_mcp_server())
| 操作 | 看板 | 列表 | 卡片 | 检查清单 | 检查清单项 |
|---|---|---|---|---|---|
| 读取 | ✅ | ✅ | ✅ | ✅ | ✅ |
| 写入 | ❌ | ✅ | ✅ | ✅ | ✅ |
| 更新 | ❌ | ✅ | ✅ | ✅ | ✅ |
| 删除 | ❌ | ✅ | ✅ | ✅ | ✅ |
安装完成后,您可以通过Claude与您的Trello看板进行交互。这里有一些示例查询:
这里是几个示例用法:
<img width="1277" alt="Trello MCP服务器示例用法:请求列出Guitar Board中的所有卡片" src="https://gips3.baidu.com/it/u=2754273324,1892816167&fm=3081&app=3081&f=PNG?w=2554&h=2250" /> <img width="1274" alt="请求在我的项目歌曲中添加新歌曲卡片" src="https://gips2.baidu.com/it/u=3136341469,1132879723&fm=3081&app=3081&f=PNG?w=2548&h=2160" /> <img width="1632" alt="请求添加带有检查清单的新卡片" src="https://github.com/user-attachments/assets/5a63f107-d135-402d-ab33-b9bf13eca751" />如果您遇到问题:
.env文件中的Trello API凭证uv run mcp dev main.py命令检查日志中的错误信息。欢迎提交问题和改进请求!