TestRail MCP Server
MCP server for TestRail that enables AI assistants to interact with TestRail's test management platform. It can query and manage projects, test cases, runs, results, plans, milestones, and more.
README
<p align="center"> <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D18-blue.svg" alt="Node.js ≥18"></a> <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.8-blue.svg?logo=typescript&logoColor=white" alt="TypeScript 5.8"></a> <a href="https://github.com/bhayanak/testrail-mcp-server/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a> <a href="#available-tools"><img src="https://img.shields.io/badge/MCP%20Tools-27-blueviolet.svg" alt="27 MCP Tools"></a> </p>
<p align="center"> <img src="https://img.shields.io/badge/coverage-93.88%25-brightgreen.svg" alt="Coverage 93.88%"> <img src="https://img.shields.io/badge/functions-100%25-brightgreen.svg" alt="Functions 100%"> <img src="https://img.shields.io/badge/branches-81.46%25-green.svg" alt="Branches 81.46%"> </p>
<p align="center"> <img src="https://img.shields.io/badge/lint-ESLint%20%2B%20Security-green.svg" alt="ESLint + Security"> <img src="https://img.shields.io/badge/format-Prettier-ff69b4.svg" alt="Prettier"> <img src="https://img.shields.io/badge/commits-Conventional-fe5196.svg?logo=conventionalcommits&logoColor=white" alt="Conventional Commits"> </p>
<p align="center"> <img src="https://img.shields.io/badge/security-Trivy%20SBOM-important.svg" alt="Trivy Vulnerability Scan"> <img src="https://img.shields.io/badge/secrets-Gitleaks-critical.svg" alt="Gitleaks Secret Scanning"> <img src="https://img.shields.io/badge/SAST-CodeQL-blue.svg" alt="CodeQL Analysis"> <img src="https://img.shields.io/badge/dependency%20review-enabled-brightgreen.svg" alt="Dependency Review"> </p>
<p align="center"> <img src="https://img.shields.io/badge/tests-Node%2018%20%7C%2020%20%7C%2022-blue.svg" alt="Tested on Node 18, 20, 22"> <img src="https://img.shields.io/badge/package%20manager-pnpm-orange.svg?logo=pnpm&logoColor=white" alt="pnpm"> <img src="https://img.shields.io/badge/monorepo-pnpm%20workspaces-orange.svg" alt="pnpm Workspaces"> </p>
TestRail MCP Server
A Model Context Protocol (MCP) server for TestRail that enables AI assistants (GitHub Copilot, Claude, etc.) to interact with TestRail's test management platform directly from the IDE.
Features
- 27 MCP Tools — Query and manage projects, test cases, runs, results, plans, milestones, and more
- Read & Write — Browse test data and submit results, create runs and cases
- Smart Formatting — AI-friendly output with status summaries, pagination info, and truncation
- Rate Limit Resilient — Automatic retry with exponential backoff on 429 responses
- Reference Data Caching — Statuses, priorities, case types cached for 5 minutes
- VS Code Extension — Self-contained VSIX with bundled server
Quick Start
VS Code Extension
Install VS Code extension TestRail MCP Server VS Code extension that one by fazorboy .
Configuration
| Setting (VS Code) | Env Var | Required | Default | Description |
|---|---|---|---|---|
testrailMcp.apiKey |
TESTRAIL_API_KEY |
Yes | — | TestRail API key (generate at My Settings > API Keys) |
testrailMcp.baseUrl |
TESTRAIL_BASE_URL |
Yes | — | TestRail instance URL (e.g., https://company.testrail.io) |
testrailMcp.username |
TESTRAIL_USERNAME |
Yes | — | TestRail username (email address) |
testrailMcp.projectId |
TESTRAIL_PROJECT_ID |
Yes | — | Default project ID (used when not specified in tool params) |
testrailMcp.timeout |
TESTRAIL_TIMEOUT_MS |
No | 30000 |
HTTP request timeout in milliseconds |
testrailMcp.maxResults |
TESTRAIL_MAX_RESULTS |
No | 250 |
Default page size for list queries (max 250) |
testrailMcp.cacheEnabled |
TESTRAIL_CACHE_ENABLED |
No | true |
Enable disk caching for semi-static TestRail data |
testrailMcp.cacheTtlHours |
TESTRAIL_CACHE_TTL_HOURS |
No | 168 (7 days) |
Cache time-to-live in hours |
testrailMcp.cacheDir |
TESTRAIL_CACHE_DIR |
No | ~/.testrail-mcp-cache |
Directory for disk cache files |
Standalone (stdio transport)
# Install
npm install -g @fazorboy/testrail-mcp-server
# Configure
export TESTRAIL_BASE_URL="https://your-instance.testrail.io"
export TESTRAIL_USERNAME="your-email@example.com"
export TESTRAIL_API_KEY="your-api-key"
export TESTRAIL_PROJECT_ID="1"
# Run
testrail-mcp-server
Claude Desktop / MCP Client
Add to your MCP client config:
{
"mcpServers": {
"testrail": {
"command": "npx",
"args": ["testrail-mcp-server"],
"env": {
"TESTRAIL_BASE_URL": "https://your-instance.testrail.io",
"TESTRAIL_USERNAME": "your-email@example.com",
"TESTRAIL_API_KEY": "your-api-key",
"TESTRAIL_PROJECT_ID": "1"
}
}
}
}
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
TESTRAIL_BASE_URL |
Yes | — | TestRail instance URL |
TESTRAIL_USERNAME |
Yes | — | TestRail username (email) |
TESTRAIL_API_KEY |
Yes | — | TestRail API key |
TESTRAIL_PROJECT_ID |
Yes | — | Default project ID (tools auto-use this when project_id is omitted) |
TESTRAIL_TIMEOUT_MS |
No | 30000 |
HTTP request timeout |
TESTRAIL_MAX_RESULTS |
No | 250 |
Default page size (max 250) |
Available Tools
Read-Only (21 tools)
| Tool | Description |
|---|---|
get_projects |
List all projects |
get_project |
Get project details |
get_cases |
List test cases (filterable by suite, section, priority, type) |
get_case |
Get case details with steps |
find_cases_by_path |
Find test cases by suite name + section path (resolves IDs automatically) |
get_runs |
List test runs |
get_run |
Get run details with status counts |
get_results_for_run |
Get results for a run |
get_results_for_case |
Get result history for a case in a run |
get_tests |
List tests in a run |
get_plans |
List test plans |
get_plan |
Get plan details with entries |
get_milestones |
List milestones |
get_statuses |
Get available statuses |
get_priorities |
Get priorities |
get_case_types |
Get case types |
get_case_fields |
Get case custom fields |
get_result_fields |
Get result custom fields |
get_templates |
Get case templates |
get_users |
List users |
get_suites |
List test suites |
get_sections |
List sections (folder tree) |
Write (6 tools)
| Tool | Description |
|---|---|
add_result_for_case |
Submit a test result |
add_results_for_cases |
Bulk submit results |
add_run |
Create a test run |
close_run |
Close/archive a run |
add_case |
Create a test case |
update_case |
Update a test case |
Resources
| URI | Description |
|---|---|
testrail://health |
Server health check |
testrail://project/{id}/summary |
Project dashboard |
Prompts
The server includes built-in prompts that guide the AI through multi-step workflows:
| Prompt | Description |
|---|---|
find_test_cases |
Navigate TestRail hierarchy (Project > Suite > Section) to find cases |
test_run_summary |
Get comprehensive run summary with failure analysis |
project_overview |
Full project dashboard with suites, runs, milestones |
submit_test_results |
Submit results for multiple cases in a run |
Example Prompts
Here are example natural-language prompts you can use with any MCP-compatible AI assistant:
Browsing & Discovery
Show me all active test runs in my project
List all test suites and their sections
Get all test cases in the "Smoke Tests" section
What milestones are coming up?
Show me the section tree for suite "Regression"
Finding Test Cases by Path
Find test cases in suite "xyz", section "AbC > subsection DEF"
List cases in suite "Regression" section "Smoke Tests > Login"
The AI will call find_cases_by_path which resolves the entire path in one step:
- Finds the suite by name
- Traverses the section hierarchy to match the path
- Returns all cases with IDs, titles, and priorities
You can also be explicit about the project:
Find test cases in project 18, suite "xyz", section "ABC > subsection DEF > subsection PQR"
Analyzing Runs & Results
Summarize test run 1234 — what's passing and failing?
Show me all failed tests in run 1234 with their error messages
Get the result history for case C5678 in run 1234
Compare pass rates across all active runs
Submitting Results
Mark cases C101, C102, C103 as passed in run 1234
Create a new test run called "Sprint 15 Smoke" with cases C101-C110
Submit results: C101=passed, C102=failed (login timeout), C103=blocked
Project Management
Give me an overview of project 1 — suites, active runs, milestones
What test plans are currently active?
List all users who can be assigned tests
What custom case fields and statuses are available?
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。