TestRail MCP Server
An mcp server for testrail
sker65
README
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, Winsurf, etc.)
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
.env
file 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-key
Important Notes:
TESTRAIL_URL
should be the full URL to your TestRail instance (e.g.,https://example.testrail.io
)TESTRAIL_USERNAME
is your TestRail email address used for loginTESTRAIL_API_KEY
is 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:
python -c "from testrail_mcp.config import TESTRAIL_URL, TESTRAIL_USERNAME, TESTRAIL_API_KEY; print(f'URL: {TESTRAIL_URL}, Username: {TESTRAIL_USERNAME}, API Key: {TESTRAIL_API_KEY[:5]}...')"
This should print your TestRail URL, username, and the first few characters of your API key.
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 as a Python module:
python -m 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
- Open Claude Desktop
- Go to Settings > Servers
- Click "Install Server"
- Navigate to your project directory
- Select the Python module:
testrail_mcp
- Claude Desktop will now be able to use your TestRail MCP server
Cursor
- Open Cursor
- Go to Settings > AI > Custom Tools
- Click "Add Tool"
- Configure the tool:
- Name: TestRail MCP
- Command:
python -m testrail_mcp
- Communication: Stdio
- Save the configuration
Winsurf
- Open Winsurf
- Go to Settings > Tools
- Click "Add Tool"
- Configure the tool:
- Name: TestRail MCP
- Command:
python -m testrail_mcp
- Protocol: MCP
- Save the configuration
Testing with MCP Inspector
For testing and debugging, you can use the MCP Inspector:
npx @modelcontextprotocol/inspector stdio -- python -m 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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor

Linear MCP Server
A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.