@smartbear/mcp 0.2.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +207 -60
- package/dist/api-hub/client.js +298 -52
- package/dist/common/server.js +145 -0
- package/dist/index.js +31 -22
- package/dist/insight-hub/client/api/CurrentUser.js +9 -3
- package/dist/insight-hub/client/api/Error.js +81 -0
- package/dist/insight-hub/client/api/Project.js +19 -1
- package/dist/insight-hub/client/api/base.js +10 -2
- package/dist/insight-hub/client.js +524 -357
- package/dist/package.json +15 -5
- package/dist/pactflow/client/ai.js +127 -0
- package/dist/pactflow/client/base.js +1 -0
- package/dist/pactflow/client/tools.js +46 -0
- package/dist/pactflow/client.js +132 -0
- package/dist/reflect/client.js +100 -18
- package/dist/tests/unit/common/server.test.js +319 -0
- package/dist/tests/unit/insight-hub/api-utilities.test.js +31 -0
- package/dist/tests/unit/insight-hub/client.test.js +852 -0
- package/dist/tests/unit/insight-hub/filters.test.js +93 -0
- package/dist/tests/unit/pactflow/ai.test.js +21 -0
- package/dist/tests/unit/pactflow/client.test.js +67 -0
- package/dist/tests/unit/pactflow/tools.test.js +34 -0
- package/dist/vitest.config.js +57 -0
- package/package.json +15 -5
- package/api-hub/README.md +0 -29
- package/assets/smartbear-logo-dark.svg +0 -17
- package/assets/smartbear-logo-light.svg +0 -17
- package/dist/common/templates.js +0 -54
- package/insight-hub/README.md +0 -42
- package/reflect/README.md +0 -25
package/README.md
CHANGED
|
@@ -1,24 +1,59 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<a href="https://www.smartbear.com">
|
|
3
3
|
<picture>
|
|
4
|
-
<source media="(prefers-color-scheme: dark)" srcset="assets/
|
|
5
|
-
<img alt="SmartBear logo" src="assets/
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://assets.smartbear.com/m/79b99a7ff9c81a9a/original/SmartBear-Logo_Dark-Mode.svg">
|
|
5
|
+
<img alt="SmartBear logo" src="https://assets.smartbear.com/m/105001cc5db1e0bf/original/SmartBear-Logo_Light-Mode.svg">
|
|
6
6
|
</picture>
|
|
7
7
|
</a>
|
|
8
8
|
<h1>SmartBear MCP server</h1>
|
|
9
|
+
|
|
10
|
+
<!-- Badges -->
|
|
11
|
+
<div>
|
|
12
|
+
<a href="https://github.com/SmartBear/smartbear-mcp/actions/workflows/test.yml"><img src="https://github.com/SmartBear/smartbear-mcp/workflows/Test%20Suite/badge.svg" alt="Test Status"></a>
|
|
13
|
+
<a href="https://smartbear.github.io/smartbear-mcp/"><img src="https://img.shields.io/badge/coverage-dynamic-brightgreen" alt="Coverage"></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/@smartbear/mcp"><img src="https://img.shields.io/npm/v/@smartbear/mcp" alt="npm version"></a>
|
|
15
|
+
<a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-Compatible-blue" alt="MCP Compatible"></a>
|
|
16
|
+
<a href="https://developer.smartbear.com/smartbear-mcp"><img src="https://img.shields.io/badge/documentation-latest-blue.svg" alt="Documentation"></a>
|
|
17
|
+
</div>
|
|
9
18
|
</div>
|
|
19
|
+
<br />
|
|
20
|
+
|
|
21
|
+
A Model Context Protocol (MCP) server which provides AI assistants with seamless access to SmartBear's suite of testing and monitoring tools, including [Insight Hub](https://www.smartbear.com/insight-hub), [Reflect](https://reflect.run), [API Hub](https://www.smartbear.com/api-hub), [PactFlow](https://pactflow.io/) and [Pact Broker](https://docs.pact.io/)
|
|
22
|
+
|
|
23
|
+
## What is MCP?
|
|
24
|
+
|
|
25
|
+
The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) is an open standard that enables AI assistants to securely connect to external data sources and tools. This server exposes SmartBear's APIs through natural language interfaces, allowing you to query your testing data, analyze performance metrics, and manage test automation directly from your AI workflow.
|
|
26
|
+
|
|
27
|
+
## Supported Tools
|
|
28
|
+
|
|
29
|
+
See individual guides for suggested prompts and supported tools and resources:
|
|
30
|
+
|
|
31
|
+
- [Insight Hub](https://developer.smartbear.com/smartbear-mcp/docs/insight-hub-integration) - Comprehensive error monitoring and debugging capabilities
|
|
32
|
+
- [Test Hub](https://developer.smartbear.com/smartbear-mcp/docs/test-hub-integration) - Test management and execution capabilities
|
|
33
|
+
- [API Hub](https://developer.smartbear.com/smartbear-mcp/docs/api-hub-integration) - Portal management capabilities
|
|
34
|
+
- [PactFlow](https://developer.smartbear.com/pactflow/default/getting-started) - Contract testing capabilities
|
|
10
35
|
|
|
11
|
-
An [MCP](https://modelcontextprotocol.io) server for SmartBear's API Hub, Test Hub and Insight Hub.
|
|
12
36
|
|
|
13
|
-
##
|
|
37
|
+
## Prerequisites
|
|
14
38
|
|
|
15
|
-
|
|
39
|
+
- Node.js 20+ and npm
|
|
40
|
+
- Access to SmartBear products (Insight Hub, Reflect, or API Hub)
|
|
41
|
+
- Valid API tokens for the products you want to integrate
|
|
16
42
|
|
|
17
|
-
|
|
43
|
+
## Installation
|
|
18
44
|
|
|
19
|
-
|
|
45
|
+
The MCP server is distributed as an npm package [`@smartbear/mcp`](https://www.npmjs.com/package/@smartbear/mcp), making it easy to integrate into your development workflow.
|
|
20
46
|
|
|
21
|
-
|
|
47
|
+
The server is started with the API key or auth token that you use with your SmartBear product(s). They are optional and can be removed from your configuration if you aren't using the product. For Insight Hub, if you provide a project API key it will narrow down all searches to a single project in your Insight Hub dashboard. Leave this field blank if you wish to interact across multiple projects at a time.
|
|
48
|
+
|
|
49
|
+
### VS Code with Copilot
|
|
50
|
+
|
|
51
|
+
For the quickest setup, use the "MCP: Add server…" command in the Command Palette to add the `@smartbear/mcp` npm package.
|
|
52
|
+
|
|
53
|
+
<details>
|
|
54
|
+
<summary><strong>📋 Manual installation</strong></summary>
|
|
55
|
+
|
|
56
|
+
Alternatively, you can use `npx` (or globally install) the `@smartbear/mcp` package to run the server and add the following to your `.vscode/mcp.json` file:
|
|
22
57
|
|
|
23
58
|
```json
|
|
24
59
|
{
|
|
@@ -34,7 +69,11 @@ If setting up manually, add the following configuration to `.vscode/mcp.json`:
|
|
|
34
69
|
"INSIGHT_HUB_AUTH_TOKEN": "${input:insight_hub_auth_token}",
|
|
35
70
|
"INSIGHT_HUB_PROJECT_API_KEY": "${input:insight_hub_project_api_key}",
|
|
36
71
|
"REFLECT_API_TOKEN": "${input:reflect_api_token}",
|
|
37
|
-
"API_HUB_API_KEY": "${input:api_hub_api_key}"
|
|
72
|
+
"API_HUB_API_KEY": "${input:api_hub_api_key}",
|
|
73
|
+
"PACT_BROKER_BASE_URL": "${input:pact_broker_base_url}",
|
|
74
|
+
"PACT_BROKER_TOKEN": "${input:pact_broker_token}",
|
|
75
|
+
"PACT_BROKER_USERNAME": "${input:pact_broker_username}",
|
|
76
|
+
"PACT_BROKER_PASSWORD": "${input:pact_broker_password}"
|
|
38
77
|
}
|
|
39
78
|
}
|
|
40
79
|
},
|
|
@@ -62,80 +101,188 @@ If setting up manually, add the following configuration to `.vscode/mcp.json`:
|
|
|
62
101
|
"type": "promptString",
|
|
63
102
|
"description": "API Hub API Key - leave blank to disable API Hub tools",
|
|
64
103
|
"password": true
|
|
65
|
-
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "pact_broker_base_url",
|
|
107
|
+
"type": "promptString",
|
|
108
|
+
"description": "PactFlow or Pact Broker base url - leave blank to disable the tools",
|
|
109
|
+
"password": true
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"id": "pact_broker_token",
|
|
113
|
+
"type": "promptString",
|
|
114
|
+
"description": "PactFlow Authentication Token",
|
|
115
|
+
"password": true
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"id": "pact_broker_username",
|
|
119
|
+
"type": "promptString",
|
|
120
|
+
"description": "Pact Broker Username",
|
|
121
|
+
"password": true
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "pact_broker_password",
|
|
125
|
+
"type": "promptString",
|
|
126
|
+
"description": "Pact Broker Password",
|
|
127
|
+
"password": true
|
|
128
|
+
},
|
|
66
129
|
]
|
|
67
130
|
}
|
|
68
131
|
```
|
|
132
|
+
</details>
|
|
69
133
|
|
|
70
|
-
###
|
|
134
|
+
### Claude Desktop
|
|
71
135
|
|
|
72
|
-
|
|
136
|
+
Add the following configuration to your `claude_desktop_config.json` to launch the MCP server via `npx`:
|
|
73
137
|
|
|
74
|
-
```
|
|
75
|
-
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"mcpServers": {
|
|
141
|
+
"smartbear": {
|
|
142
|
+
"command": "npx",
|
|
143
|
+
"args": [
|
|
144
|
+
"-y",
|
|
145
|
+
"@smartbear/mcp@latest"
|
|
146
|
+
],
|
|
147
|
+
"env": {
|
|
148
|
+
"INSIGHT_HUB_AUTH_TOKEN": "your_personal_auth_token",
|
|
149
|
+
"INSIGHT_HUB_PROJECT_API_KEY": "your_project_api_key",
|
|
150
|
+
"REFLECT_API_TOKEN": "your_reflect_token",
|
|
151
|
+
"API_HUB_API_KEY": "your_api_hub_key",
|
|
152
|
+
"PACT_BROKER_BASE_URL": "your_pactflow_or_pactbroker_base_url",
|
|
153
|
+
"PACT_BROKER_TOKEN": "your_pactflow_token",
|
|
154
|
+
"PACT_BROKER_USERNAME": "your_pact_broker_username",
|
|
155
|
+
"PACT_BROKER_PASSWORD": "your_pact_broker_password",
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
76
160
|
```
|
|
77
161
|
|
|
78
|
-
|
|
162
|
+
## Documentation
|
|
79
163
|
|
|
80
|
-
|
|
164
|
+
For detailed introduction, examples, and advanced configuration visit our 📖 [Full Documentation](https://developer.smartbear.com/smartbear-mcp)
|
|
81
165
|
|
|
82
|
-
|
|
166
|
+
## Local Development
|
|
83
167
|
|
|
84
|
-
|
|
85
|
-
Get your top events and invite your LLM to help you fix them.
|
|
86
|
-
- [Reflect](./reflect/README.md)
|
|
87
|
-
- [API Hub](./api-hub/README.md)
|
|
168
|
+
For developers who want to contribute to the SmartBear MCP server, customize its functionality, or work with the latest development features, you can build and run the server directly from source code. This approach gives you full control over the implementation and allows you to make modifications as needed.
|
|
88
169
|
|
|
89
|
-
|
|
170
|
+
1. **Clone the repository:**
|
|
171
|
+
```bash
|
|
172
|
+
git clone https://github.com/SmartBear/smartbear-mcp.git
|
|
173
|
+
cd smartbear-mcp
|
|
174
|
+
```
|
|
90
175
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
176
|
+
2. **Install dependencies:**
|
|
177
|
+
```bash
|
|
178
|
+
npm install
|
|
179
|
+
```
|
|
95
180
|
|
|
96
|
-
|
|
181
|
+
3. **Build the server:**
|
|
182
|
+
```bash
|
|
183
|
+
npm run build
|
|
184
|
+
```
|
|
97
185
|
|
|
98
|
-
|
|
186
|
+
4. **Add the server to your IDE** configuration updating `.vscode/mcp.json` (or equivalent) to point to your local build
|
|
99
187
|
|
|
100
|
-
|
|
188
|
+
<details>
|
|
189
|
+
<summary><strong>📋 VSCode (mcp.json)</strong></summary>
|
|
101
190
|
|
|
102
|
-
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"servers": {
|
|
194
|
+
"smartbear": {
|
|
195
|
+
"type": "stdio",
|
|
196
|
+
"command": "node",
|
|
197
|
+
"dev": { // <-- To allow debugging in VS Code
|
|
198
|
+
"watch": "dist/**/*.js",
|
|
199
|
+
"debug": {
|
|
200
|
+
"type": "node"
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
"args": ["<PATH_TO_SMARTBEAR_MCP_REPO>/dist/index.js"],
|
|
204
|
+
"env": {
|
|
205
|
+
"INSIGHT_HUB_AUTH_TOKEN": "${input:insight_hub_auth_token}",
|
|
206
|
+
"INSIGHT_HUB_PROJECT_API_KEY": "${input:insight_hub_project_api_key}",
|
|
207
|
+
"REFLECT_API_TOKEN": "${input:reflect_api_token}",
|
|
208
|
+
"API_HUB_API_KEY": "${input:api_hub_api_key}",
|
|
209
|
+
"PACT_BROKER_BASE_URL": "${input:pact_broker_base_url}",
|
|
210
|
+
"PACT_BROKER_TOKEN": "${input:pact_broker_token}",
|
|
211
|
+
"PACT_BROKER_USERNAME": "${input:pact_broker_username}",
|
|
212
|
+
"PACT_BROKER_PASSWORD": "${input:pact_broker_password}"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"inputs": [
|
|
217
|
+
{
|
|
218
|
+
"id": "insight_hub_auth_token",
|
|
219
|
+
"type": "promptString",
|
|
220
|
+
"description": "Insight Hub Auth Token - leave blank to disable Insight Hub tools",
|
|
221
|
+
"password": true
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"id": "insight_hub_project_api_key",
|
|
225
|
+
"type": "promptString",
|
|
226
|
+
"description": "Insight Hub Project API Key - for single project interactions",
|
|
227
|
+
"password": false
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"id": "reflect_api_token",
|
|
231
|
+
"type": "promptString",
|
|
232
|
+
"description": "Reflect API Token - leave blank to disable Reflect tools",
|
|
233
|
+
"password": true
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"id": "api_hub_api_key",
|
|
237
|
+
"type": "promptString",
|
|
238
|
+
"description": "API Hub API Key - leave blank to disable API Hub tools",
|
|
239
|
+
"password": true
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"id": "pact_broker_base_url",
|
|
243
|
+
"type": "promptString",
|
|
244
|
+
"description": "PactFlow or Pact Broker base url - leave blank to disable PactFlow tools",
|
|
245
|
+
"password": true
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"id": "pact_broker_token",
|
|
249
|
+
"type": "promptString",
|
|
250
|
+
"description": "PactFlow Authentication Token",
|
|
251
|
+
"password": true
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"id": "pact_broker_username",
|
|
255
|
+
"type": "promptString",
|
|
256
|
+
"description": "Pact Broker Username",
|
|
257
|
+
"password": true
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"id": "pact_broker_password",
|
|
261
|
+
"type": "promptString",
|
|
262
|
+
"description": "Pact Broker Password",
|
|
263
|
+
"password": true
|
|
264
|
+
},
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
</details>
|
|
103
269
|
|
|
104
|
-
|
|
270
|
+
5. **Local testing** using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) web interface:
|
|
105
271
|
|
|
106
|
-
```bash
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
```
|
|
272
|
+
```bash
|
|
273
|
+
INSIGHT_HUB_AUTH_TOKEN="your_token" REFLECT_API_TOKEN="your_reflect_token" API_HUB_API_KEY="your_api_hub_key" PACT_BROKER_BASE_URL="your-pactflow-url" PACT_BROKER_TOKEN="your-pactflow-token" PACT_BROKER_USERNAME="your-pact-broker-username" PACT_BROKER_PASSWORD="your-pact-broker-password" npx @modelcontextprotocol/inspector npx @smartbear/mcp@latest
|
|
274
|
+
```
|
|
110
275
|
|
|
111
|
-
|
|
276
|
+
## License
|
|
112
277
|
|
|
113
|
-
|
|
278
|
+
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the [LICENSE](LICENSE.txt) file in the project repository.
|
|
114
279
|
|
|
115
|
-
|
|
116
|
-
{
|
|
117
|
-
"servers": {
|
|
118
|
-
"smartbear": {
|
|
119
|
-
"type": "stdio",
|
|
120
|
-
"command": "node",
|
|
121
|
-
"args": ["<PATH_TO_SMARTBEAR_MCP>/dist/index.js"],
|
|
122
|
-
"env": {
|
|
123
|
-
// ...same as above...
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
"inputs": [
|
|
128
|
-
// ...same as above...
|
|
129
|
-
]
|
|
130
|
-
}
|
|
131
|
-
```
|
|
280
|
+
## Support
|
|
132
281
|
|
|
133
|
-
|
|
282
|
+
* [Search open and closed issues](https://github.com/SmartBear/smartbear-mcp/issues?utf8=✓&q=is%3Aissue) for similar problems
|
|
283
|
+
* [Report a bug or request a feature](https://github.com/SmartBear/smartbear-mcp/issues/new)
|
|
134
284
|
|
|
135
|
-
```bash
|
|
136
|
-
REFLECT_API_TOKEN=your_reflect_token INSIGHT_HUB_AUTH_TOKEN=your_insight_hub_token API_HUB_API_KEY=your_api_hub_api_key node dist/index.js
|
|
137
|
-
```
|
|
138
285
|
|
|
139
|
-
|
|
286
|
+
---
|
|
140
287
|
|
|
141
|
-
|
|
288
|
+
**SmartBear MCP Server** - Bringing the power of SmartBear's testing and monitoring ecosystem to your AI-powered development workflow.
|