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.
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
Installation
Using npx (Recommended)
No installation required - run directly:
Global Installation
Local Installation
Configuration
Environment Variables
Create a .env file in your project root or set environment variables:
Cursor IDE Configuration
Add to your Cursor settings (.cursor/mcp.json or global settings):
Claude Desktop Configuration
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
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
Create a test case
Add test results
Get test run results
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
Scripts
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