MCP Hub
Back to servers

TestRail MCP Server

MCP server for TestRail that enables AI assistants to interact with TestRail's test management platform. It can query and manage projects, test cases, runs, results, plans, milestones, and more.

glama
Updated
Mar 20, 2026

Node.js ≥18 TypeScript 5.8 License: MIT 27 MCP Tools

Coverage 93.88% Functions 100% Branches 81.46%

ESLint + Security Prettier Conventional Commits

Trivy Vulnerability Scan Gitleaks Secret Scanning CodeQL Analysis Dependency Review

Tested on Node 18, 20, 22 pnpm pnpm Workspaces


TestRail MCP Server

A Model Context Protocol (MCP) server for TestRail that enables AI assistants (GitHub Copilot, Claude, etc.) to interact with TestRail's test management platform directly from the IDE.

Features

  • 27 MCP Tools — Query and manage projects, test cases, runs, results, plans, milestones, and more
  • Read & Write — Browse test data and submit results, create runs and cases
  • Smart Formatting — AI-friendly output with status summaries, pagination info, and truncation
  • Rate Limit Resilient — Automatic retry with exponential backoff on 429 responses
  • Reference Data Caching — Statuses, priorities, case types cached for 5 minutes
  • VS Code Extension — Self-contained VSIX with bundled server

Quick Start

VS Code Extension

Install VS Code extension TestRail MCP Server VS Code extension that one by fazorboy .

Configuration

Setting (VS Code)Env VarRequiredDefaultDescription
testrailMcp.apiKeyTESTRAIL_API_KEYYesTestRail API key (generate at My Settings > API Keys)
testrailMcp.baseUrlTESTRAIL_BASE_URLYesTestRail instance URL (e.g., https://company.testrail.io)
testrailMcp.usernameTESTRAIL_USERNAMEYesTestRail username (email address)
testrailMcp.projectIdTESTRAIL_PROJECT_IDYesDefault project ID (used when not specified in tool params)
testrailMcp.timeoutTESTRAIL_TIMEOUT_MSNo30000HTTP request timeout in milliseconds
testrailMcp.maxResultsTESTRAIL_MAX_RESULTSNo250Default page size for list queries (max 250)
testrailMcp.cacheEnabledTESTRAIL_CACHE_ENABLEDNotrueEnable disk caching for semi-static TestRail data
testrailMcp.cacheTtlHoursTESTRAIL_CACHE_TTL_HOURSNo168 (7 days)Cache time-to-live in hours
testrailMcp.cacheDirTESTRAIL_CACHE_DIRNo~/.testrail-mcp-cacheDirectory for disk cache files

Standalone (stdio transport)

# Install
npm install -g @fazorboy/testrail-mcp-server

# Configure
export TESTRAIL_BASE_URL="https://your-instance.testrail.io"
export TESTRAIL_USERNAME="your-email@example.com"
export TESTRAIL_API_KEY="your-api-key"
export TESTRAIL_PROJECT_ID="1"

# Run
testrail-mcp-server

Claude Desktop / MCP Client

Add to your MCP client config:

{
  "mcpServers": {
    "testrail": {
      "command": "npx",
      "args": ["testrail-mcp-server"],
      "env": {
        "TESTRAIL_BASE_URL": "https://your-instance.testrail.io",
        "TESTRAIL_USERNAME": "your-email@example.com",
        "TESTRAIL_API_KEY": "your-api-key",
        "TESTRAIL_PROJECT_ID": "1"
      }
    }
  }
}

Configuration

VariableRequiredDefaultDescription
TESTRAIL_BASE_URLYesTestRail instance URL
TESTRAIL_USERNAMEYesTestRail username (email)
TESTRAIL_API_KEYYesTestRail API key
TESTRAIL_PROJECT_IDYesDefault project ID (tools auto-use this when project_id is omitted)
TESTRAIL_TIMEOUT_MSNo30000HTTP request timeout
TESTRAIL_MAX_RESULTSNo250Default page size (max 250)

Available Tools

Read-Only (21 tools)

ToolDescription
get_projectsList all projects
get_projectGet project details
get_casesList test cases (filterable by suite, section, priority, type)
get_caseGet case details with steps
find_cases_by_pathFind test cases by suite name + section path (resolves IDs automatically)
get_runsList test runs
get_runGet run details with status counts
get_results_for_runGet results for a run
get_results_for_caseGet result history for a case in a run
get_testsList tests in a run
get_plansList test plans
get_planGet plan details with entries
get_milestonesList milestones
get_statusesGet available statuses
get_prioritiesGet priorities
get_case_typesGet case types
get_case_fieldsGet case custom fields
get_result_fieldsGet result custom fields
get_templatesGet case templates
get_usersList users
get_suitesList test suites
get_sectionsList sections (folder tree)

Write (6 tools)

ToolDescription
add_result_for_caseSubmit a test result
add_results_for_casesBulk submit results
add_runCreate a test run
close_runClose/archive a run
add_caseCreate a test case
update_caseUpdate a test case

Resources

URIDescription
testrail://healthServer health check
testrail://project/{id}/summaryProject dashboard

Prompts

The server includes built-in prompts that guide the AI through multi-step workflows:

PromptDescription
find_test_casesNavigate TestRail hierarchy (Project > Suite > Section) to find cases
test_run_summaryGet comprehensive run summary with failure analysis
project_overviewFull project dashboard with suites, runs, milestones
submit_test_resultsSubmit results for multiple cases in a run

Example Prompts

Here are example natural-language prompts you can use with any MCP-compatible AI assistant:

Browsing & Discovery

Show me all active test runs in my project

List all test suites and their sections

Get all test cases in the "Smoke Tests" section

What milestones are coming up?

Show me the section tree for suite "Regression"

Finding Test Cases by Path

Find test cases in suite "xyz", section "AbC > subsection DEF"

List cases in suite "Regression" section "Smoke Tests > Login"

The AI will call find_cases_by_path which resolves the entire path in one step:

  1. Finds the suite by name
  2. Traverses the section hierarchy to match the path
  3. Returns all cases with IDs, titles, and priorities

You can also be explicit about the project:

Find test cases in project 18, suite "xyz", section "ABC > subsection DEF > subsection PQR"

Analyzing Runs & Results

Summarize test run 1234 — what's passing and failing?

Show me all failed tests in run 1234 with their error messages

Get the result history for case C5678 in run 1234

Compare pass rates across all active runs

Submitting Results

Mark cases C101, C102, C103 as passed in run 1234

Create a new test run called "Sprint 15 Smoke" with cases C101-C110

Submit results: C101=passed, C102=failed (login timeout), C103=blocked

Project Management

Give me an overview of project 1 — suites, active runs, milestones

What test plans are currently active?

List all users who can be assigned tests

What custom case fields and statuses are available?

License

MIT

Reviews

No reviews yet

Sign in to write a review