Labsco
uarlouski logo

TestRail MCP Server

β˜… 26

from uarlouski

AI-native MCP server connecting Claude, Cursor, Windsurf, and other AI assistants to TestRail β€” manage test cases, runs, and results through natural-language conversation, with typed schemas built for LLMs.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredNeeds API keys
<div align="center"> <h1>πŸš€ TestRail MCP Server</h1> <p> <strong>An open-source Model Context Protocol (MCP) server that connects Claude, Cursor, Windsurf, and other AI assistants directly to TestRail.</strong> </p> <p> 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. </p> </div> <p align="center"> <a href="https://www.npmjs.com/package/@uarlouski/testrail-mcp-server"><img src="https://badge.fury.io/js/@uarlouski%2Ftestrail-mcp-server.svg" alt="npm version"></a> <a href="https://www.npmjs.com/package/@uarlouski/testrail-mcp-server"><img src="https://img.shields.io/npm/dm/@uarlouski/testrail-mcp-server.svg" alt="npm downloads"></a> <a href="https://github.com/uarlouski/testrail-mcp-server/actions/workflows/ci.yml"><img src="https://github.com/uarlouski/testrail-mcp-server/actions/workflows/ci.yml/badge.svg" alt="CI Status"></a> <a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" alt="License"></a> <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.9-blue.svg" alt="TypeScript"></a> <a href="https://github.com/uarlouski/testrail-mcp-server"><img src="https://img.shields.io/github/stars/uarlouski/testrail-mcp-server.svg?style=social&label=Star" alt="GitHub stars"></a> <a href="https://glama.ai/mcp/servers/uarlouski/testrail-mcp-server"><img src="https://glama.ai/mcp/servers/uarlouski/testrail-mcp-server/badges/score.svg" alt="Score Badge"></a> </p> <p align="center"> <strong>Compatible with:</strong> <img src="https://img.shields.io/badge/Claude%20Desktop-D97757?logo=anthropic&logoColor=white" alt="Claude Desktop"> <img src="https://img.shields.io/badge/Cursor-000000?logo=cursor&logoColor=white" alt="Cursor"> <img src="https://img.shields.io/badge/Windsurf-19A1BC?logo=codeium&logoColor=white" alt="Windsurf"> <img src="https://img.shields.io/badge/VS%20Code-007ACC?logo=visualstudiocode&logoColor=white" alt="VS Code"> </p> <!-- TODO: insert demo.gif β€” short screencast of asking "create a test case" in Claude or Cursor and seeing the case appear in TestRail -->

🌟 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

CapabilityDescription
πŸ” Intelligent DiscoveryBrowse projects, test suites, and sections to automatically map your QA organization.
πŸ“‹ Full Case ManagementFetch, create, update, and bulk-edit test cases with comprehensive custom field support.
▢️ Actionable ExecutionCreate test runs, update results by test_id or case_id, attach files, and track statuses.
🧠 Context-Aware AIDynamically exposes templates, fields, priorities, and statuses so LLMs generate valid, structured data.

βš™οΈ Environment Variables & Security Controls

VariableDescriptionRequiredDefault
TESTRAIL_INSTANCE_URLYour TestRail instance URL (e.g., https://example.testrail.io)βœ…
TESTRAIL_USERNAMEYour TestRail user email addressβœ…
TESTRAIL_API_KEYYour TestRail API key (Guide)βœ…
TESTRAIL_ENABLE_SHARED_STEPSSet to true to enable Shared Steps management toolsfalse
TESTRAIL_ALLOW_WRITE_OPERATIONSAllow write operations (e.g. adding/updating test cases, test runs, sections)true
TESTRAIL_ALLOW_READ_OPERATIONSAllow read operations (e.g. retrieving projects, test cases, templates)true
TESTRAIL_ALLOW_DELETE_OPERATIONSAllow 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_cases and get_sections, you can supply the output_file parameter 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_users without 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

ToolFunctionality
query_projectRetrieve a single project (action: "one") or all active projects (action: "many").
query_suiteRetrieve a single test suite (action: "one") or all test suites for a project (action: "many").
get_sectionsNavigate the precise folder/section hierarchy of any test suite.
mutate_suiteCreate a new test suite or update an existing one in TestRail.
mutate_sectionCreate a new section or update an existing section in TestRail.
get_usersRetrieve active users. Handles per-project filtering and automatic fallback polling for non-admin accounts.

πŸ“‹ Test Case Management

ToolFunctionality
get_casesQuery test cases with advanced filtering (priority, template, type, etc.) and pagination.
get_caseFetch complete, structured details of a specific test case, including custom steps and fields.
add_caseSeamlessly create a new test case equipped with robust custom field validation.
update_caseModify an existing test case's steps, metadata, or titles.
update_casesExecute bulk-updates on multiple test cases simultaneously to save time.

▢️ Test Execution & Tracking

ToolFunctionality
query_runRetrieve a single test run (action: "one") or all test runs for a project (action: "many", supporting filters).
mutate_runCreate a new test run or update an existing one in TestRail.
get_testsRetrieve individual tests for a specific test run, with optional status filtering.
get_resultsRetrieve paginated results for a specific test ID.
add_resultsSubmit test results to a test run using the specific test_id.
add_results_for_casesSubmits results to a run mapping directly to case_ids, streamlining automation workflows.
add_attachment_to_runAttach logs, files, or zipped artifacts directly to an ongoing test run.

πŸ”— Shared Steps (Optional)

ToolFunctionality
get_shared_stepsList shared test steps for a project with optional reference filtering.
get_shared_stepRetrieve precise details of a specific shared test step set.
get_shared_step_historyView the complete audit trail and version history of a shared step set.
add_shared_stepCreate a new reusable set of shared test steps.
update_shared_stepModify an existing shared step set (changes propagate to all linked test cases).

πŸ—‘οΈ Deletion

ToolFunctionality
delete_entityDeletes 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

ToolFunctionality
get_statusesSystematically list all configured test statuses (Passed, Failed, Blocked, Retest, etc.).
get_prioritiesRetrieve priority levels configured within your instance structure.
get_case_fieldsDiscover custom field definitions, formats, and UI dropdown options. Supports filtering by project_id.
get_templatesIdentify available case templates to mandate correct AI structuring.
get_configurationsRetrieve 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>