janainarocha/testrail-mcp-server
If you are the rightful owner of testrail-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A comprehensive Model Context Protocol (MCP) server for TestRail integration, enabling AI-driven test case management and execution.
TestRail MCP Server
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with TestRail for automated test case management and execution. This server provides complete TestRail REST API v2 coverage with 80 MCP tools.
🚀 Complete TestRail Integration
- ✅ 80 MCP Tools - Most comprehensive TestRail integration available
- ✅ 21 API Modules - Full TestRail REST API v2 coverage
🚀 Two Ways to Use
Option 1: Quick Setup (Recommended)
Add this to your VS Code mcp.json
file:
{
"servers": {
"testrail": {
"command": "npx",
"args": [
"-y",
"github:janainarocha/testrail-mcp-server#v1.0.0"
],
"type": "stdio",
"env": {
"TESTRAIL_URL": "https://yourcompany.testrail.io",
"TESTRAIL_USER": "your.email@company.com",
"TESTRAIL_API_KEY": "your-api-key"
}
}
}
}
That's it! Restart VS Code and use MCP commands directly.
Option 2: Local Installation
- Clone and install:
git clone https://github.com/janainarocha/testrail-mcp-server.git
cd testrail-mcp-server
npm install
npm run build
- Add to VS Code
mcp.json
with your credentials:
{
"servers": {
"testrail": {
"command": "node",
"args": [
"/path/to/testrail-mcp-server/dist/index.js"
],
"type": "stdio",
"env": {
"TESTRAIL_URL": "https://yourcompany.testrail.io",
"TESTRAIL_USER": "your.email@company.com",
"TESTRAIL_API_KEY": "your-api-key"
}
}
}
}
🔧 Setup Instructions
1. Get Your TestRail API Key
- Log in to TestRail
- Go to My Account → API Keys
- Click Add Key
- Copy the generated key
2. Configure VS Code
Add to your global VS Code MCP configuration file:
- Windows:
%APPDATA%\Code\User\mcp.json
- Mac:
~/Library/Application Support/Code/User/mcp.json
- Linux:
~/.config/Code/User/mcp.json
3. Update Configuration
Replace your.email@company.com
and your-api-key
with your actual credentials.
4. Restart VS Code
🛠️ Prerequisites
- Node.js 18+ (for local installation)
- VS Code with GitHub Copilot extension
- TestRail account with API access
- TestRail API key (get from My Settings > API Keys)
💬 Usage Examples
Get Started: TestRail Context & Capabilities
#testrail_get_capabilities
This command provides complete TestRail platform context, terminology, and all available MCP tools - perfect for AI to understand TestRail concepts and workflows.
Export Test Cases in Bulk
#testrail_bulk_export_cases project_id: 1 suite_id: 5 include_steps: true
List Projects
#testrail_list_projects
Create Test Cases
#testrail_create_test_case
title: "Test successful user authentication"
section_id: 5
custom_expected: "User should be redirected to dashboard"
priority_id: 3
Explore Structure
#testrail_get_project project_id: 1
#testrail_list_sections project_id: 1 suite_id: 2
#testrail_get_case case_id: 456
Create Sections
#testrail_add_section suite_id: 3 name: "API Tests"
🔍 Troubleshooting
Server Not Appearing
- Check VS Code
mcp.json
file location and syntax - Restart VS Code completely
- Verify GitHub Copilot extension is installed and active
Commands Not Working
- Ensure you're using GitHub Copilot Chat (not regular terminal)
- Use exact tool names (e.g.,
testrail_list_projects
) - Check VS Code output logs for detailed error messages
- Verify your TestRail permissions for the requested operation
👀 Read Operations (30+ tools)
Command | Description | Example |
---|---|---|
testrail_list_projects | List all accessible TestRail projects | #testrail_list_projects |
testrail_get_project | Get project details with suites | #testrail_get_project project_id: 5 |
testrail_get_suites | List test suites in a project | #testrail_get_suites project_id: 3 |
testrail_list_sections | List sections in a suite | #testrail_list_sections project_id: 1 suite_id: 10 |
testrail_get_cases | List test cases with advanced filtering | #testrail_get_cases project_id: 1 suite_id: 2 |
testrail_get_case | Get detailed test case information | #testrail_get_case case_id: 456 |
testrail_search_test_cases_advanced | Advanced search with multiple filters | #testrail_search_test_cases_advanced project_id: 1 priority_ids: [3] |
testrail_get_milestones | Get milestones for project planning | #testrail_get_milestones project_id: 3 |
testrail_get_labels | Get labels for test case organization | #testrail_get_labels project_id: 5 |
testrail_get_runs | Get test runs for a project | #testrail_get_runs project_id: 2 |
testrail_get_shared_steps | Get shared steps for reusable procedures | #testrail_get_shared_steps project_id: 1 |
testrail_get_statuses | Get test result statuses | #testrail_get_statuses |
testrail_get_case_metadata | Get available types and custom fields | #testrail_get_case_metadata |
testrail_get_test_case_history | Get change history and audit trail | #testrail_get_test_case_history case_id: 123 |
testrail_get_priorities | Get test case priorities | #testrail_get_priorities |
testrail_get_templates | Get available templates for cases | #testrail_get_templates project_id: 1 |
➕ Create Operations (15+ tools)
Command | Description | Example |
---|---|---|
testrail_add_section | Create new organizational section | #testrail_add_section suite_id: 3 name: "API Tests" |
testrail_create_test_case | Create comprehensive test case | #testrail_create_test_case title: "Login validation" section_id: 5 |
testrail_add_milestone | Create project milestone for planning | #testrail_add_milestone project_id: 3 name: "Release 2.0" |
testrail_add_run | Create new test run for execution | #testrail_add_run project_id: 2 suite_id: 10 name: "Sprint 5 Testing" |
testrail_add_suite | Create new test suite for organization | #testrail_add_suite project_id: 1 name: "API Tests" |
testrail_add_result | Add test execution result | #testrail_add_result test_id: 123 status_id: 1 |
testrail_add_shared_step | Create reusable test step | #testrail_add_shared_step project_id: 1 title: "Login procedure" |
testrail_add_variable | Create variable for data-driven testing | #testrail_add_variable project_id: 1 name: "test_user" |
� Update Operations (20+ tools)
Command | Description | Example |
---|---|---|
testrail_update_test_case | Update existing test case | #testrail_update_test_case case_id: 456 title: "Updated title" |
testrail_update_test_cases_batch | Update multiple cases with same values | #testrail_update_test_cases_batch case_ids: [1,2,3] updates: {...} |
testrail_copy_test_cases | Copy test cases to another section | #testrail_copy_test_cases case_ids: [1,2,3] target_section_id: 15 |
testrail_move_test_cases | Move test cases to another section/suite | #testrail_move_test_cases case_ids: [4,5,6] target_section_id: 20 |
testrail_update_milestone | Update milestone status/details | #testrail_update_milestone milestone_id: 10 is_completed: true |
testrail_update_run | Update test run details | #testrail_update_run run_id: 100 name: "Updated run name" |
testrail_update_section | Update section details | #testrail_update_section section_id: 50 name: "Updated section" |
testrail_update_suite | Update test suite details | #testrail_update_suite suite_id: 25 name: "Updated suite" |
� Delete Operations (10+ tools - Requires Confirmation)
Command | Description | Example |
---|---|---|
testrail_delete_test_case | Delete test case permanently | #testrail_delete_test_case case_id: 456 confirmation: "I_UNDERSTAND_THIS_IS_IRREVERSIBLE_DELETE" |
testrail_delete_section | Delete section permanently | #testrail_delete_section section_id: 50 confirmation: "I_UNDERSTAND_THIS_IS_IRREVERSIBLE_DELETE" |
testrail_delete_suite | Delete test suite permanently | #testrail_delete_suite suite_id: 25 confirmation: "I_UNDERSTAND_THIS_IS_IRREVERSIBLE_DELETE" |
testrail_delete_shared_step | Delete shared step permanently | #testrail_delete_shared_step shared_step_id: 10 confirmation: "I_UNDERSTAND_THIS_IS_IRREVERSIBLE_DELETE" |
testrail_delete_variable | Delete variable permanently | #testrail_delete_variable variable_id: 5 confirmation: "I_UNDERSTAND_THIS_IS_IRREVERSIBLE_DELETE" |
📄 License
MIT License - see LICENSE for details.
🆘 Support
For issues and questions:
- Check the troubleshooting section above
- Open an issue on GitHub