TestRail MCP Server
You can manage TestRail projects, test cases, runs, results, attachments, and metadata through AI assistants or CLI automation.
Discover & navigate: list projects, suites, sections, and users (
query_project,query_suite,mutate_suite,query_section,mutate_section,get_users)Manage test cases: retrieve, create, update, bulk-update, resolve custom fields, and export cases for RAG (
get_case,get_cases,add_case,update_case,update_cases,get_case_fields,resolve_case_field,export_cases_for_rag)Execute & track: create/update test runs, fetch tests, and add results by
test_idorcase_id(mutate_run,query_run,get_tests,add_results,add_results_for_cases,get_results)Handle attachments: upload files/directories (auto-zipped) and download or list attachments (
add_attachment,query_attachment)Retrieve metadata: get configurations, labels, priorities, statuses, and templates (
get_configurations,get_labels,get_priorities,get_statuses,get_templates)Control access: read/write/delete operations are permission-gated with per-tool allowlisting
Manages TestRail projects, tests cases, test runs, and results, enabling AI assistants to search, create, update test cases, kick off test runs, record results, and attach files through natural-language conversation.
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.
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.
Related MCP server: TestRail MCP Server
Table of contents
✨ 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 |
🧠 Context-Aware AI | Dynamically exposes templates, fields, priorities, and statuses so LLMs generate valid, structured data. |
🖥️ CLI & CI/CD Native | Run every tool from bash, GitHub Actions, GitLab CI, or Jenkins with zero LLM overhead. |
🔐 Least-Privilege Controls | Per-mode permissions plus per-tool allowlisting; destructive deletes are off by default. |
🚀 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:
{
"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 → MCP → Add new MCP server, or edit .cursor/mcp.json in your project (~/.cursor/mcp.json for all projects):
{
"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"
}
}
}
}Edit ~/.codeium/windsurf/mcp_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"
}
}
}
}Add to .vscode/mcp.json. The inputs block keeps your API key out of the file:
{
"inputs": [
{
"id": "testrail-api-key",
"type": "promptString",
"description": "TestRail API key",
"password": true
}
],
"servers": {
"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": "${input:testrail-api-key}"
}
}
}
}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
# Method 1: Direct npx subcommand (Recommended)
npx @uarlouski/testrail-mcp-server cli <command> [flags]
# Method 2: Global or local binary
testrail-cli <command> [flags]
# Method 3: Via package runner
npx -p @uarlouski/testrail-mcp-server testrail-cli <command> [flags]Examples
Query projects (query_project)
# List all active projects
npx @uarlouski/testrail-mcp-server cli query_project --action many
# Query a single project by ID
npx @uarlouski/testrail-mcp-server cli query_project --action one --project_id 1Report automated test results (add_results_for_cases)
# Submit results by case_id — what your test framework already knows
npx @uarlouski/testrail-mcp-server cli add_results_for_cases \
--run_id 88 \
--results '[{"case_id":1042,"status_id":1,"comment":"Passed in CI"}]'Export cases for knowledge base / RAG (export_cases_for_rag)
# Export all cases for a project into Markdown & metadata sidecars
npx @uarlouski/testrail-mcp-server cli export_cases_for_rag \
--project_id 1 \
--output_dir ./rag_exports
# Export specific cases by ID (comma-separated list)
npx @uarlouski/testrail-mcp-server cli export_cases_for_rag \
--case_ids C101,C102,103 \
--output_dir ./rag_exportsCommand discovery & flag documentation
# List all available commands
npx @uarlouski/testrail-mcp-server cli --help
# Show parameter options for a specific tool
npx @uarlouski/testrail-mcp-server cli query_project --helpSee the CLI & CI/CD guide for complete GitHub Actions, GitLab CI, and Jenkins workflows.
⚙️ Environment Variables & Security Controls
Variable | Description | Required | Default |
| Your TestRail instance URL (e.g., | ✅ | |
| Your TestRail user email address | ✅ | |
| Your TestRail API key (Guide) | ✅ | |
| Set to |
| |
| Set to |
| |
| Set to |
| |
| Allow write operations (e.g. adding/updating test cases, test runs, sections) |
| |
| Allow read operations (e.g. retrieving projects, test cases, templates) |
| |
| Allow delete operations (e.g. deleting cases or shared steps). Enabled strictly via |
| |
| Preserved for backward compatibility with existing host configurations. |
| |
| Comma-separated list of specific tool names to disable (e.g., | - |
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).
Area | Tools | Reference |
Discovery & Navigation |
| |
Test Case Management |
| |
Execution & Tracking |
| |
Attachments & Media |
| |
Shared Steps |
| |
System Metadata |
| |
Deletion |
|
❓ Frequently Asked Questions
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.
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.
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.
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.
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.
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.
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.
Available Tools
27 toolsadd_attachmentA
Add an attachment to a test case, test run, or test result in TestRail. If the file_path points to a directory, it will be automatically zipped before uploading. Maximum upload size is 256MB.
Inputs: entity_id (required), file_path (required), entity_type (required).
add_caseA
Create a new test case in TestRail. The create operation requires knowing valid field names that are returned by get_case_fields tool.
Inputs: title (required), section_id (required), fields.
add_resultsC
Add one or more test results to a test run
Inputs: run_id (required), results (required).
add_results_for_casesB
Add one or more test results to a test run using case IDs instead of test IDs
Inputs: run_id (required), results (required).
get_caseBRead-onlyIdempotent
Get detailed information about a test case including its custom fields
Inputs: case_id (required).
get_case_fieldsARead-onlyIdempotent
Get the field schema for test cases for a specific project. You should normally provide project_id to get fields applicable to your project. If you truly need all fields across all projects, you may omit project_id, but this is rarely what you want. Returns available fields with their types and options (for dropdown fields).
Inputs: project_id.
get_casesARead-onlyIdempotent
Get all test cases for a project. Filter by section, API params (priority, type), or any field including custom fields via 'where'. Returns case IDs, titles, and any additional requested fields.
Inputs: project_id (required), where, fields, filter, +3 more.
get_configurationsARead-onlyIdempotent
Get all configuration groups and configurations for a project in TestRail.
Inputs: project_id (required).
get_labelsARead-onlyIdempotent
Get all available test case labels (sometimes called tags) for a project. Returns label IDs and names that can be used when creating or updating test cases.
Inputs: project_id (required).
get_prioritiesARead-onlyIdempotent
Get all available test case priorities (e.g. Critical, High, Medium, Low). Returns priority IDs and names that can be used when creating or updating test cases.
Inputs: no named parameters.
get_resultsCRead-onlyIdempotent
Get results for a specific test in TestRail.
Inputs: test_id (required).
get_statusesARead-onlyIdempotent
Get all available test statuses (e.g. Passed, Failed, Blocked). Returns status IDs and names that can be used with add_result and get_tests
Inputs: no named parameters.
get_templatesARead-onlyIdempotent
Get available test case templates for a project. Template IDs determine which fields are available when creating or updating test cases
Inputs: project_id (required).
get_testsARead-onlyIdempotent
Get tests for a test run, optionally filtered by status (Deprecated: use query_test with action 'many' instead)
Inputs: run_id (required), status_id.
get_usersARead-onlyIdempotent
Get active users from TestRail. Resolves active users globally or per-project. If global fetch is forbidden (for non-admin accounts), falls back to merging users across all active projects so users referenced as reviewers or assignees can be resolved.
Inputs: project_id, fallback_all_projects.
mutate_runA
Create a new test run or update an existing one in TestRail. Set payload.action to 'create' or 'update' to specify the operation.
Inputs: payload (required).
mutate_sectionA
Create a new section or update an existing section in TestRail. Set payload.action to 'create' or 'update' to specify the operation.
Inputs: payload (required).
mutate_suiteB
Create a new test suite or update an existing one in TestRail. Set payload.action to 'create' or 'update' to specify the operation.
Inputs: payload (required).
query_attachmentARead-onlyIdempotent
Download a single attachment or list all attachments for a test case or test run in TestRail. Set payload.action to 'one' or 'many' to specify the operation.
Inputs: payload (required).
query_projectARead-onlyIdempotent
Retrieve a single project or all projects in TestRail. Set payload.action to 'one' or 'many' to specify the operation.
Inputs: payload (required).
query_runARead-onlyIdempotent
Retrieve a single test run or all test runs for a project in TestRail. Set payload.action to 'one' or 'many' to specify the operation.
Inputs: payload (required).
query_sectionBRead-onlyIdempotent
Retrieve a single section or all sections for a project in TestRail. Set payload.action to 'one' or 'many' to specify the operation.
Inputs: payload (required).
query_suiteBRead-onlyIdempotent
Retrieve a single test suite or all test suites for a project in TestRail. Set payload.action to 'one' or 'many' to specify the operation.
Inputs: payload (required).
query_testBRead-onlyIdempotent
Retrieve a single test by ID or all tests for a test run in TestRail. Set payload.action to 'one' or 'many' to specify the operation.
Inputs: payload (required).
resolve_case_fieldARead-onlyIdempotent
Resolve numeric reference IDs of a Multi-select case field (type ID 12) into their textual values for a specific project.
Inputs: refs (required), field_name (required), project_id (required).
update_caseA
Update a test case in TestRail. The update operation requires knowing valid field names that are returned by get_case_fields tool. Supports partial updates — only specify the fields you want to change.
Inputs: fields (required), case_id (required).
update_casesA
Bulk update multiple test cases with the same field values. The update operation requires knowing valid field names that are returned by get_case_fields tool. More efficient than calling update_case multiple times.
Inputs: fields (required), case_ids (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Most tools target clearly distinct resources and actions (query vs mutate vs case/result operations). However, get_tests is explicitly deprecated in favor of query_test, creating a duplicate path, and add_results vs add_results_for_cases are similar enough to require careful selection.
There are three parallel naming schemes: query_/mutate_ with action payloads for resources, get_/add_/update_ for cases and results, and get_ for reference data. Each is readable, but the mixed verb conventions for similar operations make the set less predictable.
27 tools is on the heavy side for an MCP server, though TestRail is a broad domain with many entities. The count is inflated by a deprecated duplicate (get_tests) and multiple result-adding variants, so some consolidation would help.
Read and write coverage is strong across projects, suites, sections, cases, runs, tests, results, attachments, and reference data. However, delete operations are absent across nearly all resources, and project mutation (create/update/delete) is missing, leaving notable lifecycle gaps.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Run, debug, and triage tests from your IDE using natural language, no dashboard switching, no manual data transfers. The TestMu AI (formerly LambdaTest) MCP Server is a single remote server exposing four tool suites: HyperExecute — analyze your project, generate YAML configs and test runner commands, then monitor jobs and sessions. Automation — pull a TestID's details plus command, network, and console logs into one chat for instant root-cause analysis. Includes mobile app upload. SmartUI — explain pixel, layout, DOM, and perceptual changes in a visual regression run, with context-aware React/HTML/CSS fixes. Accessibility — audit any public URL or a local React app against WCAG and get ready-to-apply remediation steps. Connects over https://mcp.lambdatest.com/mcp using OAuth 2.1 — no API keys in your config. One-click install in Cursor; works with Claude, GitHub Copilot, Cline, and any MCP client. Tests execute on the TestMu AI cloud: 3,000+ browsers and 10,000+ real devices.
Official MCP server for Qase — manage test cases, runs, suites, defects via AI tools.
AI-native mock API server with MCP. Create REST/SOAP mocks from Claude, Cursor, or Windsurf.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that allows interaction with TestRail's core entities (projects, cases, runs, results, datasets) through a standardized protocol compatible with MCP clients like Claude Desktop.2320MIT
- FlicenseNot gradedqualityNot gradedmaintenanceA Model Context Protocol server that provides integration with TestRail, allowing AI assistants to interact with TestRail projects, test cases, test runs, and results.276 npm1-
- AlicenseNot gradedqualityDmaintenanceMCP 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.MIT
- AlicenseCqualityDmaintenanceMCP server for TestRail API, providing AI assistants with 107 tools to manage test cases, runs, results, plans, and more. Supports API key, password, and SSO cookie authentication.5417 npm2MIT