TestRail MCP Server

AI-native MCP server connecting Claude, Cursor, Windsurf, and other AI assistants to TestRail — manage test cases, runs, and results through natural-language conversation, with typed schemas built for LLMs.

🚀 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.

✨ 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": "[email protected]",
        "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": "[email protected]",
        "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": "[email protected]",
        "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 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

VariableDescriptionRequired
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 tools

🛠️ Complete Tool Reference

The TestRail MCP Server provides heavily typed, descriptive tools designed specifically for LLM interaction:

🔭 Discovery & Navigation

ToolFunctionality
get_projectsList all available active and completed projects in your instance.
get_sectionsNavigate the precise folder/section hierarchy of any test suite.

📋 Test Case Management

ToolFunctionality
get_casesQuery test cases with advanced filtering (priority, template, type, etc.) and pagination.
get_caseFetch complete, structured details of a specific test case, including custom steps and fields.
add_caseSeamlessly create a new test case equipped with robust custom field validation.
update_caseModify an existing test case's steps, metadata, or titles.
update_casesExecute bulk-updates on multiple test cases simultaneously to save time.

▶️ Test Execution & Tracking

ToolFunctionality
add_runGenerate a new, focused test run directly in TestRail.
get_testsRetrieve individual tests for a specific test run, with optional status filtering.
add_resultsSubmit test results to a test run using the specific test_id.
add_results_for_casesSubmits results to a run mapping directly to case_ids, streamlining automation workflows.
add_attachment_to_runAttach logs, files, or zipped artifacts directly to an ongoing test run.

🔗 Shared Steps (Optional)

ToolFunctionality
get_shared_stepsList shared test steps for a project with optional reference filtering.
get_shared_stepRetrieve precise details of a specific shared test step set.
get_shared_step_historyView the complete audit trail and version history of a shared step set.
add_shared_stepCreate a new reusable set of shared test steps.
update_shared_stepModify an existing shared step set (changes propagate to all linked test cases).
delete_shared_stepSecurely delete a shared step entity.

🧠 System Metadata

ToolFunctionality
get_statusesSystematically list all configured test statuses (Passed, Failed, Blocked, Retest, etc.).
get_prioritiesRetrieve priority levels configured within your instance structure.
get_case_fieldsDiscover custom field definitions, formats, and UI dropdown options. Supports filtering by project_id.
get_templatesIdentify available case templates to mandate correct AI structuring.

🤝 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

相關伺服器

NotebookLM 網頁匯入器

一鍵將網頁和 YouTube 影片匯入 NotebookLM。超過 200,000 位使用者信賴。

安裝 Chrome 擴充功能