MCP Hub
Back to servers

testrail-mcp

A comprehensive MCP server enabling AI tools to interact with the TestRail API, providing full coverage for managing test cases, runs, suites, results, and attachments directly within AI-powered development environments.

Tools
77
Updated
Jan 13, 2026

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

Global Installation

npm i -g @tenbarrel6/testrail-mcp

Local Installation

npm i @tenbarrel6/testrail-mcp

Using npx

No installation required - run directly in downloaded github repository:

npx @tenbarrel6/testrail-mcp

Configuration

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-here

Cursor 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

  1. Log in to your TestRail instance
  2. Go to My Settings (click your name in the top right)
  3. Navigate to the API Keys tab
  4. Click Add Key to generate a new API key
  5. Copy and save the key securely

Available Tools

Projects

ToolDescription
get_projectsGet all TestRail projects
get_projectGet a specific project by ID

Test Suites

ToolDescription
get_suitesGet all test suites for a project
get_suiteGet a specific test suite by ID
add_suiteCreate a new test suite
update_suiteUpdate an existing test suite

Sections

ToolDescription
get_sectionsGet all sections for a project/suite
get_sectionGet a specific section by ID
add_sectionCreate a new section
update_sectionUpdate an existing section
delete_sectionDelete a section
move_sectionMove a section to another parent or position

Test Cases

ToolDescription
get_casesGet test cases for a project/suite
get_caseGet a specific test case by ID
add_caseCreate a new test case
update_caseUpdate an existing test case
delete_caseDelete a test case
delete_casesDelete multiple test cases
copy_cases_to_sectionCopy test cases to another section
move_cases_to_sectionMove test cases to another section
get_case_typesGet all available test case types
get_case_fieldsGet all available test case fields
get_history_for_caseGet the edit history for a test case

Test Runs

ToolDescription
get_runsGet test runs for a project
get_runGet a specific test run by ID
add_runCreate a new test run
update_runUpdate an existing test run
close_runClose a test run
delete_runDelete a test run

Tests

ToolDescription
get_testsGet tests for a test run
get_testGet a specific test by ID

Results

ToolDescription
get_resultsGet results for a test
get_results_for_caseGet results for a test case in a run
get_results_for_runGet all results for a test run
add_resultAdd a test result
add_result_for_caseAdd a test result for a specific case in a run
add_resultsAdd multiple test results by test IDs
add_results_for_casesAdd multiple test results for cases in a run

Test Plans

ToolDescription
get_plansGet test plans for a project
get_planGet a specific test plan by ID
add_planCreate a new test plan
update_planUpdate an existing test plan
close_planClose a test plan
delete_planDelete a test plan
add_plan_entryAdd test runs to a test plan
update_plan_entryUpdate a test plan entry
delete_plan_entryDelete a test plan entry
add_run_to_plan_entryAdd a test run to an existing plan entry
update_run_in_plan_entryUpdate a test run inside a plan entry
delete_run_from_plan_entryDelete a test run from a plan entry

Milestones

ToolDescription
get_milestonesGet milestones for a project
get_milestoneGet a specific milestone by ID
add_milestoneCreate a new milestone
update_milestoneUpdate an existing milestone
delete_milestoneDelete a milestone

Users

ToolDescription
get_usersGet all users (optionally filtered by project)
get_userGet a user by ID
get_user_by_emailGet a user by email address
get_current_userGet the current authenticated user

Statuses & Priorities

ToolDescription
get_statusesGet all available test result statuses
get_case_statusesGet all available test case statuses (Enterprise)
get_prioritiesGet all available test case priorities

Templates & Configurations

ToolDescription
get_templatesGet all templates for a project
get_configsGet all configurations for a project
get_result_fieldsGet all available result custom fields

Attachments

ToolDescription
add_attachment_to_caseAdd an attachment to a test case
add_attachment_to_resultAdd an attachment to a test result
add_attachment_to_runAdd an attachment to a test run
add_attachment_to_planAdd an attachment to a test plan
add_attachment_to_plan_entryAdd an attachment to a test plan entry
get_attachmentGet/download an attachment by ID
get_attachments_for_caseGet all attachments for a test case
get_attachments_for_testGet all attachments for a test
get_attachments_for_runGet all attachments for a test run
get_attachments_for_planGet all attachments for a test plan
get_attachments_for_plan_entryGet all attachments for a test plan entry
delete_attachmentDelete 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 IDStatus
1Passed
2Blocked
3Untested
4Retest
5Failed

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 dev

Scripts

  • npm run build - Compile TypeScript to JavaScript
  • npm run start - Run the compiled server
  • npm 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_URL should include the protocol (https://)
  • TESTRAIL_USERNAME should be your email address
  • TESTRAIL_API_KEY should 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 npx is available in your PATH

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Ruslan Sapun

Links

Reviews

No reviews yet

Sign in to write a review