
Testrail Mcp Server
io.github.uarlouski由 GitHub 账号 uarlouski 发布v3.3.1更新于 Oct 28, 2026
Connect AI assistants to TestRail: manage test cases, suites, runs, results, and attachments.
概览
本地 MCP 服务器,把 AI 助手接入 TestRail,可浏览项目、管理测试用例、发起测试运行、记录结果并上传附件。
- 可以做什么
- 浏览项目、测试套件、分区和用户,梳理 QA 结构
- 获取、创建、更新和批量编辑测试用例,并查看用例字段、历史及可选的 RAG 导出
- 创建和查询测试运行,列出测试与结果,按测试或用例 ID 提交结果
- 上传和查询附件,管理共享步骤
- 查询状态、优先级、模板、标签和配置
- 在显式开启删除后删除实体
- 适用场景
- 适合 QA 工程师和测试自动化场景:希望助手直接在对话中读写 TestRail,而不是复制粘贴,例如起草测试用例、发起测试运行、标记结果或导出用例到知识库。附带的命令行工具也适用于不想引入大模型的 CI/CD 流水线。
- 运行要求
- 通过 npx 在本地以 stdio 运行,需要 Node.js 18 或更高版本。需要 TESTRAIL_INSTANCE_URL、TESTRAIL_USERNAME 和 TESTRAIL_API_KEY,以及已启用实例级 API 的 TestRail 订阅。可选开关控制读、写、删除权限、禁用工具和功能工具。
安装
在 SourceWeft 中
- 打开 控制台中的 Testrail Mcp Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
🚀 TestRail MCP Server
Connect Claude, Cursor, Windsurf, and VS Code to TestRail — an open-source Model Context Protocol (MCP) server for AI-assisted test management.
Manage TestRail projects, search and create test cases, kick off test runs, record results, and attach files through natural-language conversation with your AI assistant — or from CI/CD with the bundled testrail-cli. Built for QA engineers and AI-assisted test automation.
[npm version] [npm downloads] [CI Status] [License] [TypeScript] [GitHub stars] [Score Badge] [M8ven Score] [M8ven Verified] [Smithery badge]
Compatible with: [Claude Desktop] [Cursor] [Windsurf] [VS Code]
📚 Documentation · Getting Started · Tool Reference · FAQ
What is the TestRail MCP Server?
The TestRail MCP Server is a free, open-source Model Context Protocol server that gives AI assistants direct, structured access to a TestRail instance through the TestRail API v2. Once configured, an assistant such as Claude Desktop, Cursor, Windsurf, or GitHub Copilot in VS Code can search test cases, draft new ones, start test runs, record results, and upload attachments on your behalf — without you leaving the chat window.
It exposes 35 tools, runs locally on Node.js 18+ over the MCP stdio transport, and is licensed under Apache 2.0. There is nothing to host or deploy: your MCP client launches it on demand with npx.
No context switching. No tedious copy-pasting. Just ask your AI.
[!NOTE] Compatibility baseline: tested and validated against TestRail 10.6.2 (API v2). Older TestRail instances (including pre-7.x pagination) are also supported via built-in backward compatibility. TestRail Cloud and self-hosted TestRail Server both work.
Table of contents
- Key features
- Quick start
- Command line interface & CI/CD
- Environment variables
- Available tools
- FAQ
- Documentation
- Contributing
✨ Key Features & Capabilities
🚀 Quick Start Guide
1. Obtain your TestRail API key
Navigate to My Settings → API Keys in TestRail and generate a new key. Copy it immediately — TestRail shows it only once. The API must also be enabled instance-wide under Administration → Site Settings → API.
2. Configure your MCP client
Add the server to your MCP client configuration. The Claude Desktop example is shown below; Cursor, Windsurf, and VS Code use the same pattern (see the collapsible sections).
🤖 Claude Desktop
Add this to your claude_desktop_config.json:
⌨️ Cursor
Open Settings → MCP → Add new MCP server, or edit .cursor/mcp.json in your project (~/.cursor/mcp.json for all projects):
🌊 Windsurf
Edit ~/.codeium/windsurf/mcp_config.json:
💻 VS Code
Add to .vscode/mcp.json. The inputs block keeps your API key out of the file:
🌐 Other MCP Clients
Any MCP-compliant client can use this server, because it speaks the standard MCP stdio transport. Point your client at the npx command with the required environment variables — no port, URL, or transport configuration needed.
3. See it in action
Restart your client completely, then 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 C1042 as passed with the comment 'verified on staging'."
Full per-client setup instructions, including troubleshooting, are in the Getting Started guide.
🖥️ Command Line Interface (CLI) & CI/CD Automation
In addition to interacting via AI assistants, you can invoke any TestRail tool directly from shell scripts, terminal environments, and automated CI/CD pipelines (GitHub Actions, GitLab CI, Jenkins) using testrail-cli or npx — with zero LLM overhead.
- Deterministic Execution: Returns standard Unix exit codes (
0on success,1on error). - Pipeline-Native Output: Emits clean JSON to
stdoutfor piping into tools likejq, while diagnostics and errors go tostderr. - Zero Duplication: Reuses the exact same API client, retry logic, and validation schemas as the MCP server.
Invocation methods
Examples
Query projects (query_project)
Report automated test results (add_results_for_cases)
Export cases for knowledge base / RAG (export_cases_for_rag)
Command discovery & flag documentation
See the CLI & CI/CD guide for complete GitHub Actions, GitLab CI, and Jenkins workflows.
⚙️ Environment Variables & Security Controls
With only the three required credentials, 27 of the 35 tools are registered. Ready-made read-only and least-privilege configurations are in the Configuration guide.
🧰 Available Tools
All 35 tools, grouped by area. Each declares a read, write, or delete mode, which the server surfaces to clients as MCP annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint).
❓ Frequently Asked Questions
Which AI assistants and MCP clients are supported?
Any MCP-compliant client, because the server uses the standard MCP stdio transport. Setup is verified with Claude Desktop, Cursor, Windsurf, and VS Code. Other clients follow the same pattern: run npx -y @uarlouski/testrail-mcp-server@latest with three environment variables.
Which TestRail versions are supported?
The server targets TestRail API v2 and is tested against TestRail 10.6.2. Older instances work too — the client detects whether an endpoint returns a modern paginated response or a legacy bare array, so pre-7.x instances need no configuration. Both TestRail Cloud and self-hosted TestRail Server are supported.
Is it safe to give an AI assistant write access to TestRail?
Access is layered rather than all-or-nothing. Every tool declares a read, write, or delete mode; deletes are disabled unless you explicitly set TESTRAIL_ALLOW_DELETE_OPERATIONS=true. You can disable all writes with TESTRAIL_ALLOW_WRITE_OPERATIONS=false, or block individual tools by name with TESTRAIL_DISABLED_TOOLS. The server runs locally and talks only to your TestRail instance — there is no telemetry and no third-party service in the middle.
Is it free?
Yes — Apache 2.0 licensed, with no paid tier, licence key, or usage limit. You need your own TestRail subscription, and whatever your AI assistant costs. The CLI has no LLM cost at all.
Can I use it in CI/CD without an AI assistant?
Yes. The package ships a testrail-cli binary exposing every tool as a subcommand, reusing the same API client, retry logic, and validation schemas. JSON on stdout, diagnostics on stderr, exit code 0 or 1 — see the CLI guide.
How do I stop the AI from inventing custom fields that don't exist?
It can't. Before add_case or update_case sends anything, the server validates every field key against your instance's real schema (fetched via get_case_fields) and rejects unknown keys. Templates, priorities, statuses, and configurations are all exposed as tools too, so the model looks up correct IDs instead of guessing them.
How do I handle thousands of test cases without blowing the context window?
Pass output_file to get_cases (or output_dir to export_cases_for_rag). The server paginates the full result set, writes raw JSON to disk, and returns only a short summary to the model.
More answers in the full FAQ.
📚 Documentation & Complete Tool Reference
For a comprehensive guide, detailed configuration options, and a complete breakdown of all available tools, visit the official documentation site:
👉 TestRail MCP Server Documentation
- 🚀 Getting Started: Per-client setup for Claude, Cursor, Windsurf, and VS Code.
- ⚙️ Configuration: Every environment variable, permission, and feature flag.
- 🧰 All Tools: All 35 tools with modes and feature flags in one table.
- 🔭 Discovery & Navigation: Exploring projects, suites, and sections.
- 📋 Test Case Management: Fetching, creating, and bulk-updating test cases.
- ▶️ Execution & Tracking: Managing test runs and submitting test results.
- 📎 Attachments: Automatically zipping and uploading files or directories.
- 🔗 Shared Steps: Managing reusable step definitions.
- 🖥️ CLI & CI/CD: Pipeline automation without an LLM.
🤝 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 licensed under the Apache License 2.0.
TestRail MCP Server · Engineered with the Model Context Protocol
来源:README.md,提交 eeadcf5
工具
0版本历史
6- v3.3.1最新Oct 26, 2026
- v3.3.0Oct 20, 2026
- v3.2.0Oct 5, 2026
- v3.1.0Sep 25, 2026
- v3.0.0Sep 22, 2026
- v2.10.0Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分