TestRail MCP Server
README.md
# TestRail MCP Server
A complete Model Context Protocol (MCP) server for TestRail integration with **full API support**. Allows AI assistants like Cursor to interact with TestRail test management system.
## β¨ Features
### π Projects
- Get all projects or specific project details
### π¦ Test Suites
- Get, create, and update test suites
### π Sections
- Get, create, update, and delete sections
### π Test Cases
- Full CRUD operations (Create, Read, Update, Delete)
- Get case types and custom fields
- Support for all custom fields and templates
### π Test Runs
- Create, update, and close test runs
- Get run details and lists
### π§ͺ Tests
- Get tests from runs
- Detailed test information
### β
Results
- Add single or bulk test results
- Get results for tests, cases, and runs
- Track test execution history
### π Test Plans
- Get test plans and plan details
### π― Milestones
- Get milestones for projects
## Installation
```bash
npm install -g mcp-testrail
```
Or use directly with npx (no installation needed):
```bash
npx -y mcp-testrail
```
## Quick Setup with Cursor
### Step 1: Get Your TestRail API Key
1. Log in to your TestRail instance
2. Click on your profile (top right)
3. Go to **Settings** β **API Keys**
4. Click **Add Key** and give it a name
5. Copy the generated API key
### Step 2: Configure Cursor
1. Open Cursor Settings (Ctrl/Cmd + ,)
2. Search for "MCP" or go to **Features** β **Model Context Protocol**
3. Click **Edit Config** or open the config file
4. Add the following configuration (also available in `cursor-config.example.json`):
```json
{
"mcpServers": {
"testrail": {
"command": "npx",
"args": ["-y", "mcp-testrail"],
"env": {
"TESTRAIL_URL": "https://your-company.testrail.io",
"TESTRAIL_USERNAME": "your-email@company.com",
"TESTRAIL_API_KEY": "your-api-key-here"
}
}
}
}
```
5. **Replace** the following values:
- `https://your-company.testrail.io` - with your TestRail URL
- `your-email@company.com` - with your TestRail email
- `your-api-key-here` - with your API key from Step 1
6. Save the config file
7. **Restart Cursor**
### Step 3: Verify It Works
Open Cursor chat and try:
```
Show me all TestRail projects
```
If everything is configured correctly, you'll see your TestRail projects!
## Environment Variables
- `TESTRAIL_URL` - Your TestRail instance URL (e.g., `https://yourcompany.testrail.io`)
- `TESTRAIL_USERNAME` - Your TestRail email address
- `TESTRAIL_API_KEY` - Your TestRail API key (generated in TestRail settings)
## π οΈ Available Tools (40+ methods)
### Projects
- `get_projects`, `get_project`
### Suites
- `get_suites`, `get_suite`, `add_suite`, `update_suite`
### Sections
- `get_sections`, `get_section`, `add_section`, `update_section`, `delete_section`
### Test Cases
- `get_cases`, `get_case`, `add_case`, `update_case`, `delete_case`
- `get_case_types`, `get_case_fields`
### Test Runs
- `get_runs`, `get_run`, `add_run`, `update_run`, `close_run`
### Tests
- `get_tests`, `get_test`
### Results
- `get_results`, `get_results_for_case`, `get_results_for_run`
- `add_result`, `add_result_for_case`, `add_results_for_cases`
### Plans
- `get_plans`, `get_plan`
### Milestones
- `get_milestones`, `get_milestone`
## License
MITTDQS
B3.3/5.0
Scored across 35 tools
Disambiguation5/5
Each tool targets a distinct entity and action (add, get, update, delete, close) with clear naming. Even multiple result tools are differentiated by context (case, run, bulk). No ambiguity.
Naming Consistency5/5
All tool names follow the verb_object pattern in snake_case (e.g., add_case, get_run, update_suite). Verbs are consistent and predictably used.
Tool Count4/5
35 tools is high but matches the complexity of TestRailβs domain (project, suite, section, case, run, result, milestone, plan). Most tools are necessary for comprehensive coverage.
Completeness3/5
Covers CRUD for cases, runs, suites, sections, and projects. However, milestones and plans only have get operations (no add/update/delete for milestones, no add/update for plans), which are notable gaps.
Maintenance
ActivityInactive
ResponsivenessNo issues