TestRail MCP Server
MCP server for interacting with TestRail test case management instances.
Configuration
Authentication: TestRail uses HTTP Basic Authentication with your username and an API key (generated under My Settings → API Keys in TestRail). It is recommended to create a dedicated API user account rather than using a personal account.
Option 1: config.json
cp config.json.example config.json
# Edit config.json with your API user credentials
Option 2: Environment Variables
export TESTRAIL_URL="https://example.testrail.io"
export TESTRAIL_USERNAME="api-user@example.com"
export TESTRAIL_API_KEY="your-testrail-api-key"
export TESTRAIL_VERIFY_SSL="true"
Installation
Option 1: Using uv (Recommended)
uv is a fast Python package manager. Install it first:
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
No additional installation needed - uvx will handle dependencies automatically.
Option 2: Using pip
pip install bibliocommons-mcp-testrail
# or for development
pip install -e ".[dev]"
AI Client Setup
VS Code (with MCP Extension)
- Install an MCP-compatible extension in VS Code
- Open VS Code Settings (JSON):
Cmd+Shift+P→ "Preferences: Open User Settings (JSON)" - Add the server configuration:
{
"mcp.servers": {
"testrail": {
"command": "uvx",
"args": ["--from", "/absolute/path/to/testrail", "bibliocommons-mcp-testrail"]
}
}
}
Alternative: Using python directly
{
"mcp.servers": {
"testrail": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_testrail"]
}
}
}
Claude Desktop
-
Open Claude Desktop configuration:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the server configuration:
{
"mcpServers": {
"testrail": {
"command": "uvx",
"args": ["--from", "/absolute/path/to/testrail", "bibliocommons-mcp-testrail"]
}
}
}
Alternative: Using python directly
{
"mcpServers": {
"testrail": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_testrail"]
}
}
}
Kiro IDE
- Open Kiro IDE settings
- Navigate to MCP Servers configuration
- Add the server:
{
"mcpServers": {
"testrail": {
"command": "uvx",
"args": ["--from", "/absolute/path/to/testrail", "bibliocommons-mcp-testrail"]
}
}
}
Alternative: Using python directly
{
"mcpServers": {
"testrail": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_testrail"]
}
}
}
Kiro CLI
-
Create or edit the MCP configuration file:
- User level:
~/.kiro/settings/mcp.json - Project level:
<project-root>/.kiro/settings/mcp.json
- User level:
-
Add the server configuration:
{
"mcpServers": {
"testrail": {
"command": "uvx",
"args": ["--from", "/absolute/path/to/testrail", "bibliocommons-mcp-testrail"]
}
}
}
Alternative: Using python directly
{
"mcpServers": {
"testrail": {
"command": "python",
"args": ["-m", "bibliocommons_mcp_testrail"]
}
}
}
Configuration Notes
- Replace
/absolute/path/to/testrail/with the actual path to your server directory - Using
uvx(default): Automatically manages dependencies in isolated environments (likenpxfor Node.js) - Using
python(alternative): Requirespip install bibliocommons-mcp-testrailfirst - After adding the configuration, restart your AI client for changes to take effect
Docker
# Pull from Docker Hub (private)
docker pull bibliocommons/mcp-testrail:latest
# Run in stdio mode
docker run -i --rm \
-v /path/to/config.json:/config.json:ro \
bibliocommons/mcp-testrail:latest \
--config /config.json
# Run in HTTP mode
docker run -d --rm \
-v /path/to/config.json:/config.json:ro \
-p 8000:8000 \
bibliocommons/mcp-testrail:latest \
--config /config.json --transport http --port 8000
# Run in expanded mode
docker run -i --rm \
-v /path/to/config.json:/config.json:ro \
bibliocommons/mcp-testrail:latest \
--config /config.json --expanded
Web UI with Swagger
A REST API with interactive Swagger documentation is available:
python -m bibliocommons_mcp_testrail.webui
Access the Swagger UI at: [http://localhost:8000/docs]
The Web UI provides:
- Interactive API documentation
- Try-it-out functionality for all endpoints
- OpenAPI/Swagger specification
- REST API access to all MCP tools
Standalone MCP Server
python -m bibliocommons_mcp_testrail
CLI Flags
| Flag | Env Var | Description |
|---|---|---|
--config PATH |
TESTRAIL_CONFIG |
Path to config.json |
--read-only |
TESTRAIL_READ_ONLY |
Exclude destructive tools (add/update/delete operations) |
--expanded |
TESTRAIL_EXPANDED |
Register all tools individually instead of gateway mode |
--transport stdio|http |
TESTRAIL_TRANSPORT |
Transport mode (default: stdio) |
--port PORT |
TESTRAIL_PORT |
HTTP port (default: 8000) |
--version |
— | Show version and exit |
Gateway Mode (Default)
By default, the server exposes 2 tools instead of 40+ individual tools:
| Tool | Purpose |
|---|---|
testrail_api |
Execute any TestRail action by name with a params dict |
testrail_help |
Search available actions, parameters, and descriptions |
The AI assistant calls testrail_help to discover available actions, then calls testrail_api(action="get_cases", params={"project_id": 1, "suite_id": 5}) to execute them.
To register all individual tools (previous behavior), use --expanded:
python -m bibliocommons_mcp_testrail --expanded
Available Tools
Projects
get_projects- List all projectsget_project- Get project by IDadd_project- Create a new projectupdate_project- Update a projectdelete_project- Delete a project
Suites
get_suites- List suites for a projectget_suite- Get suite by IDadd_suite- Create a new suiteupdate_suite- Update a suitedelete_suite- Delete a suite
Cases
get_case- Get test case by ID (full details)get_cases- List test cases for a project with optional filtersadd_case- Create a new test caseupdate_case- Update a test caseupdate_cases- Bulk update multiple test casesdelete_case- Delete a test caseget_case_types- List available case typesget_case_fields- List available case fieldscopy_to_section- Copy test cases to a sectionmove_to_section- Move test cases to a sectionget_case_history- Get change history for a test caseget_bdd- Export BDD test case as .feature fileadd_bdd- Import BDD .feature file into a section
Sections
get_section- Get section by IDget_sections- List sections for a projectadd_section- Create a new sectionmove_section- Move a sectionupdate_section- Update a sectiondelete_section- Delete a section
Runs
get_runs- List test runs for a projectget_run- Get test run by IDadd_run- Create a new test runupdate_run- Update a test runclose_run- Close a test rundelete_run- Delete a test run
Tests
get_tests- List tests in a runget_test- Get test by ID
Results
get_results- Get results for a testget_results_for_case- Get results for a case in a runget_results_for_run- Get all results for a runadd_result_for_case- Add a result for a case in a runadd_results_for_cases- Bulk add results for multiple cases
Plans
get_plans- List test plans for a projectget_plan- Get test plan by IDadd_plan- Create a new test plan
Milestones
get_milestones- List milestones for a projectget_milestone- Get milestone by ID
Shared Steps
get_shared_steps- List shared steps for a projectget_shared_step- Get shared step by ID
Metadata
Release files for bibliocommons-mcp-testrail 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bibliocommons_mcp_testrail-1.0.1.tar.gz | 20.5 kB | Without provenance | Details for bibliocommons_mcp_testrail-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bibliocommons_mcp_testrail-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for bibliocommons_mcp_testrail-1.0.1-py3-none-any.whl |
Total release size: 33.3 kB
Release files / bibliocommons_mcp_testrail-1.0.1.tar.gz
| Download URL | bibliocommons_mcp_testrail-1.0.1.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ee28c3dd5578376ef973ab43ac9cb78c7b7374b9f4473776e8265249a7e6a13
|
|
BLAKE2b-256 checksum How to use checksums |
29ef7f45400c413515f51ec9a85d9e051eacfbf25c2d21734ba2c85144624b5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / bibliocommons_mcp_testrail-1.0.1-py3-none-any.whl
| Download URL | bibliocommons_mcp_testrail-1.0.1-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
428a6145fc18d818b587eef62b3d9639a2ab74fcb2e6edab028208c877ab0f0d
|
|
BLAKE2b-256 checksum How to use checksums |
ec9427380dcf598ba0458de559b2d5753982932754104d4ffdf47dacd5a46ef6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for bibliocommons-mcp-testrail 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.