TestRail MCP Server

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.

Category
Visit Server

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)

  1. 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

  1. 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"
      }
    }
  }
}
  1. 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 ID
  • add_case - Create a new test case in a section
  • update_case - Update a TestRail test case
  • get_projects - List all TestRail projects
  • get_project - Get project details
  • get_suites - Get test suites for a project
  • get_suite - Get suite details
  • get_cases - Get test cases with filtering
  • add_attachment_to_case - Upload file attachment
  • get_sections - Get test sections
  • get_runs - Get test runs
  • get_run - Get run details
  • update_run - Update test run
  • get_tests - Get tests in a run
  • get_test - Get test details
  • update_test - Update test
  • add_result - Add test result
  • get_case_fields - Get available custom fields for test cases

Troubleshooting

Common Issues:

  1. Server not found: Ensure the path to dist/server.js is correct
  2. Authentication errors: Verify your TestRail credentials in the environment variables
  3. Permission denied: Make sure the server file is executable
  4. 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured