TestRail
Interact with TestRail's core entities such as test cases, runs, and results using a standardized protocol.
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.)
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 claude
Manual Installation
-
Clone this repository:
git clone https://github.com/yourusername/testrail-mcp.git cd testrail-mcp -
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate -
Install 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 [email protected] 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-mcp
This 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": "[email protected]",
"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": "[email protected]",
"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": "[email protected]",
"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-mcp
This 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
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Add Tool
Fetches and sets up an MCP server from a specified GitHub repository.
Chromium Helper
Access Chromium and PDFium source code repositories using Google's official CodeSearch APIs, supporting advanced search, Gerrit integration, and issue tracking.
fal.ai Recraft v3
Advanced text-to-image generation using the fal.ai Recraft v3 API.
Tauri Development MCP Server
Build, test, and debug mobile and desktop apps with the Tauri framework faster with automated UI interaction, screenshots, DOM state, and console logs from your app under development.
MCP Prompt Optimizer
Optimize prompts with research-backed strategies for 15-74% performance improvements.
Remote MCP Server (Authless)
An example of a remote MCP server deployable on Cloudflare Workers, without authentication.
MCP Server with GitHub OAuth
A remote MCP server with built-in GitHub OAuth support, designed for deployment on Cloudflare Workers.
Agile Planner MCP Server
An AI-powered server for generating agile artifacts like backlogs, features, and user stories.
Databutton
An MCP server for initial app planning and creating a good starting point for an app.
microCMS
Manage content on the microCMS headless CMS using its content and management APIs.
