Cover image
Try Now
2025-04-14

MCP服务器用于testrail

3 years

Works with Finder

1

Github Watches

1

Github Forks

1

Github Stars

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, Windsurf, 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:

    uvx testrail-mcp --config
    

    This will display your TestRail configuration information, including your URL, username, and the first few characters of your API key for verification.

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 using the installed script:

uvx 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

In Claude Desktop, add a new server with the following configuration:

{
  "mcpServers": {
    "testrail": {
      "command": "uvx",
      "args": [
        "testrail-mcp"
      ],
      "env": {
        "TESTRAIL_URL": "https://your-instance.testrail.io",
        "TESTRAIL_USERNAME": "your-email@example.com",
        "TESTRAIL_API_KEY": "your-api-key"
      }
    }
  }
}

Cursor

In Cursor, add a new custom tool with the following configuration:

{
  "name": "TestRail MCP",
  "command": "uvx",
  "args": [
    "testrail-mcp"
  ],
  "env": {
    "TESTRAIL_URL": "https://your-instance.testrail.io",
    "TESTRAIL_USERNAME": "your-email@example.com",
    "TESTRAIL_API_KEY": "your-api-key"
  }
}

Windsurf

In Windsurf, add a new tool with the following configuration:

{
  "name": "TestRail MCP",
  "command": "uvx",
  "args": [
    "testrail-mcp"
  ],
  "env": {
    "TESTRAIL_URL": "https://your-instance.testrail.io",
    "TESTRAIL_USERNAME": "your-email@example.com",
    "TESTRAIL_API_KEY": "your-api-key"
  }
}

Testing with MCP Inspector

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

npx @modelcontextprotocol/inspector \
  -e TESTRAIL_URL=<your-url> \
  -e TESTRAIL_USERNAME=<your-username> \
  -e TESTRAIL_API_KEY=<your-api-key> \
  uvx 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

相关推荐

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • hkr04
  • 轻巧的C ++ MCP(模型上下文协议)SDK

  • sigoden
  • 使用普通的bash/javascript/python函数轻松创建LLM工具和代理。

  • RockChinQ
  • 😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack

  • modelscope
  • 开始以更轻松的方式开始构建具有LLM授权的多代理应用程序。

  • dmayboroda
  • 带有可配置容器的本地对话抹布

    Reviews

    1.8 (6)
    Avatar
    user_zRHXSGNj
    2025-04-26

    TestRail-MCP by sker65 is an exceptional product for managing and tracking test cases with ease. It's user-friendly and integrates seamlessly with existing workflows, making it indispensable for QA teams. The detailed reports and customizable features enhance productivity, ensuring high-quality software delivery. Highly recommended!

    Avatar
    user_Zt6jMXHO
    2025-04-26

    As a dedicated user of the testrail-mcp application, I am continually impressed by its seamless integration and user-friendly interface. The tool, developed by sker65, streamlines our testing processes efficiently. Its robust features and intuitive design make it an essential part of our workflow. We highly recommend it for any team looking to enhance their testing capabilities.

    Avatar
    user_av5ddkFt
    2025-04-26

    As a dedicated user of TestRail-MCP by sker65, I can confidently say it's a game-changer for test management. The intuitive interface and robust features streamline the entire testing process, making it efficient and more organized. Highly recommend this product for any QA team looking to enhance their workflow!

    Avatar
    user_sOxDnpj8
    2025-04-26

    As a dedicated user of testrail-mcp by sker65, I am thoroughly impressed with its seamless integration and efficient management of test cases. The streamlined interface and robust features have significantly improved our testing workflow. Highly recommended for anyone seeking to optimize their testing process!

    Avatar
    user_clcC3BkL
    2025-04-26

    As a dedicated user of testrail-mcp, I am thoroughly impressed by its functionality and user-friendliness. The tool, crafted by sker65, has streamlined our testing processes magnificently. It's a comprehensive solution for managing test cases and tracking results, immensely improving productivity and accuracy. Highly recommended for anyone looking to enhance their software testing workflow!

    Avatar
    user_ChuUfA6X
    2025-04-26

    I have been using testrail-mcp by sker65 for a while now, and it's a game-changer. Its intuitive interface and robust features make managing test cases a breeze. Highly recommended for any QA team looking to streamline their testing process. I particularly appreciate the seamless integration capabilities and the excellent customer support. A must-have tool for serious testers!