You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains a ReportPortal MCP Server.
8
-
It allows users to interact with ReportPortal directly from GitHub Copilot / Claude / etc chat to query and analyze test execution results.
7
+
## What is the ReportPortal MCP Server?
8
+
9
+
The ReportPortal MCP Server is a bridge between your ReportPortal instance and AI chat assistants (such as Claude Desktop, GitHub Copilot, Cursor). In simple terms, it lets you ask questions in plain English about your test runs and get answers directly from ReportPortal. It follows the official [MCP](https://modelcontextprotocol.io/overview) guidelines.
10
+
11
+
For example, instead of logging into the ReportPortal UI, you could ask your AI assistant "What tests failed in the last run?" or "List the 5 most recent test runs," and it will fetch that information from ReportPortal for you. This makes it easy for QA testers and managers to query test results using natural language, speeding up analysis and reporting.
12
+
13
+
## Why Use It?
14
+
15
+
-**Quick Test Insights**: Instantly retrieve summaries of test runs, failure counts, or error details without writing code or navigating the UI.
16
+
-**Chat-Based Queries**: Use your favourite AI assistant (Claude, Cursor, etc.) to converse with ReportPortal data. It's like having a smart test-reporting helper in your chat window.
17
+
-**Integration Flexibility**: Works with any MCP-compatible AI tool. You simply point the tool at this server and it can run ReportPortal queries under the hood.
18
+
-**No Custom Scripts Needed**: Common queries (listing runs, getting failures, analysis) are built-in as simple "commands" you invoke via chat.
19
+
20
+
## Installation
21
+
22
+
There are two ways to run the latest version of the ReportPortal MCP Server.
23
+
Each of this way is suitable for any LLM provider.
24
+
25
+
### Via Docker (recommended).
26
+
27
+
The MCP server is available on the official ReportPortal's [DockerHub](https://hub.docker.com/r/reportportal/mcp-server).
The OS pre-built binaries can be downloaded from the official releases on [GitHub](https://github.com/reportportal/reportportal-mcp-server/releases).
2. Click **GitHub Copilot icon in the status bar → Edit Settings → Model Context Protocol → Configure**.
144
+
3. Add configuration:
145
+
```json
146
+
{
147
+
"servers": {
148
+
"reportportal": {
149
+
// choose the Docker or binary configuration from the section above
150
+
}
151
+
}
152
+
}
153
+
```
154
+
4. Press `Ctrl + S` or `Command + S` to save, or close the `mcp.json` file. The configuration should take effect immediately and restart all the MCP servers defined. You can restart the IDE if needed.
Once connected, your AI assistant will list ReportPortal-related "tools" it can invoke. You can then ask your questions in chat, and the assistant will call those tools on your behalf.
9
159
10
160
## Features
11
161
12
162
The ReportPortal MCP server provides a comprehensive set of capabilities for interacting with ReportPortal:
13
163
14
164
### Launch Management
15
-
-List and filter launches with pagination
165
+
-Get and filter launches (test runs) with pagination
16
166
- Get launch details by name or ID
17
-
- Forcefinish running launches
167
+
- Force-finish running launches
18
168
- Delete launches
19
-
- Run automated analysis on launches (auto analysis, unique error analysis)
169
+
- Run automated analysis (auto analysis, unique error analysis) on launches
20
170
21
171
### Test Item Analysis
22
-
-List test items within launches
23
-
- Get detailed test item information
172
+
-Get test items within by filter
173
+
- Get detailed information on each test item
24
174
- View test execution statistics and failures
175
+
- Retrieve test logs and attachments
25
176
26
177
### Report Generation
27
178
- Analyze launches to get detailed test execution insights
28
179
- Generate structured reports with statistics and failure analysis
29
180
30
-
### Extensibility
31
-
- Add custom tools through code extensions
32
-
- Define new prompts via YAML files in the `prompts` directory
33
-
- Access structured resource data for launches and test items
| Get Launches by filter | Lists ReportPortal launches with pagination by filter |`name`, `description`, `owner`, `number`, `start_time`, `end_time`, `attributes`, `sort`, `page`, `page-size` (all optional) |
186
+
| Get Last Launch by Name | Retrieves the most recent launch by name |`name`|
187
+
| Run Auto Analysis | Runs auto analysis on a launch |`launch_id`, `analyzer_mode`, `analyzer_type`, `analyzer_item_modes`|
188
+
| Run Unique Error Analysis | Runs unique error analysis on a launch |`launch_id`, `remove_numbers`|
189
+
| Force Finish Launch | Forces a launch to finish |`launch_id`|
190
+
| Delete Launch | Deletes a specific launch |`launch_id`|
191
+
| Get Suites by filter | Lists test suites for a specific launch |`launch-id` (required), `name`, `description`, `start_time_from`, `start_time_to`, `attributes`, `parent_id`, `sort`, `page`, `page-size` (all optional) |
192
+
| Get Test Items by filter | Lists test items for a specific launch |`launch-id` (required), `name`, `description`, `status`, `has_retries`, `start_time_from`, `start_time_to`, `attributes`, `parent_id`, `defect_comment`, `auto_analyzed`, `ignored_in_aa`, `pattern_name`, `ticket_id`, `sort`, `page`, `page-size` (all optional) |
193
+
| Get Logs by filter | Lists logs for a specific test item or nested step |`parent-id` (required), `log_level`, `log_content`, `logs_with_attachments`, `status`, `sort`, `page`, `page-size` (all optional) |
194
+
| Get Attachment by ID | Retrieves an attachment binary by id |`attachment_id`|
195
+
| Run Unique Error Analysis | Runs unique error analysis on a launch |`launch_id`, `remove_numbers`|
196
+
| Get Test Item by ID | Retrieves details of a specific test item |`test_item_id`|
36
197
37
-
### Prerequisites
198
+
### Available Prompts
199
+
200
+
#### Analyze Launch
201
+
202
+
Analyzes a ReportPortal launch and provides detailed information about test results, failures, and statistics.
203
+
204
+
Parameters:
205
+
-`launch_id`: ID of the launch to analyze
206
+
207
+
You can follow the [prompt text and structure](https://github.com/reportportal/reportportal-mcp-server/blob/main/internal/reportportal/prompts/launch.yaml) as a reference while working on your own prompts.
208
+
209
+
### Example Queries (Natural Language)
210
+
211
+
Here are some real-world examples of what you might ask your AI after setup (the assistant's response will be drawn from ReportPortal data):
38
212
213
+
-**"List the 5 most recent test launches."** – returns a paginated list of recent test runs with names and statuses.
214
+
-**"What tests failed in the latest run?"** – shows failed test items for the most recent launch.
215
+
-**"Show me details of launch with number 1234."** – fetches information (ID, name, description, stats) for that specific launch.
216
+
-**"Run an analysis on launch ABC."** – triggers the ReportPortal's auto-analysis to summarize results and failures for launch "ABC".
217
+
-**"Finish the running launch with ID 4321."** – forces a currently running test launch to stop.
218
+
-**"Show me the top five 500-level errors in the last hour"** - lists the top 5 such errors from the recent test results.
219
+
220
+
Each query above corresponds to a "tool" provided by the MCP server, but you just phrase it naturally.
221
+
The AI will invoke the correct command behind the scenes.
222
+
These features let you query and manage your test reports in many ways through simple chat interactions.
223
+
224
+
## For developers
225
+
226
+
### Prerequisites
39
227
- Go 1.24.1 or later
40
228
- A ReportPortal instance
41
229
@@ -50,89 +238,67 @@ cd reportportal-mcp-server
50
238
go build -o reportportal-mcp-server ./cmd/reportportal-mcp-server
51
239
```
52
240
53
-
## Configuration
241
+
This creates an executable called `reportportal-mcp-server`.
54
242
55
-
The server uses environment variables for configuration:
| List Launches | Lists ReportPortal launches with pagination |`page` (optional), `page-size` (optional) |
83
-
| Get Last Launch by Name | Retrieves the most recent launch by name |`launch`|
84
-
| Force Finish Launch | Forces a launch to finish |`launch_id`|
85
-
| Delete Launch | Deletes a specific launch |`launch_id`|
86
-
| Get Last Launch by Filter | Retrieves the most recent launch by filters |`name`, `description`, `uuid`, `status`, `start_time`, `end_time`, `attributes`, `mode`, `sort` (all optional)|
87
-
| List Test Items by Launch | Lists test items for a specific launch |`launch-id`, `page` (optional), `page-size` (optional) |
88
-
| Get Test Item by ID | Retrieves details of a specific test item |`test_item_id`|
89
-
| Run Auto Analysis | Runs auto analysis on a launch |`launch_id`, `analyzer_mode`, `analyzer_type`, `analyzer_item_modes`|
90
-
| Run Unique Error Analysis | Runs unique error analysis on a launch |`launch_id`, `remove_numbers`|
91
-
92
-
### Available Prompts
262
+
### Starting the Server
93
263
94
-
#### Analyze Launch
264
+
After configuring the env vars as above, simply run:
95
265
96
-
Analyzes a ReportPortal launch and provides detailed information about test results, failures, and statistics.
97
-
98
-
Parameters:
99
-
-`launch_id`: ID of the launch to analyze
266
+
```bash
267
+
./reportportal-mcp-server
268
+
```
100
269
101
-
### Available Resources
270
+
This will start the MCP server on the configured port.
| Launch Resource | Structured access to launch data | • Basic launch info (ID, name, description)<br>• Test execution statistics<br>• Timing information<br>• Status and execution mode |
106
-
| Test Item Resource | Structured access to test item data | • Basic test item info (ID, name, description)<br>• Test execution status and type<br>• Parent information and hierarchy position<br>• Issue details (when applicable)<br>• Timing information (start time, end time, duration)<br>• Test attributes and parameters<br>• Path to the test in the test suite hierarchy |
272
+
Once running, the MCP server is ready to accept queries from your AI tool.
107
273
108
-
This table format makes the available resources more scannable while preserving all the key information about each resource type.
274
+
### Development
109
275
110
-
## Development
276
+
To set up a development environment or contribute:
111
277
112
-
### Setting up Development Environment
278
+
### Task Tool
279
+
Install Go Task v3:
113
280
```bash
114
-
# Install Task
115
281
go install github.com/go-task/task/v3/cmd/task@latest
282
+
```
116
283
117
-
# Install dependencies
284
+
### Dependencies
285
+
Run task deps to install Go dependencies:
286
+
```bash
118
287
task deps
119
288
```
120
289
121
-
### Building
290
+
### Build
122
291
```bash
123
-
# Build the server
124
292
task build
125
293
```
126
294
127
-
### Running Tests
295
+
### Tests
128
296
```bash
129
-
# Run all tests
130
297
task test
131
298
```
132
299
133
-
### Running the MCP Server
300
+
### Build with Docker
134
301
```bash
135
-
# Build Docker Image
136
302
task docker:build
137
303
```
138
304
@@ -153,21 +319,16 @@ task inspector
153
319
### Code Quality
154
320
155
321
```bash
156
-
#Run linters
322
+
#Lint
157
323
task lint
158
324
159
-
# Format code
325
+
# Format
160
326
task fmt
161
327
```
162
328
163
-
### Docker
329
+
### Extending the Server
164
330
165
-
```bash
166
-
# Build Docker image
167
-
task docker:build
168
-
```
169
-
170
-
### Adding New Tools
331
+
#### Adding new Tools
171
332
172
333
To add a new tool, create a new method in the appropriate resource file and add it to the server in the `NewServer` function:
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.
0 commit comments