@smartbear/mcp 0.3.0 → 0.5.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 +86 -25
- package/dist/api-hub/client.js +298 -52
- package/dist/{insight-hub → bugsnag}/client/api/CurrentUser.js +2 -1
- package/dist/{insight-hub → bugsnag}/client/api/Error.js +37 -4
- package/dist/{insight-hub → bugsnag}/client/api/Project.js +2 -1
- package/dist/{insight-hub → bugsnag}/client/api/base.js +18 -1
- package/dist/{insight-hub → bugsnag}/client/api/filters.js +2 -2
- package/dist/bugsnag/client.js +687 -0
- package/dist/common/info.js +1 -1
- package/dist/common/server.js +148 -0
- package/dist/index.js +38 -29
- package/dist/pactflow/client/ai.js +146 -0
- package/dist/pactflow/client/base.js +6 -0
- package/dist/pactflow/client/tools.js +55 -0
- package/dist/pactflow/client/utils.js +70 -0
- package/dist/pactflow/client.js +180 -0
- package/dist/reflect/client.js +100 -18
- package/package.json +8 -4
- package/dist/common/templates.js +0 -57
- package/dist/insight-hub/client.js +0 -621
- package/dist/package.json +0 -59
- package/dist/tests/unit/common/templates.test.js +0 -149
- package/dist/tests/unit/insight-hub/api-utilities.test.js +0 -31
- package/dist/tests/unit/insight-hub/client.test.js +0 -920
- package/dist/tests/unit/insight-hub/filters.test.js +0 -93
- package/dist/vitest.config.js +0 -57
- /package/dist/{insight-hub → bugsnag}/client/api/index.js +0 -0
- /package/dist/{insight-hub → bugsnag}/client/configuration.js +0 -0
- /package/dist/{insight-hub → bugsnag}/client/index.js +0 -0
package/dist/package.json
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@smartbear/mcp",
|
|
3
|
-
"version": "0.3.0",
|
|
4
|
-
"description": "MCP server for interacting SmartBear Products",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"smartbear",
|
|
7
|
-
"mcp",
|
|
8
|
-
"insight-hub",
|
|
9
|
-
"reflect",
|
|
10
|
-
"api-hub"
|
|
11
|
-
],
|
|
12
|
-
"homepage": "https://developer.smartbear.com/smartbear-mcp",
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "git@github.com:SmartBear/smartbear-mcp.git"
|
|
16
|
-
},
|
|
17
|
-
"license": "MIT",
|
|
18
|
-
"type": "module",
|
|
19
|
-
"bin": {
|
|
20
|
-
"mcp": "dist/index.js"
|
|
21
|
-
},
|
|
22
|
-
"files": [
|
|
23
|
-
"dist",
|
|
24
|
-
"assets",
|
|
25
|
-
"**/README.md"
|
|
26
|
-
],
|
|
27
|
-
"config": {
|
|
28
|
-
"mcpServerName": "SmartBear MCP Server"
|
|
29
|
-
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"build": "tsc && shx chmod +x dist/*.js",
|
|
32
|
-
"lint": "eslint . --ext .ts",
|
|
33
|
-
"prepare": "npm run build",
|
|
34
|
-
"watch": "tsc --watch",
|
|
35
|
-
"test": "vitest",
|
|
36
|
-
"test:watch": "vitest --watch",
|
|
37
|
-
"test:coverage": "vitest --coverage",
|
|
38
|
-
"test:coverage:ci": "vitest --coverage --reporter=verbose",
|
|
39
|
-
"test:run": "vitest run",
|
|
40
|
-
"coverage:check": "vitest --coverage --reporter=verbose --config vitest.config.coverage.ts"
|
|
41
|
-
},
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"@bugsnag/js": "^8.2.0",
|
|
44
|
-
"@modelcontextprotocol/sdk": "^1.15.0",
|
|
45
|
-
"node-cache": "^5.1.2",
|
|
46
|
-
"zod": "^3"
|
|
47
|
-
},
|
|
48
|
-
"devDependencies": {
|
|
49
|
-
"@eslint/js": "^9.29.0",
|
|
50
|
-
"@types/node": "^22",
|
|
51
|
-
"@vitest/coverage-v8": "^3.2.4",
|
|
52
|
-
"eslint": "^9.29.0",
|
|
53
|
-
"globals": "^16.2.0",
|
|
54
|
-
"shx": "^0.3.4",
|
|
55
|
-
"typescript": "^5.6.2",
|
|
56
|
-
"typescript-eslint": "^8.34.1",
|
|
57
|
-
"vitest": "^3.2.4"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { toolDescriptionTemplate, createParameter, createExample } from '../../../common/templates.js';
|
|
3
|
-
describe('Template Utilities', () => {
|
|
4
|
-
describe('createParameter', () => {
|
|
5
|
-
it('should create basic parameter object', () => {
|
|
6
|
-
const result = createParameter('testParam', 'string', true, 'A test parameter');
|
|
7
|
-
expect(result).toEqual({
|
|
8
|
-
name: 'testParam',
|
|
9
|
-
type: 'string',
|
|
10
|
-
required: true,
|
|
11
|
-
description: 'A test parameter'
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
it('should create parameter with options', () => {
|
|
15
|
-
const result = createParameter('testParam', 'number', false, 'A test parameter', {
|
|
16
|
-
examples: ['1', '2', '3'],
|
|
17
|
-
constraints: ['Must be positive']
|
|
18
|
-
});
|
|
19
|
-
expect(result).toEqual({
|
|
20
|
-
name: 'testParam',
|
|
21
|
-
type: 'number',
|
|
22
|
-
required: false,
|
|
23
|
-
description: 'A test parameter',
|
|
24
|
-
examples: ['1', '2', '3'],
|
|
25
|
-
constraints: ['Must be positive']
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
describe('createExample', () => {
|
|
30
|
-
it('should create basic example object', () => {
|
|
31
|
-
const result = createExample('Test example', { param1: 'value1' });
|
|
32
|
-
expect(result).toEqual({
|
|
33
|
-
description: 'Test example',
|
|
34
|
-
parameters: { param1: 'value1' }
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
it('should create example with expected output', () => {
|
|
38
|
-
const result = createExample('Test example', { param1: 'value1' }, 'Expected result');
|
|
39
|
-
expect(result).toEqual({
|
|
40
|
-
description: 'Test example',
|
|
41
|
-
parameters: { param1: 'value1' },
|
|
42
|
-
expectedOutput: 'Expected result'
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
describe('toolDescriptionTemplate', () => {
|
|
47
|
-
it('should generate basic tool description', () => {
|
|
48
|
-
const params = {
|
|
49
|
-
summary: 'Test tool summary',
|
|
50
|
-
purpose: 'Test purpose',
|
|
51
|
-
useCases: ['Use case 1', 'Use case 2'],
|
|
52
|
-
examples: [
|
|
53
|
-
{
|
|
54
|
-
description: 'Example 1',
|
|
55
|
-
parameters: { param1: 'value1' },
|
|
56
|
-
expectedOutput: 'Result 1'
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
parameters: [
|
|
60
|
-
{
|
|
61
|
-
name: 'param1',
|
|
62
|
-
type: 'string',
|
|
63
|
-
required: true,
|
|
64
|
-
description: 'Test parameter'
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
hints: ['Hint 1', 'Hint 2']
|
|
68
|
-
};
|
|
69
|
-
const result = toolDescriptionTemplate(params);
|
|
70
|
-
expect(result).toContain('Test tool summary');
|
|
71
|
-
expect(result).toContain('**Parameters:** param1 (string) *required*');
|
|
72
|
-
expect(result).toContain('**Use Cases:** 1. Use case 1 2. Use case 2');
|
|
73
|
-
expect(result).toContain('**Examples:**');
|
|
74
|
-
expect(result).toContain('Example 1');
|
|
75
|
-
expect(result).toContain('param1');
|
|
76
|
-
expect(result).toContain('value1');
|
|
77
|
-
expect(result).toContain('Expected Output: Result 1');
|
|
78
|
-
expect(result).toContain('**Tips:** 1. Hint 1 2. Hint 2');
|
|
79
|
-
});
|
|
80
|
-
it('should handle optional parameters correctly', () => {
|
|
81
|
-
const params = {
|
|
82
|
-
summary: 'Test tool',
|
|
83
|
-
purpose: 'Test purpose',
|
|
84
|
-
useCases: ['Use case'],
|
|
85
|
-
examples: [],
|
|
86
|
-
parameters: [
|
|
87
|
-
{
|
|
88
|
-
name: 'required_param',
|
|
89
|
-
type: 'string',
|
|
90
|
-
required: true,
|
|
91
|
-
description: 'Required parameter'
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
name: 'optional_param',
|
|
95
|
-
type: 'number',
|
|
96
|
-
required: false,
|
|
97
|
-
description: 'Optional parameter'
|
|
98
|
-
}
|
|
99
|
-
],
|
|
100
|
-
hints: []
|
|
101
|
-
};
|
|
102
|
-
const result = toolDescriptionTemplate(params);
|
|
103
|
-
expect(result).toContain('required_param (string) *required*');
|
|
104
|
-
expect(result).toContain('optional_param (number)');
|
|
105
|
-
expect(result).not.toContain('optional_param (number) *required*');
|
|
106
|
-
});
|
|
107
|
-
it('should handle empty sections gracefully', () => {
|
|
108
|
-
const params = {
|
|
109
|
-
summary: 'Minimal tool',
|
|
110
|
-
purpose: 'Test purpose',
|
|
111
|
-
useCases: [],
|
|
112
|
-
examples: [],
|
|
113
|
-
parameters: [],
|
|
114
|
-
hints: []
|
|
115
|
-
};
|
|
116
|
-
const result = toolDescriptionTemplate(params);
|
|
117
|
-
expect(result).toBe('Minimal tool');
|
|
118
|
-
expect(result).not.toContain('**Parameters:**');
|
|
119
|
-
expect(result).not.toContain('**Use Cases:**');
|
|
120
|
-
expect(result).not.toContain('**Examples:**');
|
|
121
|
-
expect(result).not.toContain('**Tips:**');
|
|
122
|
-
});
|
|
123
|
-
it('should format JSON examples correctly', () => {
|
|
124
|
-
const params = {
|
|
125
|
-
summary: 'Test tool',
|
|
126
|
-
purpose: 'Test purpose',
|
|
127
|
-
useCases: ['Test'],
|
|
128
|
-
examples: [
|
|
129
|
-
{
|
|
130
|
-
description: 'Complex example',
|
|
131
|
-
parameters: {
|
|
132
|
-
nested: {
|
|
133
|
-
object: 'value',
|
|
134
|
-
array: [1, 2, 3]
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
],
|
|
139
|
-
parameters: [],
|
|
140
|
-
hints: []
|
|
141
|
-
};
|
|
142
|
-
const result = toolDescriptionTemplate(params);
|
|
143
|
-
expect(result).toContain('```json');
|
|
144
|
-
expect(result).toContain('"nested"');
|
|
145
|
-
expect(result).toContain('"object": "value"');
|
|
146
|
-
expect(result).toContain('"array": [');
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { pickFields, pickFieldsFromArray } from '../../../insight-hub/client/api/base.js';
|
|
3
|
-
describe('API Utilities', () => {
|
|
4
|
-
describe('pickFields', () => {
|
|
5
|
-
it('should pick only specified fields from object', () => {
|
|
6
|
-
const input = { id: '1', name: 'Test', secret: 'hidden', extra: 'data' };
|
|
7
|
-
const result = pickFields(input, ['id', 'name']);
|
|
8
|
-
expect(result).toEqual({ id: '1', name: 'Test' });
|
|
9
|
-
expect(result).not.toHaveProperty('secret');
|
|
10
|
-
expect(result).not.toHaveProperty('extra');
|
|
11
|
-
});
|
|
12
|
-
it('should handle missing fields gracefully', () => {
|
|
13
|
-
const input = { id: '1' };
|
|
14
|
-
const result = pickFields(input, ['id', 'name', 'missing']);
|
|
15
|
-
expect(result).toEqual({ id: '1' });
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
describe('pickFieldsFromArray', () => {
|
|
19
|
-
it('should pick fields from array of objects', () => {
|
|
20
|
-
const input = [
|
|
21
|
-
{ id: '1', name: 'Test1', secret: 'hidden1' },
|
|
22
|
-
{ id: '2', name: 'Test2', secret: 'hidden2' }
|
|
23
|
-
];
|
|
24
|
-
const result = pickFieldsFromArray(input, ['id', 'name']);
|
|
25
|
-
expect(result).toEqual([
|
|
26
|
-
{ id: '1', name: 'Test1' },
|
|
27
|
-
{ id: '2', name: 'Test2' }
|
|
28
|
-
]);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
});
|