TestRail MCP Server
Enables comprehensive interaction with TestRail's API for managing test projects, suites, cases, runs, plans, results, milestones, attachments, and user management. Supports full test lifecycle operations including creating/updating test cases, executing test runs, adding results, and managing test plans.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TestRail MCP Server show me the test cases for project 123 in the regression suite"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TestRail MCP Server
A Model Context Protocol (MCP) server for seamless TestRail integration. This server enables AI assistants like Claude, Cursor, and other MCP-compatible clients to interact directly with your TestRail instance.
Features
🔐 Secure Authentication - API key-based authentication with TestRail
📊 Full TestRail API Coverage - Support for TestRail API v9.7.2
🚀 Easy Integration - Works with Cursor, Claude Desktop, and other MCP clients
📦 Zero Configuration - Run directly with
npx
Related MCP server: TestRail MCP Server
Installation
Global Installation
npm i -g @tenbarrel6/testrail-mcpLocal Installation
npm i @tenbarrel6/testrail-mcpUsing npx
No installation required - run directly in downloaded github repository:
npx @tenbarrel6/testrail-mcpConfiguration
Environment Variables
Create a .env file in your project root or set environment variables:
TESTRAIL_URL=https://your-domain.testrail.io
TESTRAIL_USERNAME=your-email@example.com
TESTRAIL_API_KEY=your-api-key-hereCursor IDE Configuration
Add to your Cursor settings (.cursor/mcp.json or global settings):
{
"mcpServers": {
"testrail": {
"command": "npx",
"args": ["-y", "@tenbarrel6/testrail-mcp"],
"env": {
"TESTRAIL_URL": "https://your-company.testrail.io",
"TESTRAIL_USERNAME": "your-email@company.com",
"TESTRAIL_API_KEY": "your-api-key-here"
}
}
}
}Claude Desktop Configuration
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"testrail": {
"command": "npx",
"args": ["-y", "@tenbarrel6/testrail-mcp"],
"env": {
"TESTRAIL_URL": "https://your-company.testrail.io",
"TESTRAIL_USERNAME": "your-email@company.com",
"TESTRAIL_API_KEY": "your-api-key-here"
}
}
}
}Getting Your TestRail API Key
Log in to your TestRail instance
Go to My Settings (click your name in the top right)
Navigate to the API Keys tab
Click Add Key to generate a new API key
Copy and save the key securely
Available Tools
Projects
Tool | Description |
| Get all TestRail projects |
| Get a specific project by ID |
Test Suites
Tool | Description |
| Get all test suites for a project |
| Get a specific test suite by ID |
| Create a new test suite |
| Update an existing test suite |
Sections
Tool | Description |
| Get all sections for a project/suite |
| Get a specific section by ID |
| Create a new section |
| Update an existing section |
| Delete a section |
| Move a section to another parent or position |
Test Cases
Tool | Description |
| Get test cases for a project/suite |
| Get a specific test case by ID |
| Create a new test case |
| Update an existing test case |
| Delete a test case |
| Delete multiple test cases |
| Copy test cases to another section |
| Move test cases to another section |
| Get all available test case types |
| Get all available test case fields |
| Get the edit history for a test case |
Test Runs
Tool | Description |
| Get test runs for a project |
| Get a specific test run by ID |
| Create a new test run |
| Update an existing test run |
| Close a test run |
| Delete a test run |
Tests
Tool | Description |
| Get tests for a test run |
| Get a specific test by ID |
Results
Tool | Description |
| Get results for a test |
| Get results for a test case in a run |
| Get all results for a test run |
| Add a test result |
| Add a test result for a specific case in a run |
| Add multiple test results by test IDs |
| Add multiple test results for cases in a run |
Test Plans
Tool | Description |
| Get test plans for a project |
| Get a specific test plan by ID |
| Create a new test plan |
| Update an existing test plan |
| Close a test plan |
| Delete a test plan |
| Add test runs to a test plan |
| Update a test plan entry |
| Delete a test plan entry |
| Add a test run to an existing plan entry |
| Update a test run inside a plan entry |
| Delete a test run from a plan entry |
Milestones
Tool | Description |
| Get milestones for a project |
| Get a specific milestone by ID |
| Create a new milestone |
| Update an existing milestone |
| Delete a milestone |
Users
Tool | Description |
| Get all users (optionally filtered by project) |
| Get a user by ID |
| Get a user by email address |
| Get the current authenticated user |
Statuses & Priorities
Tool | Description |
| Get all available test result statuses |
| Get all available test case statuses (Enterprise) |
| Get all available test case priorities |
Templates & Configurations
Tool | Description |
| Get all templates for a project |
| Get all configurations for a project |
| Get all available result custom fields |
Attachments
Tool | Description |
| Add an attachment to a test case |
| Add an attachment to a test result |
| Add an attachment to a test run |
| Add an attachment to a test plan |
| Add an attachment to a test plan entry |
| Get/download an attachment by ID |
| Get all attachments for a test case |
| Get all attachments for a test |
| Get all attachments for a test run |
| Get all attachments for a test plan |
| Get all attachments for a test plan entry |
| Delete an attachment |
Usage Examples
Once configured, you can interact with TestRail through your AI assistant:
Get all projects
"List all TestRail projects"Create a test case
"Create a new test case in section 123 with title 'Verify login functionality'"Add test results
"Add a passed result for test case 456 in run 789 with comment 'All checks passed'"Get test run results
"Show me all results for test run 101"Test Result Status IDs
When adding results, use these standard status IDs:
Status ID | Status |
1 | Passed |
2 | Blocked |
3 | Untested |
4 | Retest |
5 | Failed |
Development
Building from Source
# Clone the repository
git clone https://github.com/TenBarrel6/testrail-mcp.git
cd testrail-mcp
# Install dependencies
npm install
# Build
npm run build
# Run in development mode
npm run devScripts
npm run build- Compile TypeScript to JavaScriptnpm run start- Run the compiled servernpm run dev- Run in development mode with hot reload
Requirements
Node.js 18+
TestRail instance with API access enabled
Valid TestRail API key
Troubleshooting
"Not authenticated" Error
Ensure your environment variables are correctly set:
TESTRAIL_URLshould include the protocol (https://)TESTRAIL_USERNAMEshould be your email addressTESTRAIL_API_KEYshould be a valid API key (not your password)
Connection Issues
Verify your TestRail URL is accessible
Check if API access is enabled in your TestRail administration settings
Ensure your user has appropriate permissions
MCP Client Not Connecting
Restart your MCP client (Cursor/Claude Desktop)
Verify the configuration JSON syntax is valid
Check that
npxis available in your PATH
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Ruslan Sapun
GitHub: @TenBarrel6
Links
Available Tools
77 toolsadd_attachment_to_caseC
Add an attachment to a test case
Inputs: case_id (required), file_path (required).
add_attachment_to_planC
Add an attachment to a test plan
Inputs: plan_id (required), file_path (required).
add_attachment_to_plan_entryC
Add an attachment to a test plan entry
Inputs: plan_id (required), entry_id (required), file_path (required).
add_attachment_to_resultC
Add an attachment to a test result
Inputs: result_id (required), file_path (required).
add_attachment_to_runC
Add an attachment to a test run
Inputs: run_id (required), file_path (required).
add_caseC
Create a new test case
Inputs: section_id (required), title (required), template_id, type_id, +9 more.
add_milestoneC
Create a new milestone
Inputs: project_id (required), name (required), description, due_on, +3 more.
add_planC
Create a new test plan
Inputs: project_id (required), name (required), description, milestone_id, +1 more.
add_plan_entryC
Add test runs to a test plan
Inputs: plan_id (required), suite_id (required), name, description, +6 more.
add_resultC
Add a test result
Inputs: test_id (required), status_id (required), comment, elapsed, +1 more.
add_result_for_caseB
Add a test result for a specific case in a run
Inputs: run_id (required), case_id (required), status_id (required), comment, +1 more.
add_resultsC
Add multiple test results by test IDs
Inputs: run_id (required), results (required).
add_results_for_casesB
Add multiple test results for cases in a run
Inputs: run_id (required), results (required).
add_runB
Create a new test run
Inputs: project_id (required), name (required), suite_id, description, +4 more.
add_run_to_plan_entryC
Add a test run to an existing plan entry
Inputs: plan_id (required), entry_id (required), config_ids (required), description, +4 more.
add_sectionC
Create a new section
Inputs: project_id (required), name (required), suite_id, parent_id, +1 more.
add_suiteB
Create a new test suite
Inputs: project_id (required), name (required), description.
close_planC
Close a test plan
Inputs: plan_id (required).
close_runB
Close a test run
Inputs: run_id (required).
copy_cases_to_sectionC
Copy test cases to another section
Inputs: section_id (required), case_ids (required).
delete_attachmentC
Delete an attachment
Inputs: attachment_id (required).
delete_caseB
Delete a test case
Inputs: case_id (required).
delete_casesC
Delete multiple test cases
Inputs: project_id (required), case_ids (required), suite_id, soft.
delete_milestoneC
Delete a milestone
Inputs: milestone_id (required).
delete_planC
Delete a test plan
Inputs: plan_id (required).
delete_plan_entryC
Delete a test plan entry
Inputs: plan_id (required), entry_id (required).
delete_runC
Delete a test run
Inputs: run_id (required), soft.
delete_run_from_plan_entryC
Delete a test run from a plan entry
Inputs: run_id (required).
delete_sectionC
Delete a section
Inputs: section_id (required).
get_attachmentC
Get/download an attachment by ID
Inputs: attachment_id (required).
get_attachments_for_caseC
Get all attachments for a test case
Inputs: case_id (required), limit, offset.
get_attachments_for_planC
Get all attachments for a test plan
Inputs: plan_id (required), limit, offset.
get_attachments_for_plan_entryC
Get all attachments for a test plan entry
Inputs: plan_id (required), entry_id (required).
get_attachments_for_runB
Get all attachments for a test run
Inputs: run_id (required), limit, offset.
get_attachments_for_testC
Get all attachments for a test
Inputs: test_id (required).
get_caseB
Get a specific test case by ID
Inputs: case_id (required).
get_case_fieldsA
Get all available test case fields
Inputs: no named parameters.
get_casesB
Get test cases for a project/suite
Inputs: project_id (required), suite_id, section_id.
get_case_statusesB
Get all available test case statuses (Enterprise)
Inputs: no named parameters.
get_case_typesB
Get all available test case types
Inputs: no named parameters.
get_configsC
Get all configurations for a project
Inputs: project_id (required).
get_current_userB
Get the current authenticated user
Inputs: no named parameters.
get_history_for_caseC
Get the edit history for a test case
Inputs: case_id (required), limit, offset.
get_milestoneA
Get a specific milestone by ID
Inputs: milestone_id (required).
get_milestonesB
Get milestones for a project
Inputs: project_id (required).
get_planC
Get a specific test plan by ID
Inputs: plan_id (required).
get_plansC
Get test plans for a project
Inputs: project_id (required).
get_prioritiesB
Get all available test case priorities
Inputs: no named parameters.
get_projectB
Get a specific project by ID
Inputs: project_id (required).
get_projectsB
Get all TestRail projects
Inputs: no named parameters.
get_result_fieldsB
Get all available result custom fields
Inputs: no named parameters.
get_resultsC
Get results for a test
Inputs: test_id (required).
get_results_for_caseB
Get results for a test case in a run
Inputs: run_id (required), case_id (required).
get_results_for_runC
Get results for a test run
Inputs: run_id (required).
get_runB
Get a specific test run by ID
Inputs: run_id (required).
get_runsB
Get test runs for a project
Inputs: project_id (required).
get_sectionA
Get a specific section by ID
Inputs: section_id (required).
get_sectionsB
Get all sections for a project/suite
Inputs: project_id (required), suite_id.
get_statusesB
Get all available test result statuses
Inputs: no named parameters.
get_suiteA
Get a specific test suite by ID
Inputs: suite_id (required).
get_suitesB
Get all test suites for a project
Inputs: project_id (required).
get_templatesC
Get all templates for a project
Inputs: project_id (required).
get_testB
Get a specific test by ID
Inputs: test_id (required).
get_testsC
Get tests for a test run
Inputs: run_id (required).
get_userC
Get a user by ID
Inputs: user_id (required).
get_user_by_emailB
Get a user by email address
Inputs: email (required).
get_usersC
Get all users (optionally filtered by project)
Inputs: project_id.
move_cases_to_sectionC
Move test cases to another section
Inputs: section_id (required), suite_id (required), case_ids (required).
move_sectionC
Move a section to another parent or position
Inputs: section_id (required), parent_id, after_id.
update_caseC
Update an existing test case
Inputs: case_id (required), title, template_id, type_id, +7 more.
update_milestoneC
Update an existing milestone
Inputs: milestone_id (required), name, description, due_on, +4 more.
update_planC
Update an existing test plan
Inputs: plan_id (required), name, description, milestone_id.
update_plan_entryC
Update a test plan entry
Inputs: plan_id (required), entry_id (required), name, description, +4 more.
update_runC
Update an existing test run
Inputs: run_id (required), name, description, milestone_id.
update_run_in_plan_entryC
Update a test run inside a plan entry
Inputs: run_id (required), description, assignedto_id, include_all, +2 more.
update_sectionC
Update an existing section
Inputs: section_id (required), name, description.
update_suiteB
Update an existing test suite
Inputs: suite_id (required), name, description.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 77 tools
Most tools have distinct purposes targeting specific resources and actions, but there is some overlap that could cause confusion. For example, 'add_result' and 'add_result_for_case' are similar, and multiple attachment tools for different resources might be misselected if the agent isn't careful about the target entity.
Tool names follow a highly consistent verb_noun pattern throughout, with clear actions like add, get, delete, update, copy, move, and close applied to specific nouns. This predictability makes it easy for agents to understand and navigate the toolset.
With 77 tools, the count is excessive for typical MCP server purposes, making it overwhelming and difficult to manage. This large number suggests over-fragmentation of operations that could have been consolidated, such as multiple attachment tools for different resources.
The toolset provides comprehensive CRUD and lifecycle coverage for TestRail's domain, including projects, suites, cases, runs, plans, results, attachments, and users. There are no obvious gaps, with tools for creation, retrieval, updates, deletions, and specialized operations like moving or copying cases.
Related MCP Connectors
Create and manage test cases, test runs and results in Testiny from your AI assistant.
Test management for AI agents: cases, runs, results, cycles and traceability.
Direct access to Cypress tests results and accessibility reports in your AI workflow.
Manage test suites, run tests, view results, and automate QA workflows via AI with testRigor.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to interact with TestRail test management systems through comprehensive API integration. Supports retrieving and updating test cases, projects, suites, runs, and results, plus adding attachments and managing test data through natural language commands.1840 npmMIT
- AlicenseAqualityFmaintenanceEnables management of TestRail projects, test cases, runs, and results directly through MCP-supported clients. It provides a comprehensive set of tools to interact with the TestRail API for seamless test cycle management within AI environments.426,221 npm42MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to interact with TestRail test management system, supporting full CRUD operations on projects, suites, sections, test cases, runs, results, plans, and milestones.35276 npm1MIT
- 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