Taiga MCP Bridge
一个协议桥,将人工智能系统连接到 Taiga 项目管理平台,使人工智能工具能够创建和管理项目、史诗、用户故事、任务、问题和冲刺。
Tools
login
Logs into a Taiga instance using username/password and returns a session_id for subsequent authenticated calls.
list_projects
Lists projects accessible to the user associated with the provided session_id.
list_all_projects
Lists all projects visible to the user (requires admin privileges for full list). Uses the provided session_id.
get_project
Gets detailed information about a specific project by its ID.
get_project_by_slug
Gets detailed information about a specific project by its slug.
update_project
Updates details of an existing project.
delete_project
Deletes a project by its ID. This is irreversible.
get_project_roles
Lists the available roles within a specific project.
list_user_stories
Lists user stories within a specific project, optionally filtered.
create_user_story
Creates a new user story within a project.
get_user_story
Gets detailed information about a specific user story by its ID.
get_user_story_by_ref
Gets detailed information about a specific user story by its reference number within a project.
update_user_story
Updates details of an existing user story.
delete_user_story
Deletes a user story by its ID.
assign_user_story_to_user
Assigns a specific user story to a specific user.
unassign_user_story_from_user
Unassigns a specific user story (sets assigned user to null).
get_user_story_statuses
Lists the available statuses for user stories within a specific project.
list_tasks
Lists tasks within a specific project, optionally filtered.
create_task
Creates a new task within a project.
get_task
Gets detailed information about a specific task by its ID.
get_task_by_ref
Gets detailed information about a specific task by its reference number within a project.
update_task
Updates details of an existing task.
delete_task
Deletes a task by its ID.
assign_task_to_user
Assigns a specific task to a specific user.
unassign_task_from_user
Unassigns a specific task (sets assigned user to null).
get_task_statuses
Lists the available statuses for tasks within a specific project.
list_issues
Lists issues within a specific project, optionally filtered.
create_issue
Creates a new issue within a project.
get_issue
Gets detailed information about a specific issue by its ID.
get_issue_by_ref
Gets detailed information about a specific issue by its reference number within a project.
update_issue
Updates details of an existing issue.
delete_issue
Deletes an issue by its ID.
get_project_members
Lists members of a specific project.
assign_issue_to_user
Assigns a specific issue to a specific user.
unassign_issue_from_user
Unassigns a specific issue (sets assigned user to null).
get_issue_statuses
Lists the available statuses for issues within a specific project.
get_issue_priorities
Lists the available priorities for issues within a specific project.
get_issue_severities
Lists the available severities for issues within a specific project.
get_issue_types
Lists the available types for issues within a specific project.
list_epics
Lists epics within a specific project, optionally filtered.
create_epic
Creates a new epic within a project.
get_epic
Gets detailed information about a specific epic by its ID.
get_epic_by_ref
Gets detailed information about a specific epic by its reference number within a project.
update_epic
Updates details of an existing epic.
delete_epic
Deletes an epic by its ID.
assign_epic_to_user
Assigns a specific epic to a specific user.
unassign_epic_from_user
Unassigns a specific epic (sets assigned user to null).
get_epic_statuses
Lists the available statuses for epics within a specific project.
list_milestones
Lists milestones (sprints) within a specific project.
create_milestone
Creates a new milestone (sprint) within a project.
get_milestone
Gets detailed information about a specific milestone by its ID.
update_milestone
Updates details of an existing milestone.
delete_milestone
Deletes a milestone by its ID.
get_milestone_stats
Gets statistics (total points, completed points, etc.) for a specific milestone.
invite_project_user
Invites a user to a project by email with a specific role.
list_wiki_pages
Lists wiki pages within a specific project.
get_wiki_page
Gets a specific wiki page by its ID.
get_wiki_page_by_slug
Gets a specific wiki page by its slug within a project.
logout
Invalidates the current session_id.
session_status
Checks if the provided session_id is currently active and valid.
README
Taiga MCP 桥接器
<p align="center"> <picture> <img src="https://taiga.io/media/images/favicon.width-44.png"> </picture> </p>
概述
Taiga MCP 桥接器是一个强大的集成层,它将 Taiga 项目管理平台与模型上下文协议 (MCP) 连接起来,使 AI 工具和工作流程能够与 Taiga 的资源无缝交互。
此桥接器为 AI 代理提供了一套全面的工具和资源,以便:
- 在 Taiga 中创建和管理项目、史诗、用户故事、任务和问题
- 跟踪冲刺和里程碑
- 分配和更新工作项
- 查询有关项目工件的详细信息
- 管理项目成员和权限
通过使用 MCP 标准,此桥接器允许 AI 系统保持对项目状态的上下文感知,并以编程方式执行复杂的项目管理任务。
特性
全面的资源支持
该桥接器支持以下 Taiga 资源,并提供完整的 CRUD 操作:
- 项目: 创建、更新和管理项目设置和元数据
- 史诗: 管理跨越多个冲刺的大型功能
- 用户故事: 处理详细的需求和验收标准
- 任务: 跟踪用户故事中的较小工作单元
- 问题: 管理错误、问题和增强请求
- 冲刺 (里程碑): 计划和跟踪在时间盒间隔内的工作
安装
本项目使用 uv 进行快速、可靠的 Python 包管理。
前提条件
- Python 3.10 或更高版本
- uv 包管理器
基本安装
# 克隆存储库
git clone https://github.com/your-org/pyTaigaMCP.git
cd pyTaigaMCP
# 安装依赖项
./install.sh
开发安装
对于开发(包括测试和代码质量工具):
./install.sh --dev
手动安装
如果您喜欢手动安装:
# 仅生产依赖项
uv pip install -e .
# 包含开发依赖项
uv pip install -e ".[dev]"
配置
可以通过环境变量或 .env 文件配置桥接器:
| 环境变量 | 描述 | 默认值 |
|---|---|---|
TAIGA_API_URL |
Taiga API 的基本 URL | http://localhost:9000 |
SESSION_EXPIRY |
会话过期时间(秒) | 28800 (8 小时) |
TAIGA_TRANSPORT |
传输模式 (stdio 或 sse) | stdio |
REQUEST_TIMEOUT |
API 请求超时时间(秒) | 30 |
MAX_CONNECTIONS |
HTTP 连接的最大数量 | 10 |
MAX_KEEPALIVE_CONNECTIONS |
最大保持活动连接数 | 5 |
RATE_LIMIT_REQUESTS |
每分钟最大请求数 | 100 |
LOG_LEVEL |
日志记录级别 | INFO |
LOG_FILE |
日志文件路径 | taiga_mcp.log |
在项目根目录中创建一个 .env 文件来设置这些值:
TAIGA_API_URL=https://api.taiga.io/api/v1/
TAIGA_TRANSPORT=sse
LOG_LEVEL=DEBUG
用法
使用 stdio 模式
将以下 JSON 粘贴到您的 Claude App 或 Cursor 的 mcp 设置部分:
{
"mcpServers": {
"taigaApi": {
"command": "uv",
"args": [
"--directory",
"<本地 pyTaigaMCP 文件夹的路径>",
"run",
"src/server.py"
],
"env": {
"TAIGA_TRANSPORT": "<stdio|sse>",
"TAIGA_API_URL": "<Taiga API Url (例如:http://localhost:9000)",
"TAIGA_USERNAME": "<taiga 用户名>",
"TAIGA_PASSWORD": "<taiga 密码>"
}
}
}
运行桥接器
使用以下命令启动 MCP 服务器:
# 默认 stdio 传输
./run.sh
# 对于 SSE 传输
./run.sh --sse
或者手动:
# 对于 stdio 传输(默认)
uv run python src/server.py
# 对于 SSE 传输
uv run python src/server.py --sse
传输模式
服务器支持两种传输模式:
- stdio (标准输入/输出) - 基于终端的客户端的默认模式
- SSE (服务器发送事件) - 具有服务器推送功能的基于 Web 的传输
您可以通过以下几种方式设置传输模式:
- 使用
run.sh或server.py的--sse标志(默认为 stdio) - 设置
TAIGA_TRANSPORT环境变量 - 将
TAIGA_TRANSPORT=sse添加到您的.env文件
身份验证流程
此 MCP 桥接器使用基于会话的身份验证模型:
-
登录: 客户端必须首先使用
login工具进行身份验证:session = client.call_tool("login", { "username": "your_taiga_username", "password": "your_taiga_password", "host": "https://api.taiga.io" # 可选 }) # 从响应中保存 session_id session_id = session["session_id"] -
使用工具和资源: 在每个 API 调用中包含
session_id:# 对于资源,在 URI 中包含 session_id projects = client.get_resource(f"taiga://projects?session_id={session_id}") # 对于特定于项目的资源 epics = client.get_resource(f"taiga://projects/123/epics?session_id={session_id}") # 对于工具,将 session_id 作为参数包含 new_project = client.call_tool("create_project", { "session_id": session_id, "name": "New Project", "description": "Description" }) -
检查会话状态: 您可以检查您的会话是否仍然有效:
status = client.call_tool("session_status", {"session_id": session_id}) # 返回有关会话有效性和剩余时间的信息 -
注销: 完成后,您可以注销以终止会话:
client.call_tool("logout", {"session_id": session_id})
示例:完整的项目创建工作流程
这是一个创建包含史诗和用户故事的完整项目示例:
from mcp.client import Client
# 初始化 MCP 客户端
client = Client()
# 身份验证并获取会话 ID
auth_result = client.call_tool("login", {
"username": "admin",
"password": "password123",
"host": "https://taiga.mycompany.com"
})
session_id = auth_result["session_id"]
# 创建一个新项目
project = client.call_tool("create_project", {
"session_id": session_id,
"name": "My New Project",
"description": "A test project created via MCP"
})
project_id = project["id"]
# 创建一个史诗
epic = client.call_tool("create_epic", {
"session_id": session_id,
"project_id": project_id,
"subject": "User Authentication",
"description": "Implement user authentication features"
})
epic_id = epic["id"]
# 在史诗中创建一个用户故事
story = client.call_tool("create_user_story", {
"session_id": session_id,
"project_id": project_id,
"subject": "User Login",
"description": "As a user, I want to log in with my credentials",
"epic_id": epic_id
})
# 完成后注销
client.call_tool("logout", {"session_id": session_id})
开发
项目结构
pyTaigaMCP/
├── src/
│ ├── server.py # 带有工具的 MCP 服务器实现
│ ├── taiga_client.py # 包含所有 CRUD 操作的 Taiga API 客户端
│ ├── tools.py # MCP 工具定义
│ └── config.py # 带有 Pydantic 的配置设置
├── tests/
│ ├── conftest.py # 共享 pytest fixtures
│ ├── unit/ # 单元测试
│ └── integration/ # 集成测试
├── pyproject.toml # 项目配置和依赖项
├── install.sh # 安装脚本
├── run.sh # 服务器执行脚本
└── README.md # 项目文档
测试
使用 pytest 运行测试:
# 运行所有测试
pytest
# 仅运行单元测试
pytest tests/unit/
# 仅运行集成测试
pytest tests/integration/
# 运行带有特定标记的测试
pytest -m "auth" # 身份验证测试
pytest -m "core" # 核心功能测试
# 运行带有覆盖率报告的测试
pytest --cov=src
调试和检查
使用包含的检查器工具进行调试:
# 默认 stdio 传输
./inspect.sh
# 对于 SSE 传输
./inspect.sh --sse
# 对于开发模式
./inspect.sh --dev
错误处理
所有 API 操作都以以下格式返回标准化的错误响应:
{
"status": "error",
"error_type": "ExceptionClassName",
"message": "详细的错误消息"
}
性能注意事项
该桥接器实现了几个性能优化:
- 连接池: 重用 HTTP 连接以获得更好的性能
- 速率限制: 防止 Taiga API 过载
- 重试机制: 自动重试失败的请求,并采用指数退避
- 会话清理: 定期清理过期的会话以释放资源
贡献
欢迎贡献!请随时提交 Pull Request。
- Fork 存储库
- 创建您的功能分支 (
git checkout -b feature/amazing-feature) - 安装开发依赖项 (
./install.sh --dev) - 进行更改
- 运行测试 (
pytest) - 提交您的更改 (
git commit -m 'Add some amazing feature') - 将分支推送到远程仓库 (
git push origin feature/amazing-feature) - 打开一个 Pull Request
许可证
此项目已获得 MIT 许可证的许可 - 有关详细信息,请参阅 LICENSE 文件。
致谢
- Taiga 感谢他们出色的项目管理平台
- 模型上下文协议 (MCP) 感谢标准化的 AI 通信框架
- 感谢所有帮助塑造此项目的贡献者
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。