Used for configuration management, allowing TestRail credentials and settings to be stored in environment variables loaded from a .env file.
Handles package management and script execution for building, running, and developing the MCP server.
Provides tools for interacting with TestRail, enabling access to projects, test cases, test runs, and results. Includes features for retrieving, creating, and updating test cases, managing test runs, adding test results, and parsing TestRail URLs to automatically call appropriate tools.
Supports running the server in development mode, enabling execution of TypeScript code without requiring a separate compilation step.
Provides type definitions for TestRail API interactions, improving development experience with static type checking.
TestRail MCP Server
A Model Context Protocol (MCP) server that provides integration with TestRail, allowing AI assistants to interact with TestRail projects, test cases, test runs, and results.
Features
Tools
get_projects: Retrieve all TestRail projects
get_project: Get details of a specific project
get_test_cases: Retrieve test cases with optional filtering
create_test_case: Create new test cases
get_test_runs: Retrieve test runs for a project
create_test_run: Create new test runs
add_test_result: Add test results to test runs
get_users: Retrieve TestRail users
test_connection: Test the connection to TestRail
parse_testrail_url: 🆕 Parse TestRail URLs and auto-call appropriate tools
Resources
testrail://projects: Access to all TestRail projects
testrail://users: Access to all TestRail users
Prompts
test_case_template: Generate comprehensive test case templates
test_run_summary: Generate detailed test run summary reports
Installation
Clone this repository:
Install dependencies:
Build the project:
Configuration
Create a .env
file in the root directory with your TestRail configuration:
Getting TestRail API Credentials
Log in to your TestRail instance
Go to your user profile (click on your name in the top-right corner)
Navigate to the "API Keys" tab
Generate a new API key
Use your email address as the username and the generated key as the API key
Usage
With Claude Desktop
Add the server to your Claude Desktop configuration file (claude_desktop_config.json
):
Direct Usage
You can also run the server directly:
Or in development mode:
Development
Project Structure
Available Scripts
npm run build
: Build the TypeScript projectnpm run watch
: Build and watch for changesnpm start
: Start the compiled servernpm run dev
: Start the server in development mode with ts-nodenpm run lint
: Lint the source code
Building
Testing
Test the connection to TestRail:
API Coverage
This MCP server covers the following TestRail API endpoints:
Projects
GET /get_projects
- Get all projectsGET /get_project/{id}
- Get project details
Test Cases
GET /get_cases/{project_id}
- Get test casesGET /get_case/{id}
- Get test case detailsPOST /add_case/{section_id}
- Create test casePOST /update_case/{id}
- Update test case
Test Runs
GET /get_runs/{project_id}
- Get test runsGET /get_run/{id}
- Get test run detailsPOST /add_run/{project_id}
- Create test runPOST /close_run/{id}
- Close test run
Test Results
GET /get_results/{test_id}
- Get test resultsPOST /add_result/{test_id}
- Add test resultPOST /add_result_for_case/{run_id}/{case_id}
- Add result for specific case
Users
GET /get_users
- Get all usersGET /get_user/{id}
- Get user details
Suites & Sections
GET /get_suites/{project_id}
- Get test suitesGET /get_sections/{project_id}
- Get sectionsGET /get_milestones/{project_id}
- Get milestones
Examples
URL Parsing (New Feature!)
Simply paste any TestRail URL and get the data automatically:
Creating a Test Case
Adding Test Results
Error Handling
The server includes comprehensive error handling and will return detailed error messages for:
Invalid TestRail credentials
Network connectivity issues
Invalid parameters
TestRail API errors
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For issues and questions:
Check the TestRail API documentation
Verify your credentials and network connectivity
Check the server logs for detailed error messages
Open an issue in this repository
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol server that provides integration with TestRail, allowing AI assistants to interact with TestRail projects, test cases, test runs, and results.
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that enables AI assistants to build and test Xcode projects directly through a standardized interface, with capabilities for running tests, monitoring progress, and accessing logs in real-time.Last updated -181547
- -securityFlicense-qualityA Model Context Protocol server that integrates with the Qase test management platform, allowing users to create and retrieve test cases, manage test runs, and interact with Qase projects.Last updated -31
- -securityFlicense-qualityA comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.Last updated -331
- AsecurityAlicenseAqualityA Model Context Protocol server that allows interaction with TestRail's core entities (projects, cases, runs, results, datasets) through a standardized protocol compatible with MCP clients like Claude Desktop.Last updated -237MIT License