Skip to main content

TestRail MCP Server

Project description

TestRail MCP Server

smithery badge

A Model Context Protocol (MCP) server for TestRail that allows interaction with TestRail's core entities through a standardized protocol.

Features

  • Authentication with TestRail API
  • Access to TestRail entities:
    • Projects
    • Cases
    • Runs
    • Results
    • Datasets
  • Full support for the Model Context Protocol
  • Compatible with any MCP client (Claude Desktop, Cursor, Winsurf, etc.)

Installation

Installing via Smithery

To install testrail-mcp for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @sker65/testrail-mcp --client claude

Manual Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/testrail-mcp.git
    cd testrail-mcp
    
  2. Create and activate a virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  3. Install dependencies:

    pip install -e .
    

Configuration

The TestRail MCP server requires specific environment variables to authenticate with your TestRail instance. These must be set before running the server.

  1. Create a .env file in the root directory of the project:

    TESTRAIL_URL=https://your-instance.testrail.io
    TESTRAIL_USERNAME=your-email@example.com
    TESTRAIL_API_KEY=your-api-key
    

    Important Notes:

    • TESTRAIL_URL should be the full URL to your TestRail instance (e.g., https://example.testrail.io)
    • TESTRAIL_USERNAME is your TestRail email address used for login
    • TESTRAIL_API_KEY is your TestRail API key (not your password)
      • To generate an API key, log in to TestRail, go to "My Settings" > "API Keys" and create a new key
  2. Verify that the configuration is loaded correctly:

    python -c "from testrail_mcp.config import TESTRAIL_URL, TESTRAIL_USERNAME, TESTRAIL_API_KEY; print(f'URL: {TESTRAIL_URL}, Username: {TESTRAIL_USERNAME}, API Key: {TESTRAIL_API_KEY[:5]}...')"
    

    This should print your TestRail URL, username, and the first few characters of your API key.

If you're using this server with a client like Claude Desktop or Cursor, make sure the environment variables are accessible to the process running the server. You may need to set these variables in your system environment or ensure they're loaded from the .env file.

Usage

Running the Server

The server can be run directly as a Python module:

python -m testrail_mcp

This will start the MCP server in stdio mode, which can be used with MCP clients that support stdio communication.

Using with MCP Clients

Claude Desktop

  1. Open Claude Desktop
  2. Go to Settings > Servers
  3. Click "Install Server"
  4. Navigate to your project directory
  5. Select the Python module: testrail_mcp
  6. Claude Desktop will now be able to use your TestRail MCP server

Cursor

  1. Open Cursor
  2. Go to Settings > AI > Custom Tools
  3. Click "Add Tool"
  4. Configure the tool:
    • Name: TestRail MCP
    • Command: python -m testrail_mcp
    • Communication: Stdio
  5. Save the configuration

Winsurf

  1. Open Winsurf
  2. Go to Settings > Tools
  3. Click "Add Tool"
  4. Configure the tool:
    • Name: TestRail MCP
    • Command: python -m testrail_mcp
    • Protocol: MCP
  5. Save the configuration

Testing with MCP Inspector

For testing and debugging, you can use the MCP Inspector:

npx @modelcontextprotocol/inspector stdio -- python -m testrail_mcp

This will open a web interface where you can explore and test all the available tools and resources.

Development

This server is built using:

  • FastMCP - A Python framework for building MCP servers
  • Requests - For HTTP communication with TestRail API
  • python-dotenv - For environment variable management

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

testrail_mcp-0.1.3.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

testrail_mcp-0.1.3-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file testrail_mcp-0.1.3.tar.gz.

File metadata

  • Download URL: testrail_mcp-0.1.3.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for testrail_mcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3a3aeade1aea5c1248ca7dc878efefddea9efd0ab76a8c2fcdfafd15b967c8e1
MD5 d9ef678814fad26ad8ec2b8df329483c
BLAKE2b-256 3a10098999bc97c764c83119fdc4a5fd41492d556a63bbbe1715c110e7262242

See more details on using hashes here.

File details

Details for the file testrail_mcp-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: testrail_mcp-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for testrail_mcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b42681be8002f7c6c27ecad5c0525e7d30585ebce87d0b317fec5e168814e965
MD5 14fda2dd4968700f449b5458d246ad5c
BLAKE2b-256 f353747a63bdb114183cfda7c43fa1fc861c947d4cc5477f8e0cdf4913d319d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page