Connect Claude, Cursor, Windsurf, and VS Code to TestRail โ an open-source Model Context Protocol (MCP) server for AI-assisted test management.
Manage TestRail projects, search and create test cases, kick off test runs, record results, and attach files through natural-language conversation with your AI assistant โ or from CI/CD with the bundled testrail-cli. Built for QA engineers and AI-assisted test automation.
Compatible with:
๐ Documentation ยท Getting Started ยท Tool Reference ยท FAQ
--- ## What is the TestRail MCP Server? The **TestRail MCP Server** is a free, open-source [Model Context Protocol](https://modelcontextprotocol.io) server that gives AI assistants direct, structured access to a [TestRail](https://www.testrail.com/) instance through the TestRail API v2. Once 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 exposes **35 tools**, runs locally on **Node.js 18+** over the MCP stdio transport, and is licensed under **Apache 2.0**. There is nothing to host or deploy: your MCP client launches it on demand with `npx`. **No context switching. No tedious copy-pasting. Just ask your AI.** > [!NOTE] > **Compatibility baseline**: tested and validated against **TestRail 10.6.2** (API v2). Older TestRail instances (including pre-7.x pagination) are also supported via built-in backward compatibility. TestRail Cloud and self-hosted TestRail Server both work. ## Table of contents - [Key features](#-key-features--capabilities) - [Quick start](#-quick-start-guide) - [Command line interface & CI/CD](#๏ธ-command-line-interface-cli--cicd-automation) - [Environment variables](#๏ธ-environment-variables--security-controls) - [Available tools](#-available-tools) - [FAQ](#-frequently-asked-questions) - [Documentation](#-documentation--complete-tool-reference) - [Contributing](#-contributing) ## โจ Key Features & Capabilities | Capability | Description | |------------|-------------| | **๐ Intelligent Discovery** | Browse projects, test suites, and sections to automatically map your QA organization. | | **๐ Full Case Management** | Fetch, create, update, and bulk-edit test cases with comprehensive custom field support. | | **โถ๏ธ Actionable Execution** | Create test runs, update results by `test_id` or `case_id`, attach files, and track statuses. | | **๐ง Context-Aware AI** | Dynamically exposes templates, fields, priorities, and statuses so LLMs generate valid, structured data. | | **๐ฅ๏ธ CLI & CI/CD Native** | Run every tool from bash, GitHub Actions, GitLab CI, or Jenkins with zero LLM overhead. | | **๐ Least-Privilege Controls** | Per-mode permissions plus per-tool allowlisting; destructive deletes are off by default. | ## ๐ Quick Start Guide ### 1. Obtain your TestRail API key Navigate to **My Settings โ API Keys** in TestRail and generate a new key. Copy it immediately โ TestRail shows it only once. The API must also be enabled instance-wide under **Administration โ Site Settings โ API**. ### 2. Configure your MCP client Add the server to your MCP client configuration. The Claude Desktop example is shown below; Cursor, Windsurf, and VS Code use the same pattern (see the collapsible sections). #### ๐ค Claude Desktop Add this to your `claude_desktop_config.json`: ```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", "TESTRAIL_ENABLE_SHARED_STEPS": "true" } } } } ```TestRail MCP Server ยท Engineered with the Model Context Protocol