home / mcp / testrail mcp server
Provides an MCP server to interact with TestRail from Claude AI and other MCP clients, enabling management of tests, projects, suites, runs, and more.
Configuration
View docs{
"mcpServers": {
"bun913-mcp-testrail": {
"command": "npx",
"args": [
"@bun913/mcp-testrail@latest"
],
"env": {
"TESTRAIL_URL": "https://your-instance.testrail.io",
"TESTRAIL_API_KEY": "YOUR_API_KEY",
"TESTRAIL_USERNAME": "[email protected]"
}
}
}
}You can run a TestRail MCP Server locally to manage test data directly from your conversations with Claude AI or other MCP-enabled clients. This server exposes a wide set of actions for projects, suites, cases, sections, runs, tests, results, plans, milestones, and shared steps, enabling you to work with TestRail without leaving your chat or IDE.
Connect your MCP client to the TestRail MCP Server by configuring a local runtime that executes the MCP package and exposes the tools listed below. Once connected, you can retrieve and modify test data across projects, suites, cases, sections, and runs, then view results and history all from within your messaging client.
Prerequisites you need before starting:
Install and run the MCP server using the provided runtime command snippet. Create a configuration that points to your TestRail instance and credentials.
{
"mcpServers": {
"testrail": {
"command": "npx",
"args": ["@bun913/mcp-testrail@latest"],
"env": {
"TESTRAIL_URL": "https://your-instance.testrail.io", // Replace with your TestRail URL
"TESTRAIL_USERNAME": "[email protected]", // Replace with your TestRail username
"TESTRAIL_API_KEY": "YOUR_API_KEY" // Replace with your TestRail API key
}
}
}
}Place the configuration in your MCP client according to the structure shown above. Start the MCP server using your client’s standard run procedure. Once running, your client can invoke all available TestRail tools from within your conversations.
Protect your TestRail credentials. Store the API key and username securely and avoid committing them to version-controlled files. Use environment variables as shown in the example to keep secrets out of your code.
If you encounter issues, check these common areas: - Spawn or startup errors: confirm Node.js is installed and accessible in your PATH. - Connection issues: ensure the MCP server is running and the provided TestRail URL and credentials are correct. - Authentication errors: verify your API credentials in the environment variables. - SSE or network errors: verify the server port is open and reachable from your client.
This MCP server exposes a comprehensive set of TestRail capabilities, including fetching and updating projects, suites, cases, sections, runs, tests, results, plans, milestones, and shared steps. Use these tools to automate actions and pull data into your conversations.
Retrieve a list of all projects in TestRail.
Fetch details for a single project by ID.
Get all suites within a project.
Fetch a single suite by ID.
Create a new suite in a project.
Update an existing suite.
Retrieve a single test case by ID.
Retrieve multiple test cases within a project or suite.
Create a new test case.
Update an existing test case.
Delete a test case.
List available test case types.
List custom fields for cases.
Copy a case to another section.
Move a case to a different section.
Retrieve historical changes for a case.
Update multiple cases in a batch.
Fetch a single section by ID.
List sections in a project or suite.
Create a new section.
Move a section to a different folder or position.
Update an existing section.
Delete a section.
Retrieve test runs for a project.
Fetch a single run by ID.
Create a new test run.
Update an existing test run.
List tests within a run or project.
Fetch a single test by ID.
Retrieve test results for a run or case.
Get results for a specific case.
Get results for a specific run.
Add a result for a single case.
Add results for multiple cases at once.
List test plans.
List milestones.
Retrieve shared steps available for reuse.