TestRail MCP Server
The TestRail MCP Server enables interaction with TestRail's core entities through the Model Context Protocol (MCP).
Projects: Get, add, update, and delete projects.
Test Cases: Get, add, update, and delete test cases.
Test Runs: Get, add, update, close, and delete test runs.
Results: Get and add test results.
Datasets: Get, add, update, and delete datasets.
Enables interaction with TestRail's core entities including projects, cases, runs, results, and datasets, allowing access and management of test management data through the TestRail API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TestRail MCP Server show me the latest test results for project 'Mobile App'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
TestRail MCP Server
A Model Context Protocol (MCP) server for TestRail that allows interaction with TestRail's core entities through a standardized protocol.
Features
Authentication with TestRail API
Access to TestRail entities:
Projects
Cases
Runs
Results
Datasets
Full support for the Model Context Protocol
Compatible with any MCP client (Claude Desktop, Cursor, Windsurf, etc.)
Related MCP server: TestRail MCP Server
See it in action together with Octomind MCP

Installation
Installing via Smithery
To install testrail-mcp for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @sker65/testrail-mcp --client claudeManual Installation
Clone this repository:
git clone https://github.com/yourusername/testrail-mcp.git cd testrail-mcpCreate and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activateInstall dependencies:
pip install -e .
Configuration
The TestRail MCP server requires specific environment variables to authenticate with your TestRail instance. These must be set before running the server.
Create a
.envfile in the root directory of the project:TESTRAIL_URL=https://your-instance.testrail.io TESTRAIL_USERNAME=your-email@example.com TESTRAIL_API_KEY=your-api-keyImportant Notes:
TESTRAIL_URLshould be the full URL to your TestRail instance (e.g.,https://example.testrail.io)TESTRAIL_USERNAMEis your TestRail email address used for loginTESTRAIL_API_KEYis your TestRail API key (not your password)To generate an API key, log in to TestRail, go to "My Settings" > "API Keys" and create a new key
Verify that the configuration is loaded correctly:
uvx testrail-mcp --configThis will display your TestRail configuration information, including your URL, username, and the first few characters of your API key for verification.
If you're using this server with a client like Claude Desktop or Cursor, make sure the environment variables are accessible to the process running the server. You may need to set these variables in your system environment or ensure they're loaded from the .env file.
Usage
Running the Server
The server can be run directly using the installed script:
uvx testrail-mcpThis will start the MCP server in stdio mode, which can be used with MCP clients that support stdio communication.
Using with MCP Clients
Claude Desktop
In Claude Desktop, add a new server with the following configuration:
{
"mcpServers": {
"testrail": {
"command": "uvx",
"args": [
"testrail-mcp"
],
"env": {
"TESTRAIL_URL": "https://your-instance.testrail.io",
"TESTRAIL_USERNAME": "your-email@example.com",
"TESTRAIL_API_KEY": "your-api-key"
}
}
}
}Cursor
In Cursor, add a new custom tool with the following configuration:
{
"name": "TestRail MCP",
"command": "uvx",
"args": [
"testrail-mcp"
],
"env": {
"TESTRAIL_URL": "https://your-instance.testrail.io",
"TESTRAIL_USERNAME": "your-email@example.com",
"TESTRAIL_API_KEY": "your-api-key"
}
}Windsurf
In Windsurf, add a new tool with the following configuration:
{
"name": "TestRail MCP",
"command": "uvx",
"args": [
"testrail-mcp"
],
"env": {
"TESTRAIL_URL": "https://your-instance.testrail.io",
"TESTRAIL_USERNAME": "your-email@example.com",
"TESTRAIL_API_KEY": "your-api-key"
}
}Testing with MCP Inspector
For testing and debugging, you can use the MCP Inspector:
npx @modelcontextprotocol/inspector \
-e TESTRAIL_URL=<your-url> \
-e TESTRAIL_USERNAME=<your-username> \
-e TESTRAIL_API_KEY=<your-api-key> \
uvx testrail-mcpThis will open a web interface where you can explore and test all the available tools and resources.
Development
This server is built using:
FastMCP - A Python framework for building MCP servers
Requests - For HTTP communication with TestRail API
python-dotenv - For environment variable management
License
MIT
Available Tools
23 toolsadd_caseC
Add a new test case
Inputs: title (required), section_id (required), refs, type_id, +5 more.
add_datasetC
Add a new dataset
Inputs: name (required), project_id (required), description.
add_projectC
Add a new project
Inputs: name (required), suite_mode, announcement, show_announcement.
add_resultC
Add a new test result
Inputs: test_id (required), status_id (required), comment, defects, +3 more.
add_runC
Add a new test run
Inputs: name (required), suite_id (required), project_id (required), case_ids, +4 more.
close_runC
Close an existing test run
Inputs: run_id (required).
delete_caseC
Delete a test case
Inputs: case_id (required).
delete_datasetC
Delete a dataset
Inputs: dataset_id (required).
delete_projectC
Delete a project
Inputs: project_id (required).
delete_runC
Delete a test run
Inputs: run_id (required).
get_caseA
Get a test case by ID
Inputs: case_id (required).
get_casesC
Get all test cases for a project/suite
Inputs: project_id (required), suite_id.
get_datasetC
Get a dataset by ID
Inputs: dataset_id (required).
get_datasetsC
Get all datasets for a project
Inputs: project_id (required).
get_projectB
Get a project by ID
Inputs: project_id (required).
get_projectsB
Get all projects
Inputs: no named parameters.
get_resultsC
Get all test results for a test
Inputs: test_id (required).
get_runA
Get a test run by ID
Inputs: run_id (required).
get_runsC
Get all test runs for a project
Inputs: project_id (required).
update_caseC
Update an existing test case
Inputs: case_id (required), refs, title, type_id, +5 more.
update_datasetC
Update an existing dataset
Inputs: dataset_id (required), name, description.
update_projectC
Update an existing project
Inputs: project_id (required), name, announcement, is_completed, +1 more.
update_runC
Update an existing test run
Inputs: run_id (required), name, case_ids, description, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Each tool targets a distinct resource (case, dataset, project, run, result) and action (add, get, update, delete). No overlapping purposes; an agent can easily distinguish them.
All tool names follow a consistent `verb_noun` pattern with underscores (e.g., add_case, get_projects). No mixing of conventions like camelCase or inconsistent verbs.
23 tools is on the higher side but still reasonable for a comprehensive test management API covering projects, cases, runs, results, and datasets. Slightly more than ideal but each tool serves a clear purpose.
The surface covers basic CRUD for projects, cases, runs, and datasets, but lacks operations for suites, sections, and updating results. Notable gaps like missing `update_result` and suite management limit completeness.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceA Model Context Protocol server that provides integration with TestRail, allowing AI assistants to interact with TestRail projects, test cases, test runs, and results.327 npm1-
- AlicenseNot gradedqualityDmaintenanceMCP 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.MIT
- AlicenseBqualityAmaintenanceAI-native Model Context Protocol (MCP) server for TestRail. Lets Claude, Cursor, Windsurf, and other AI assistants browse projects, create and update test cases, kick off test runs, and record results through natural-language conversation — with strongly-typed tool schemas and per-project custom field validation that helps LLMs generate valid TestRail requests on the first try.271,320 npm46Apache 2.0
- AlicenseCqualityDmaintenanceModel Context Protocol (MCP) server for Redmine that provides comprehensive access to the Redmine REST API, enabling users to operate Redmine from MCP clients such as Claude Desktop.9014 npmMIT