Skip to content

TestRail MCP ServerConnect AI assistants to TestRail

A free, open-source Model Context Protocol (MCP) server that lets Claude, Cursor, Windsurf, and VS Code manage TestRail test cases, runs, and results conversationally — plus a CLI for CI/CD.

What is the TestRail MCP Server? ​

The TestRail MCP Server is an open-source Model Context Protocol server that gives AI assistants direct, structured access to a TestRail instance through the TestRail API v2. Once it is configured, an assistant such as Claude Desktop, Cursor, Windsurf, or GitHub Copilot in VS Code can search test cases, draft new ones, start test runs, record results, and upload attachments on your behalf — without you leaving the chat window.

It is published on npm as @uarlouski/testrail-mcp-server, runs on Node.js 18 or newer over the MCP stdio transport, and is licensed under Apache 2.0. The server is tested against TestRail 10.6.2 (API v2) and stays backward compatible with older instances, including pre-7.x pagination.

Install it in one line ​

Point any MCP client at the package with npx and three environment variables:

json
{
  "mcpServers": {
    "testrail": {
      "command": "npx",
      "args": ["-y", "@uarlouski/testrail-mcp-server@latest"],
      "env": {
        "TESTRAIL_INSTANCE_URL": "https://your-instance.testrail.io",
        "TESTRAIL_USERNAME": "your@email.com",
        "TESTRAIL_API_KEY": "your-api-key"
      }
    }
  }
}

There is nothing to build, host, or deploy. Full per-client instructions are in the Getting Started guide.

Why use an MCP server for TestRail? ​

Maintaining test cases by hand is slow and error-prone: you copy requirements out of a ticket, retype them into TestRail's editor, guess at which custom fields are mandatory, and repeat it for every case. The TestRail MCP Server removes those steps.

  • No context switching. Stay in your IDE or chat client instead of tabbing into the TestRail web UI.
  • No copy-pasting. Ask for a set of cases, review them in chat, and push them to TestRail in the same breath.
  • Valid data on the first try. The server reads your instance's templates, priorities, statuses, and custom field definitions and validates payloads before they are sent, so the model cannot invent a field that does not exist.
  • The same tools in CI. Everything the AI can do, a shell script can do too — see the CLI guide.

Typical prompts that work out of the box:

"List all active projects in TestRail." · "Show me every test case in section 5 of project 3." · "Write a comprehensive test case for login validation with detailed steps and add it to the Authentication section." · "Start a test run with the cases from section 5 and assign it to me." · "Mark test case C1042 as passed with the comment 'verified on staging'."

What can it do? ​

The server exposes 34 MCP tools across seven areas:

AreaWhat your AI assistant can doTools
DiscoveryBrowse projects, suites, sections, and users6 tools
Test casesRead, create, update, bulk-edit, and export cases9 tools
ExecutionCreate and update runs, read tests, submit results6 tools
AttachmentsUpload and download files, auto-zip directories2 tools
Shared stepsRead, create, update, and audit shared steps5 tools
MetadataStatuses, priorities, fields, templates, labels, configs6 tools
DeletionRemove cases, shared steps, and attachments1 tool

The complete tool reference lists every tool with its permission mode and the feature flag that enables it.

Is it safe to give an AI assistant access to TestRail? ​

That is the right question to ask, and the server is built around it. Access is layered rather than all-or-nothing:

  1. Per-mode toggles. Every tool declares a read, write, or delete mode. Destructive delete tools are disabled unless you explicitly set TESTRAIL_ALLOW_DELETE_OPERATIONS=true.
  2. Per-tool allowlisting. TESTRAIL_DISABLED_TOOLS removes named tools entirely, so you can permit add_results_for_cases while blocking mutate_suite.
  3. Opt-in features. Shared steps, case history, and the experimental RAG export are off until you turn them on.
  4. Your own credentials. The server runs locally and talks only to your TestRail instance using your API key. There is no third-party service in the middle.
  5. MCP annotations. Read, write, and delete modes are surfaced to the client as readOnlyHint and destructiveHint, so clients that ask for confirmation can do so accurately.

Read the Configuration guide for the full permission matrix, or the FAQ for shorter answers.

Next steps ​

  • Getting Started — get a TestRail API key and configure your MCP client.
  • Configuration — every environment variable, permission, and feature flag.
  • Tool Reference — all 34 tools, grouped by what they do.
  • CLI & CI/CD — run TestRail operations from pipelines without an LLM.
  • FAQ — short answers to common setup and security questions.