TestRail MCP Server
Enables AI assistants to interact with TestRail test management systems through comprehensive API integration. Supports retrieving and updating test cases, projects, suites, runs, and results, plus adding attachments and managing test data through natural language commands.
README
TestRail MCP Server
A Model Context Protocol (MCP) server that provides TestRail integration tools for AI assistants like Cursor.
Features
- Get TestRail test cases, projects, suites, runs, and tests
- Update test cases, runs, and tests
- Add test results and attachments
- Full TestRail API integration
- Seamless integration with Cursor and other MCP-compatible AI assistants
Quick Start
Prerequisites
- Node.js 18.17.0 or higher
- npm
Installation Options
Option 1: Using npm package (Recommended)
# Install globally
npm install -g testrail-mcp-server
# Or install locally
npm install testrail-mcp-server
Option 2: From source
# Clone and setup
git clone https://github.com/Derrbal/testrail-mcp.git
cd testrail-mcp
npm install
npm run build
Configure Environment Variables
Create a .env file in your project root or set environment variables:
TESTRAIL_USERNAME=your_testrail_username
TESTRAIL_API_KEY=your_testrail_api_key
TESTRAIL_URL=https://your-instance.testrail.com
Cursor Integration
Setup
Option 1: Using npm package (Recommended)
- Configure Cursor MCP Settings: Open Cursor and go to Settings → Extensions → MCP. Add the following configuration:
{
"mcpServers": {
"testrail": {
"command": "npx",
"args": ["testrail-mcp-server"],
"env": {
"TESTRAIL_USERNAME": "your_testrail_username",
"TESTRAIL_API_KEY": "your_testrail_api_key",
"TESTRAIL_URL": "https://your-instance.testrail.com"
}
}
}
}
Option 2: Using local installation
- Configure Cursor MCP Settings: Open Cursor and go to Settings → Extensions → MCP. Add the following configuration:
{
"mcpServers": {
"testrail": {
"command": "node",
"args": ["/path/to/testrail-mcp/dist/server.js"],
"env": {
"TESTRAIL_USERNAME": "your_testrail_username",
"TESTRAIL_API_KEY": "your_testrail_api_key",
"TESTRAIL_URL": "https://your-instance.testrail.com"
}
}
}
}
- Restart Cursor to load the MCP server configuration.
Usage
Using with Cursor
Once configured, you can use TestRail tools directly in Cursor's chat:
Using the npm package directly
You can also use the MCP server directly from the command line:
# Run the server (stdio transport)
npx testrail-mcp-server
# Or run with HTTP transport
npx testrail-mcp-server --http
Example Commands:
- "Get all TestRail projects"
- "Show me test cases for project ID 1"
- "Update test case 123 with new title"
- "Add a test result for test ID 456"
- "Upload an attachment to test case 789"
Available Tools:
get_case- Fetch a TestRail test case by IDadd_case- Create a new test case in a sectionupdate_case- Update a TestRail test caseget_projects- List all TestRail projectsget_project- Get project detailsget_suites- Get test suites for a projectget_suite- Get suite detailsget_cases- Get test cases with filteringadd_attachment_to_case- Upload file attachmentget_sections- Get test sectionsget_runs- Get test runsget_run- Get run detailsupdate_run- Update test runget_tests- Get tests in a runget_test- Get test detailsupdate_test- Update testadd_result- Add test resultget_case_fields- Get available custom fields for test cases
Troubleshooting
Common Issues:
- Server not found: Ensure the path to
dist/server.jsis correct - Authentication errors: Verify your TestRail credentials in the environment variables
- Permission denied: Make sure the server file is executable
- Connection timeout: Check your TestRail URL and network connectivity
Debug Mode: Enable debug logging by adding to your environment variables:
DEBUG=true
LOG_LEVEL=debug
Deployment Options
Local Development
# Run in development mode
npm run dev
# Start the server (stdio transport)
npm start
# Start the server (HTTP transport on port 1823)
npm run start:http
# Run tests
npm test
Docker Deployment
Quick Start:
# Set environment variables
export TESTRAIL_USERNAME="your_testrail_username"
export TESTRAIL_API_KEY="your_testrail_api_key"
export TESTRAIL_URL="https://your-instance.testrail.com"
# Build and run with Docker Compose
docker-compose up -d
Manual Build:
# Build the image
docker build -t testrail-mcp-server .
# Run the container
docker run -d \
--name testrail-mcp-server \
-p 1823:1823 \
-e TESTRAIL_USERNAME=your_username \
-e TESTRAIL_API_KEY=your_api_key \
-e TESTRAIL_URL=https://your-instance.testrail.com \
testrail-mcp-server
Security Considerations
- Store TestRail API keys securely using environment variables
- Never commit API keys to version control
- Use HTTPS for TestRail URLs
- Consider using Docker secrets for production deployments
- Regularly rotate API keys
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.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.