Connect AI assistants to TestRail: manage test cases, suites, runs, results, and attachments.
Model Context Protocol (MCP) server for the TestRail platform that enables LLMs to manage test artifacts. It connects AI assistants (Claude, Cursor, Windsurf, and others) to TestRail for operating on projects, test cases, and test runs via natural-language conversation.
๐ ๏ธ Key Features
Manage TestRail projects
Search and create test cases
Kick off test runs
Record test results
Attach files
๐ Use Cases
AI-assisted QA workflows that manage TestRail content
Creating and updating test cases through conversational queries
Running test executions and recording outcomes in TestRail
Attaching artifacts to test-related records
โก Developer Benefits
Integration with MCP-based AI assistants
Natural-language control for QA and test automation tasks
Centralized interaction with TestRail resources (projects, cases, runs, results, files)
โ ๏ธ Limitations
Source excerpt does not specify authentication, supported TestRail versions, rate limits, or tool coverage beyond the listed capabilities.
An open-source Model Context Protocol (MCP) server that connects Claude, Cursor, Windsurf, and other AI assistants directly to TestRail.
Manage TestRail projects, search and create test cases, kick off test runs, record results, and attach files โ all through natural-language conversation with your AI assistant. Built for QA engineers and AI-assisted test automation.
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.
NOTE
Compatibility Baseline: The primary baseline version this MCP server is tested and validated against is TestRail 10.6.2 (API v2). Older TestRail instances (including pre-7.x pagination) are also supported via built-in backward compatibility.
โจ 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).
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."
๐ฅ๏ธ 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 (0 on success, 1 on error).
Pipeline-Native Output: Emits clean JSON to stdout for piping into tools like jq, while diagnostics and errors go to stderr.
Zero Duplication: Reuses the exact same API client, retry logic, and validation schemas as the MCP server.
Invocation Methods
bash
# 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)
bash
# 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 1
Export Cases for Knowledge Base / RAG (export_cases_for_rag)
bash
# 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_exports
Command Discovery & Flag Documentation
bash
# 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 --help
npx @uarlouski/testrail-mcp-server cli export_cases_for_rag --help
โ๏ธ Environment Variables & Security Controls
Variable
Description
Required
Default
TESTRAIL_INSTANCE_URL
Your TestRail instance URL (e.g., https://example.testrail.io)
Set to true to enable Shared Steps management tools
false
TESTRAIL_ENABLE_CASE_HISTORY
Set to true to enable Case History and revision tracking tools
false
TESTRAIL_ENABLE_RAG_TOOLS
Set to true to enable experimental Knowledge Base / RAG export tools (export_cases_for_rag). Subject to breaking API changes.
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
TESTRAIL_ENABLE_DEPRECATED_TOOLS
Enable deprecated tools for backward compatibility. Set to false to reduce context token overhead.
true
TESTRAIL_DISABLED_TOOLS
Comma-separated list of specific tool names to disable (e.g., mutate_suite,delete_entity). Fails if invalid tool names are specified.
-
โ ๏ธ Deprecation Lifecycle & Features Scheduled for Removal
To ensure smooth transitions, deprecated tools remain available by default (TESTRAIL_ENABLE_DEPRECATED_TOOLS=true) and will be removed in future major releases:
Deprecated in 2.3.0, scheduled for removal in 3.0.0
get_sections
query_section (action: "many")
Deprecated in 2.8.0, scheduled for removal in 3.0.0
๐ก Token Tip: If you are not using legacy tools, set TESTRAIL_ENABLE_DEPRECATED_TOOLS=false in your environment to eliminate deprecated tool definitions from the LLM prompt and save tokens!
๐ Documentation & Complete Tool Reference
For a comprehensive guide, detailed configuration options, and a complete breakdown of all available tools, please visit our official documentation site: