reportportal-mcp-server

reportportal-mcp-server

3.4

If you are the rightful owner of reportportal-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The ReportPortal MCP Server allows users to interact with ReportPortal directly from chat interfaces like GitHub Copilot or Claude to query and analyze test execution results.

ReportPortal MCP Server

This repository contains a ReportPortal MCP Server. It allows users to interact with ReportPortal directly from GitHub Copilot / Claude / etc chat to query and analyze test execution results.

Features

The ReportPortal MCP server provides a comprehensive set of capabilities for interacting with ReportPortal:

Launch Management

  • List and filter launches with pagination
  • Get launch details by name or ID
  • Force finish running launches
  • Delete launches
  • Run automated analysis on launches (auto analysis, unique error analysis)

Test Item Analysis

  • List test items within launches
  • Get detailed test item information
  • View test execution statistics and failures

Report Generation

  • Analyze launches to get detailed test execution insights
  • Generate structured reports with statistics and failure analysis

Extensibility

  • Add custom tools through code extensions
  • Define new prompts via YAML files in the prompts directory
  • Access structured resource data for launches and test items

Installation

Prerequisites

  • Go 1.24.1 or later
  • A ReportPortal instance

Building from Source

# Clone the repository
git clone https://github.com/reportportal/reportportal-mcp-server.git
cd reportportal-mcp-server

# Build the binary
go build -o reportportal-mcp-server ./cmd/reportportal-mcp-server

Configuration

The server uses environment variables for configuration:

VariableDescriptionDefault
RP_HOSTReportPortal host URL
RP_API_TOKENReportPortal API token
RP_PROJECT(optional) ReportPortal project name
MCP_PORT(optional) Port to run the MCP server on4389

Usage

Starting the Server

# Set required environment variables
export RP_HOST="https://your-reportportal-instance.com"
export RP_PROJECT="your-project"
export RP_TOKEN="your-api-token"

# Run the server
./reportportal-mcp-server

Available Tools

Tool NameDescriptionParameters
List LaunchesLists ReportPortal launches with paginationpage (optional), page-size (optional)
Get Last Launch by NameRetrieves the most recent launch by namelaunch
Force Finish LaunchForces a launch to finishlaunch_id
Delete LaunchDeletes a specific launchlaunch_id
Get Last Launch by FilterRetrieves the most recent launch by filtersname, description, uuid, status, start_time, end_time, attributes, mode, sort (all optional)
List Test Items by LaunchLists test items for a specific launchlaunch-id, page (optional), page-size (optional)
Get Test Item by IDRetrieves details of a specific test itemtest_item_id
Run Auto AnalysisRuns auto analysis on a launchlaunch_id, analyzer_mode, analyzer_type, analyzer_item_modes
Run Unique Error AnalysisRuns unique error analysis on a launchlaunch_id, remove_numbers

Available Prompts

Analyze Launch

Analyzes a ReportPortal launch and provides detailed information about test results, failures, and statistics.

Parameters:

  • launch_id: ID of the launch to analyze

Available Resources

Resource TypeDescriptionProperties
Launch ResourceStructured access to launch data• Basic launch info (ID, name, description)
• Test execution statistics
• Timing information
• Status and execution mode
Test Item ResourceStructured access to test item data• Basic test item info (ID, name, description)
• Test execution status and type
• Parent information and hierarchy position
• Issue details (when applicable)
• Timing information (start time, end time, duration)
• Test attributes and parameters
• Path to the test in the test suite hierarchy

This table format makes the available resources more scannable while preserving all the key information about each resource type.

Development

Setting up Development Environment

# Install Task
go install github.com/go-task/task/v3/cmd/task@latest

# Install dependencies
task deps

Building

# Build the server
task build

Running Tests

# Run all tests
task test

Running the MCP Server

# Build Docker Image
task docker:build

Debugging with MCP Inspector

The modelcontextprotocol/inspector tool is useful for testing and debugging MCP servers locally:

npx @modelcontextprotocol/inspector docker run -i --rm -e "RP_API_TOKEN=$RP_API_TOKEN" -e "RP_PROJECT=$RP_PROJECT" -e "RP_HOST=$RP_HOST" reportportal-mcp-server

Alternatively, you can use the Task command:

# Run inspector against your local server
task inspector

Code Quality

# Run linters
task lint

# Format code
task fmt

Docker

# Build Docker image
task docker:build

Adding New Tools

To add a new tool, create a new method in the appropriate resource file and add it to the server in the NewServer function:

// In your resource file (e.g., launches.go)
func (lr *LaunchResources) toolNewFeature() (tool mcp.Tool, handler server.ToolHandlerFunc) {
    // Implement your tool
}

// In server.go
func NewServer(...) *server.MCPServer {
    // ...
    s.AddTool(launches.toolNewFeature())
    // ...
}

Adding New Prompts

To add a new prompt, simply create a YAML file describing your prompt and place it in the prompts folder at the root of the project. The server will automatically read and initialize all prompts from this directory on startup—no code changes are required.

Example:

  1. Use an existing or create a new file, e.g., my_custom_prompt.yaml, in the prompts folder.
  2. Define your prompt logic and parameters in YAML format.
  3. Rebuild the server to load the new prompt.

This approach allows you to extend the server's capabilities with custom prompts quickly and without modifying the codebase.

License

This project is licensed under the .