io.github.uarlouski/testrail-mcp-server
平台与服务by uarlouski
面向 TestRail 平台的 Model Context Protocol (MCP) server,使 LLM 能创建、读取和管理各类测试工件。
什么是 io.github.uarlouski/testrail-mcp-server?
面向 TestRail 平台的 Model Context Protocol (MCP) server,使 LLM 能创建、读取和管理各类测试工件。
README
🌟 Why Choose TestRail MCP Server?
Managing test cases manually is tedious and error-prone. With the TestRail MCP Server, your AI assistant (whether it’s Claude, Cursor, Windsurf, or any MCP-compliant client) interacts directly with your TestRail instance. Instruct it to find test cases, draft new ones, kick off test runs, and record test results—all through natural conversation.
No context switching. No tedious copy-pasting. Just ask your AI.
✨ Key Features & Capabilities
| Capability | Description |
|---|---|
| 🔍 Intelligent Discovery | Browse projects, test suites, and sections to automatically map your QA organization. |
| 📋 Full Case Management | Fetch, create, update, and bulk-edit test cases with comprehensive custom field support. |
| ▶️ Actionable Execution | Create test runs, update results by test_id or case_id, attach files, and track statuses. |
| 🧠 Context-Aware AI | Dynamically exposes templates, fields, priorities, and statuses so LLMs generate valid, structured data. |
🚀 Quick Start Guide
1. Obtain Your TestRail API Key
Navigate to My Settings → API Keys in your TestRail platform and generate a new key for authentication.
2. Configure Your MCP Client
Add the server to your chosen MCP client configuration. The Claude Desktop example is shown below; Cursor, Windsurf, and other clients use the same pattern (see the collapsible sections further down).
🤖 Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"testrail": {
"command": "npx",
"args": ["-y", "@uarlouski/testrail-mcp-server@latest"],
"env": {
"TESTRAIL_INSTANCE_URL": "https://your-instance.testrail.io",
"TESTRAIL_USERNAME": "your@email.com",
"TESTRAIL_API_KEY": "your-api-key",
"TESTRAIL_ENABLE_SHARED_STEPS": "true"
}
}
}
}
Open Settings → Features → MCP and add a new configuration:
{
"mcpServers": {
"testrail": {
"command": "npx",
"args": ["-y", "@uarlouski/testrail-mcp-server@latest"],
"env": {
"TESTRAIL_INSTANCE_URL": "https://your-instance.testrail.io",
"TESTRAIL_USERNAME": "your@email.com",
"TESTRAIL_API_KEY": "your-api-key"
}
}
}
}
Update your Windsurf MCP configuration file:
{
"mcpServers": {
"testrail": {
"command": "npx",
"args": ["-y", "@uarlouski/testrail-mcp-server@latest"],
"env": {
"TESTRAIL_INSTANCE_URL": "https://your-instance.testrail.io",
"TESTRAIL_USERNAME": "your@email.com",
"TESTRAIL_API_KEY": "your-api-key"
}
}
}
}
Any MCP-compliant client can utilize this server. The pattern is universal—point your client at the npx command with the required environment variables.
3. See It in Action
Once configured, turbo-charge your QA workflow by asking your AI assistant:
- "List all projects in TestRail to find the latest active project."
- "Show me all active users in the project to find the right assignee."
- "Show me all test cases in section 5 of project 3."
- "Create a comprehensive test case for 'Login Validation' with detailed steps."
- "Start a new test run containing cases from section 5."
- "Mark test case ID 1042 as passed with the comment 'Tested successfully on staging'."
⚙️ Environment Variables & Security Controls
| Variable | Description | Required | Default |
|---|---|---|---|
TESTRAIL_INSTANCE_URL | Your TestRail instance URL (e.g., https://example.testrail.io) | ✅ | |
TESTRAIL_USERNAME | Your TestRail user email address | ✅ | |
TESTRAIL_API_KEY | Your TestRail API key (Guide) | ✅ | |
TESTRAIL_ENABLE_SHARED_STEPS | Set to true to enable Shared Steps management tools | false | |
TESTRAIL_ALLOW_WRITE_OPERATIONS | Allow write operations (e.g. adding/updating test cases, test runs, sections) | true | |
TESTRAIL_ALLOW_READ_OPERATIONS | Allow read operations (e.g. retrieving projects, test cases, templates) | true | |
TESTRAIL_ALLOW_DELETE_OPERATIONS | Allow delete operations (e.g. deleting cases or shared steps). Enabled strictly via true. | false |
🛠️ Complete Tool Reference
The TestRail MCP Server provides heavily typed, descriptive tools designed specifically for LLM interaction:
💡 Pro Tip: Handling Large Data Sets & Permissions
- Large Data Sets: For list-based tools like
get_casesandget_sections, you can supply theoutput_fileparameter with an absolute file path. The server will bypass the LLM context window by writing the raw JSON directly to disk and returning a concise summary, allowing you to run external scripts against the export!- Intelligent User Fallback: When fetching users using
get_userswithout admin rights, TestRail denies access globally. The server dynamically catches this permission restriction and falls back to polling all active projects in parallel, retrieving and deduplicating active users so assignees and reviewers can always be mapped.
🔭 Discovery & Navigation
| Tool | Functionality |
|---|---|
query_project | Retrieve a single project (action: "one") or all active projects (action: "many"). |
query_suite | Retrieve a single test suite (action: "one") or all test suites for a project (action: "many"). |
get_sections | Navigate the precise folder/section hierarchy of any test suite. |
mutate_suite | Create a new test suite or update an existing one in TestRail. |
mutate_section | Create a new section or update an existing section in TestRail. |
get_users | Retrieve active users. Handles per-project filtering and automatic fallback polling for non-admin accounts. |
📋 Test Case Management
| Tool | Functionality |
|---|---|
get_cases | Query test cases with advanced filtering (priority, template, type, etc.) and pagination. |
get_case | Fetch complete, structured details of a specific test case, including custom steps and fields. |
add_case | Seamlessly create a new test case equipped with robust custom field validation. |
update_case | Modify an existing test case's steps, metadata, or titles. |
update_cases | Execute bulk-updates on multiple test cases simultaneously to save time. |
▶️ Test Execution & Tracking
| Tool | Functionality |
|---|---|
query_run | Retrieve a single test run (action: "one") or all test runs for a project (action: "many", supporting filters). |
mutate_run | Create a new test run or update an existing one in TestRail. |
get_tests | Retrieve individual tests for a specific test run, with optional status filtering. |
get_results | Retrieve paginated results for a specific test ID. |
add_results | Submit test results to a test run using the specific test_id. |
add_results_for_cases | Submits results to a run mapping directly to case_ids, streamlining automation workflows. |
add_attachment_to_run | Attach logs, files, or zipped artifacts directly to an ongoing test run. |
🔗 Shared Steps (Optional)
| Tool | Functionality |
|---|---|
get_shared_steps | List shared test steps for a project with optional reference filtering. |
get_shared_step | Retrieve precise details of a specific shared test step set. |
get_shared_step_history | View the complete audit trail and version history of a shared step set. |
add_shared_step | Create a new reusable set of shared test steps. |
update_shared_step | Modify an existing shared step set (changes propagate to all linked test cases). |
🗑️ Deletion
| Tool | Functionality |
|---|---|
delete_entity | Deletes a specified TestRail entity (supports "case" or "shared_step") by its ID. Requires TESTRAIL_ALLOW_DELETE_OPERATIONS to be set to true in your environment. |
🧠 System Metadata
| Tool | Functionality |
|---|---|
get_statuses | Systematically list all configured test statuses (Passed, Failed, Blocked, Retest, etc.). |
get_priorities | Retrieve priority levels configured within your instance structure. |
get_case_fields | Discover custom field definitions, formats, and UI dropdown options. Supports filtering by project_id. |
get_templates | Identify available case templates to mandate correct AI structuring. |
get_configurations | Retrieve all configuration groups and configurations for a project. |
🤝 Contributing
Open-source contributions are actively welcomed! Please feel free to open an issue for feature requests or submit a pull request for improvements.
📜 License
This project is securely licensed under the Apache License 2.0.
<p align="center"> <b>TestRail MCP Server</b> · Engineered with the <a href="https://modelcontextprotocol.io">Model Context Protocol</a> </p>
常见问题
io.github.uarlouski/testrail-mcp-server 是什么?
面向 TestRail 平台的 Model Context Protocol (MCP) server,使 LLM 能创建、读取和管理各类测试工件。
相关 Skills
Slack动图
by anthropics
面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。
✎ 帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。
MCP构建
by anthropics
聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。
✎ 想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。
接口测试套件
by alirezarezvani
扫描 Next.js、Express、FastAPI、Django REST 的 API 路由,自动生成覆盖鉴权、参数校验、错误码、分页、上传与限流场景的 Vitest 或 Pytest 测试套件。
✎ 帮你把API与集成测试自动化跑顺,减少回归漏测;能力全面,尤其适合复杂接口场景的QA团队。
相关 MCP Server
Slack 消息
编辑精选by Anthropic
Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。
✎ 这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。
by netdata
io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。
✎ 这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。
by d4vinci
Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。
✎ 这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。