TestRail MCP Server

Server MCP asli AI yang menghubungkan Claude, Cursor, Windsurf, dan asisten AI lainnya ke TestRail β€” kelola kasus uji, proses uji, dan hasil melalui percakapan bahasa alami, dengan skema bertipe yang dibangun untuk LLM.

Dokumentasi

πŸš€ TestRail MCP Server

An open-source Model Context Protocol (MCP) server that connects Claude, Cursor, Windsurf, and other AI assistants directly to TestRail.

Manage TestRail projects, search and create test cases, kick off test runs, record results, and attach files β€” all through natural-language conversation with your AI assistant. Built for QA engineers and AI-assisted test automation.

npm version npm downloads CI Status License TypeScript GitHub stars Score Badge

Compatible with: Claude Desktop Cursor Windsurf VS Code


🌟 Why Choose TestRail MCP Server?

Managing test cases manually is tedious and error-prone. With the TestRail MCP Server, your AI assistant (whether it’s Claude, Cursor, Windsurf, or any MCP-compliant client) interacts directly with your TestRail instance. Instruct it to find test cases, draft new ones, kick off test runs, and record test resultsβ€”all through natural conversation.

No context switching. No tedious copy-pasting. Just ask your AI.

[!NOTE] Compatibility Baseline: The primary baseline version this MCP server is tested and validated against is TestRail 10.6.2 (API v2). Older TestRail instances (including pre-7.x pagination) are also supported via built-in backward compatibility.

✨ Key Features & Capabilities

CapabilityDescription
πŸ” Intelligent DiscoveryBrowse projects, test suites, and sections to automatically map your QA organization.
πŸ“‹ Full Case ManagementFetch, create, update, and bulk-edit test cases with comprehensive custom field support.
▢️ Actionable ExecutionCreate test runs, update results by test_id or case_id, attach files, and track statuses.
🧠 Context-Aware AIDynamically exposes templates, fields, priorities, and statuses so LLMs generate valid, structured data.

πŸš€ Quick Start Guide

1. Obtain Your TestRail API Key

Navigate to My Settings β†’ API Keys in your TestRail platform and generate a new key for authentication.

2. Configure Your MCP Client

Add the server to your chosen MCP client configuration. The Claude Desktop example is shown below; Cursor, Windsurf, and other clients use the same pattern (see the collapsible sections further down).

πŸ€– Claude Desktop

Add this to your claude_desktop_config.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"
      }
    }
  }
}
⌨️ Cursor

Open Settings β†’ Features β†’ MCP and add a new configuration:

{
  "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"
      }
    }
  }
}
🌊 Windsurf

Update your Windsurf MCP configuration file:

{
  "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"
      }
    }
  }
}
🌐 Other MCP Clients

Any MCP-compliant client can utilize this server. The pattern is universalβ€”point your client at the npx command with the required environment variables.

3. See It in Action

Once configured, turbo-charge your QA workflow by asking your AI assistant:

  • "List all projects in TestRail to find the latest active project."
  • "Show me all active users in the project to find the right assignee."
  • "Show me all test cases in section 5 of project 3."
  • "Create a comprehensive test case for 'Login Validation' with detailed steps."
  • "Start a new test run containing cases from section 5."
  • "Mark test case ID 1042 as passed with the comment 'Tested successfully on staging'."

βš™οΈ Environment Variables & Security Controls

VariableDescriptionRequiredDefault
TESTRAIL_INSTANCE_URLYour TestRail instance URL (e.g., https://example.testrail.io)βœ…
TESTRAIL_USERNAMEYour TestRail user email addressβœ…
TESTRAIL_API_KEYYour TestRail API key (Guide)βœ…
TESTRAIL_ENABLE_SHARED_STEPSSet to true to enable Shared Steps management toolsfalse
TESTRAIL_ENABLE_CASE_HISTORYSet to true to enable Case History and revision tracking toolsfalse
TESTRAIL_ALLOW_WRITE_OPERATIONSAllow write operations (e.g. adding/updating test cases, test runs, sections)true
TESTRAIL_ALLOW_READ_OPERATIONSAllow read operations (e.g. retrieving projects, test cases, templates)true
TESTRAIL_ALLOW_DELETE_OPERATIONSAllow delete operations (e.g. deleting cases or shared steps). Enabled strictly via true.false
TESTRAIL_ENABLE_DEPRECATED_TOOLSEnable deprecated tools for backward compatibility. Set to false to reduce context token overhead.true

⚠️ Deprecation Lifecycle & Features Scheduled for Removal

To ensure smooth transitions, deprecated tools remain available by default (TESTRAIL_ENABLE_DEPRECATED_TOOLS=true) and will be removed in future major releases:

Deprecated ToolReplacementStatus
add_attachment_to_runadd_attachment (entity_type: "case" | "run")Deprecated in 2.3.0, scheduled for removal in 3.0.0

πŸ’‘ Token Tip: If you are not using legacy tools, set TESTRAIL_ENABLE_DEPRECATED_TOOLS=false in your environment to eliminate deprecated tool definitions from the LLM prompt and save tokens!


πŸ“š Documentation & Complete Tool Reference

For a comprehensive guide, detailed configuration options, and a complete breakdown of all available tools, please visit our official documentation site:

πŸ‘‰ TestRail MCP Server Documentation

The documentation includes detailed explanations for:

  • πŸ”­ Discovery & Navigation: Exploring projects, suites, and sections.
  • πŸ“‹ Test Case Management: Fetching, creating, and bulk-updating test cases.
  • ▢️ Execution & Tracking: Managing test runs and submitting test results.
  • πŸ“Ž Attachments: Automatically zipping and uploading files or directories.
  • πŸ”— Shared Steps: Managing reusable step definitions.

🀝 Contributing

Open-source contributions are actively welcomed! Please feel free to open an issue for feature requests or submit a pull request for improvements.

πŸ“œ License

This project is securely licensed under the Apache License 2.0.


TestRail MCP Server Β· Engineered with the Model Context Protocol