@qverisai/mcp 0.6.0 → 0.7.1
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 +27 -10
- package/dist/api/client.d.ts +1 -1
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +74 -14
- package/dist/api/client.js.map +1 -1
- package/dist/index.d.ts +215 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +295 -226
- package/dist/index.js.map +1 -1
- package/dist/tools/execute.d.ts +4 -5
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/execute.js +13 -20
- package/dist/tools/execute.js.map +1 -1
- package/dist/tools/get-by-ids.d.ts +2 -2
- package/dist/tools/get-by-ids.js +2 -2
- package/dist/tools/search.d.ts +2 -2
- package/dist/tools/search.js +2 -2
- package/dist/types.d.ts +18 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -21,18 +21,35 @@ This SDK provides a [Model Context Protocol (MCP)](https://modelcontextprotocol.
|
|
|
21
21
|
|
|
22
22
|
Visit [QVeris](https://qveris.ai) (Global) or [QVeris](https://qveris.cn) (China) to get your API key.
|
|
23
23
|
|
|
24
|
-
### 2. Configure Your MCP Client
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
### 2. Configure Your MCP Client
|
|
25
|
+
|
|
26
|
+
Use the QVeris CLI to generate config without hand-editing JSON. Placeholder output intentionally fails API key validation until you replace it or use `--include-key`:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Print safe config with YOUR_QVERIS_API_KEY placeholder
|
|
30
|
+
qveris mcp configure --target cursor
|
|
31
|
+
|
|
32
|
+
# Write a working config using your resolved API key
|
|
33
|
+
qveris mcp configure --target cursor --write --include-key
|
|
34
|
+
qveris mcp configure --target claude-desktop --write --include-key
|
|
35
|
+
qveris mcp configure --target opencode --write --include-key
|
|
36
|
+
qveris mcp configure --target openclaw --write --include-key
|
|
37
|
+
|
|
38
|
+
# Validate config, or live-probe visible tools for stdio clients
|
|
39
|
+
qveris mcp validate --target cursor
|
|
40
|
+
qveris mcp validate --target cursor --probe
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Add the QVeris server to your MCP client configuration:
|
|
44
|
+
|
|
45
|
+
**Claude Desktop** (`claude_desktop_config.json`):
|
|
29
46
|
|
|
30
47
|
```json
|
|
31
48
|
{
|
|
32
49
|
"mcpServers": {
|
|
33
50
|
"qveris": {
|
|
34
51
|
"command": "npx",
|
|
35
|
-
"args": ["@qverisai/mcp"],
|
|
52
|
+
"args": ["-y", "@qverisai/mcp"],
|
|
36
53
|
"env": {
|
|
37
54
|
"QVERIS_API_KEY": "your-api-key-here"
|
|
38
55
|
}
|
|
@@ -48,7 +65,7 @@ Add the QVeris server to your MCP client configuration:
|
|
|
48
65
|
"mcpServers": {
|
|
49
66
|
"qveris": {
|
|
50
67
|
"command": "npx",
|
|
51
|
-
"args": ["@qverisai/mcp"],
|
|
68
|
+
"args": ["-y", "@qverisai/mcp"],
|
|
52
69
|
"env": {
|
|
53
70
|
"QVERIS_API_KEY": "your-api-key-here"
|
|
54
71
|
}
|
|
@@ -298,8 +315,8 @@ To override manually, set environment variables in your MCP client config:
|
|
|
298
315
|
|
|
299
316
|
```bash
|
|
300
317
|
# Clone the repository
|
|
301
|
-
git clone https://github.com/QVerisAI/
|
|
302
|
-
cd
|
|
318
|
+
git clone https://github.com/QVerisAI/qveris-agent-toolkit.git
|
|
319
|
+
cd qveris-agent-toolkit/packages/mcp
|
|
303
320
|
|
|
304
321
|
# Install dependencies
|
|
305
322
|
npm install
|
|
@@ -317,6 +334,6 @@ MIT © [QVerisAI](https://github.com/QVerisAI)
|
|
|
317
334
|
|
|
318
335
|
## Support
|
|
319
336
|
|
|
320
|
-
- 🐛 [Issue Tracker](https://github.com/QVerisAI/
|
|
337
|
+
- 🐛 [Issue Tracker](https://github.com/QVerisAI/qveris-agent-toolkit/issues)
|
|
321
338
|
- 💬 Contact: contact@qveris.ai
|
|
322
339
|
|
package/dist/api/client.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export declare class QverisClient {
|
|
|
69
69
|
/**
|
|
70
70
|
* Creates a Qveris client from environment variables.
|
|
71
71
|
* Reads the API key from QVERIS_API_KEY. Region is auto-detected from key prefix
|
|
72
|
-
* (sk-cn-xxx
|
|
72
|
+
* (sk-cn-xxx -> cn, sk-xxx -> global), or overridden via QVERIS_REGION or QVERIS_BASE_URL.
|
|
73
73
|
*/
|
|
74
74
|
export declare function createClientFromEnv(): QverisClient;
|
|
75
75
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAInB,MAAM,aAAa,CAAC;AAkCrB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;gBAE9B,MAAM,EAAE,kBAAkB;IAUtC;;OAEG;YACW,OAAO;IAyHrB;;;OAGG;IACG,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAIlE;;;OAGG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAI3E;;;;OAIG;IACG,WAAW,CACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC;IAW3B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC;IAI3E;;OAEG;IACG,eAAe,CACnB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAC;IAWlE;;OAEG;IACG,gBAAgB,CACpB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,WAAW,CAAC,qBAAqB,CAAC,GAAG,qBAAqB,CAAC;CAUvE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAiBlD"}
|
package/dist/api/client.js
CHANGED
|
@@ -13,7 +13,7 @@ const REGION_URLS = {
|
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* Detect region from API key prefix.
|
|
16
|
-
* sk-cn-xxx
|
|
16
|
+
* sk-cn-xxx -> cn, sk-xxx -> global
|
|
17
17
|
*/
|
|
18
18
|
function detectRegionFromKey(apiKey) {
|
|
19
19
|
return apiKey.startsWith('sk-cn-') ? 'cn' : 'global';
|
|
@@ -73,7 +73,7 @@ export class QverisClient {
|
|
|
73
73
|
/**
|
|
74
74
|
* Makes an authenticated HTTP request to the Qveris API.
|
|
75
75
|
*/
|
|
76
|
-
async request(method, endpoint, body, timeoutMs, query) {
|
|
76
|
+
async request(operation, method, endpoint, body, timeoutMs, query) {
|
|
77
77
|
const url = new URL(`${this.baseUrl}${endpoint}`);
|
|
78
78
|
if (query) {
|
|
79
79
|
for (const [key, value] of Object.entries(query)) {
|
|
@@ -83,7 +83,18 @@ export class QverisClient {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
const controller = new AbortController();
|
|
86
|
-
const
|
|
86
|
+
const resolvedTimeoutMs = timeoutMs ?? this.defaultTimeoutMs;
|
|
87
|
+
const queryParams = Object.fromEntries(url.searchParams.entries());
|
|
88
|
+
const requestContext = {
|
|
89
|
+
source: 'qveris_api',
|
|
90
|
+
operation,
|
|
91
|
+
method,
|
|
92
|
+
endpoint,
|
|
93
|
+
url: url.toString(),
|
|
94
|
+
...(Object.keys(queryParams).length > 0 && { query_params: queryParams }),
|
|
95
|
+
timeout_ms: resolvedTimeoutMs,
|
|
96
|
+
};
|
|
97
|
+
const timeout = setTimeout(() => controller.abort(), resolvedTimeoutMs);
|
|
87
98
|
try {
|
|
88
99
|
const response = await fetch(url.toString(), {
|
|
89
100
|
method,
|
|
@@ -118,7 +129,8 @@ export class QverisClient {
|
|
|
118
129
|
const error = {
|
|
119
130
|
status,
|
|
120
131
|
message: errorMessage,
|
|
121
|
-
details: errorDetails,
|
|
132
|
+
...(errorDetails !== undefined && { details: errorDetails }),
|
|
133
|
+
observability: withErrorContext(requestContext, 'http_error', status, extractRequestId(response)),
|
|
122
134
|
};
|
|
123
135
|
throw error;
|
|
124
136
|
}
|
|
@@ -129,23 +141,33 @@ export class QverisClient {
|
|
|
129
141
|
const error = {
|
|
130
142
|
status: response.status,
|
|
131
143
|
message: 'Invalid or empty JSON response from API',
|
|
144
|
+
observability: withErrorContext(requestContext, 'invalid_json', response.status, extractRequestId(response)),
|
|
132
145
|
};
|
|
133
146
|
throw error;
|
|
134
147
|
}
|
|
135
148
|
}
|
|
136
149
|
catch (err) {
|
|
137
|
-
if (err
|
|
138
|
-
// ApiError — rethrow as-is
|
|
150
|
+
if (isApiError(err)) {
|
|
139
151
|
throw err;
|
|
140
152
|
}
|
|
141
153
|
if (err instanceof Error && err.name === 'AbortError') {
|
|
154
|
+
const cause = getErrorCause(err);
|
|
142
155
|
const error = {
|
|
143
156
|
status: 408,
|
|
144
157
|
message: 'Request timed out. Check connectivity or increase timeout.',
|
|
158
|
+
observability: withErrorContext(requestContext, 'timeout', 0),
|
|
159
|
+
...(cause && { cause }),
|
|
145
160
|
};
|
|
146
161
|
throw error;
|
|
147
162
|
}
|
|
148
|
-
|
|
163
|
+
const cause = getErrorCause(err);
|
|
164
|
+
const error = {
|
|
165
|
+
status: 0,
|
|
166
|
+
message: getErrorMessage(err, 'Network request failed'),
|
|
167
|
+
observability: withErrorContext(requestContext, 'network_error', 0),
|
|
168
|
+
...(cause && { cause }),
|
|
169
|
+
};
|
|
170
|
+
throw error;
|
|
149
171
|
}
|
|
150
172
|
finally {
|
|
151
173
|
clearTimeout(timeout);
|
|
@@ -156,14 +178,14 @@ export class QverisClient {
|
|
|
156
178
|
* This is the Discover action and is free.
|
|
157
179
|
*/
|
|
158
180
|
async searchTools(request) {
|
|
159
|
-
return this.request('POST', '/search', request);
|
|
181
|
+
return this.request('discover', 'POST', '/search', request);
|
|
160
182
|
}
|
|
161
183
|
/**
|
|
162
184
|
* Get tool descriptions by their IDs.
|
|
163
185
|
* This is the Inspect action and is free.
|
|
164
186
|
*/
|
|
165
187
|
async getToolsByIds(request) {
|
|
166
|
-
return this.request('POST', '/tools/by-ids', request);
|
|
188
|
+
return this.request('inspect', 'POST', '/tools/by-ids', request);
|
|
167
189
|
}
|
|
168
190
|
/**
|
|
169
191
|
* Execute a tool with the specified parameters.
|
|
@@ -172,31 +194,31 @@ export class QverisClient {
|
|
|
172
194
|
*/
|
|
173
195
|
async executeTool(toolId, request) {
|
|
174
196
|
const endpoint = `/tools/execute?tool_id=${encodeURIComponent(toolId)}`;
|
|
175
|
-
return this.request('POST', endpoint, request, EXECUTE_TIMEOUT_MS);
|
|
197
|
+
return this.request('call', 'POST', endpoint, request, EXECUTE_TIMEOUT_MS);
|
|
176
198
|
}
|
|
177
199
|
/**
|
|
178
200
|
* Get current credit balance and bucket details.
|
|
179
201
|
*/
|
|
180
202
|
async getCredits() {
|
|
181
|
-
return this.request('GET', '/auth/credits');
|
|
203
|
+
return this.request('credits', 'GET', '/auth/credits');
|
|
182
204
|
}
|
|
183
205
|
/**
|
|
184
206
|
* Query request-level usage audit history.
|
|
185
207
|
*/
|
|
186
208
|
async getUsageHistory(request) {
|
|
187
|
-
return this.request('GET', '/auth/usage/history/v2', undefined, this.defaultTimeoutMs, request);
|
|
209
|
+
return this.request('usage_history', 'GET', '/auth/usage/history/v2', undefined, this.defaultTimeoutMs, request);
|
|
188
210
|
}
|
|
189
211
|
/**
|
|
190
212
|
* Query final credits ledger entries.
|
|
191
213
|
*/
|
|
192
214
|
async getCreditsLedger(request) {
|
|
193
|
-
return this.request('GET', '/auth/credits/ledger', undefined, this.defaultTimeoutMs, request);
|
|
215
|
+
return this.request('credits_ledger', 'GET', '/auth/credits/ledger', undefined, this.defaultTimeoutMs, request);
|
|
194
216
|
}
|
|
195
217
|
}
|
|
196
218
|
/**
|
|
197
219
|
* Creates a Qveris client from environment variables.
|
|
198
220
|
* Reads the API key from QVERIS_API_KEY. Region is auto-detected from key prefix
|
|
199
|
-
* (sk-cn-xxx
|
|
221
|
+
* (sk-cn-xxx -> cn, sk-xxx -> global), or overridden via QVERIS_REGION or QVERIS_BASE_URL.
|
|
200
222
|
*/
|
|
201
223
|
export function createClientFromEnv() {
|
|
202
224
|
const apiKey = process.env.QVERIS_API_KEY;
|
|
@@ -211,4 +233,42 @@ export function createClientFromEnv() {
|
|
|
211
233
|
console.error(`Region: ${region} (${effectiveUrl})`);
|
|
212
234
|
return client;
|
|
213
235
|
}
|
|
236
|
+
function withErrorContext(context, errorType, httpStatus, requestId) {
|
|
237
|
+
return {
|
|
238
|
+
...context,
|
|
239
|
+
error_type: errorType,
|
|
240
|
+
...(httpStatus !== undefined && { http_status: httpStatus }),
|
|
241
|
+
...(requestId && { request_id: requestId }),
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
function extractRequestId(response) {
|
|
245
|
+
const headers = response.headers;
|
|
246
|
+
return (headers?.get('x-request-id') ??
|
|
247
|
+
headers?.get('x-qveris-request-id') ??
|
|
248
|
+
headers?.get('x-correlation-id') ??
|
|
249
|
+
undefined);
|
|
250
|
+
}
|
|
251
|
+
function isApiError(error) {
|
|
252
|
+
return (typeof error === 'object' &&
|
|
253
|
+
error !== null &&
|
|
254
|
+
'status' in error &&
|
|
255
|
+
'message' in error);
|
|
256
|
+
}
|
|
257
|
+
function getErrorMessage(error, fallback) {
|
|
258
|
+
if (error instanceof Error && error.message)
|
|
259
|
+
return error.message;
|
|
260
|
+
if (typeof error === 'string' && error)
|
|
261
|
+
return error;
|
|
262
|
+
return fallback;
|
|
263
|
+
}
|
|
264
|
+
function getErrorCause(error) {
|
|
265
|
+
if (!(error instanceof Error))
|
|
266
|
+
return undefined;
|
|
267
|
+
const cause = error.cause;
|
|
268
|
+
if (cause instanceof Error)
|
|
269
|
+
return cause.message;
|
|
270
|
+
if (typeof cause === 'string' && cause)
|
|
271
|
+
return cause;
|
|
272
|
+
return undefined;
|
|
273
|
+
}
|
|
214
274
|
//# sourceMappingURL=client.js.map
|
package/dist/api/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAoBH,oCAAoC;AACpC,MAAM,WAAW,GAA2B;IAC1C,MAAM,EAAE,0BAA0B;IAClC,EAAE,EAAE,0BAA0B;CAC/B,CAAC;AAEF;;;GAGG;AACH,SAAS,mBAAmB,CAAC,MAAc;IACzC,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH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K,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IAClE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACrD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAChD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1B,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACrD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,12 +16,225 @@
|
|
|
16
16
|
* "mcpServers": {
|
|
17
17
|
* "qveris": {
|
|
18
18
|
* "command": "npx",
|
|
19
|
-
* "args": ["@qverisai/mcp"],
|
|
19
|
+
* "args": ["-y", "@qverisai/mcp"],
|
|
20
20
|
* "env": { "QVERIS_API_KEY": "your-api-key" }
|
|
21
21
|
* }
|
|
22
22
|
* }
|
|
23
23
|
* }
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
27
|
+
import { QverisClient } from './api/client.js';
|
|
28
|
+
/**
|
|
29
|
+
* List the MCP tools exposed by this server.
|
|
30
|
+
*
|
|
31
|
+
* Kept as a pure export so the public MCP interface can be tested without
|
|
32
|
+
* starting stdio transport.
|
|
33
|
+
*/
|
|
34
|
+
export declare function listQverisMcpTools(): ({
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
inputSchema: {
|
|
38
|
+
type: "object";
|
|
39
|
+
properties: {
|
|
40
|
+
query: {
|
|
41
|
+
type: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
limit: {
|
|
45
|
+
type: string;
|
|
46
|
+
description: string;
|
|
47
|
+
default: number;
|
|
48
|
+
minimum: number;
|
|
49
|
+
maximum: number;
|
|
50
|
+
};
|
|
51
|
+
session_id: {
|
|
52
|
+
type: string;
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
required: string[];
|
|
57
|
+
};
|
|
58
|
+
} | {
|
|
59
|
+
name: string;
|
|
60
|
+
description: string;
|
|
61
|
+
inputSchema: {
|
|
62
|
+
type: "object";
|
|
63
|
+
properties: {
|
|
64
|
+
tool_ids: {
|
|
65
|
+
type: string;
|
|
66
|
+
items: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
description: string;
|
|
70
|
+
minItems: number;
|
|
71
|
+
};
|
|
72
|
+
search_id: {
|
|
73
|
+
type: string;
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
session_id: {
|
|
77
|
+
type: string;
|
|
78
|
+
description: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
required: string[];
|
|
82
|
+
};
|
|
83
|
+
} | {
|
|
84
|
+
name: string;
|
|
85
|
+
description: string;
|
|
86
|
+
inputSchema: {
|
|
87
|
+
type: "object";
|
|
88
|
+
properties: {
|
|
89
|
+
tool_id: {
|
|
90
|
+
type: string;
|
|
91
|
+
description: string;
|
|
92
|
+
};
|
|
93
|
+
search_id: {
|
|
94
|
+
type: string;
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
97
|
+
params_to_tool: {
|
|
98
|
+
type: string;
|
|
99
|
+
description: string;
|
|
100
|
+
};
|
|
101
|
+
session_id: {
|
|
102
|
+
type: string;
|
|
103
|
+
description: string;
|
|
104
|
+
};
|
|
105
|
+
max_response_size: {
|
|
106
|
+
type: string;
|
|
107
|
+
description: string;
|
|
108
|
+
default: number;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
required: string[];
|
|
112
|
+
};
|
|
113
|
+
} | {
|
|
114
|
+
name: string;
|
|
115
|
+
description: string;
|
|
116
|
+
inputSchema: {
|
|
117
|
+
type: "object";
|
|
118
|
+
properties: {
|
|
119
|
+
mode: {
|
|
120
|
+
type: string;
|
|
121
|
+
enum: string[];
|
|
122
|
+
description: string;
|
|
123
|
+
default: string;
|
|
124
|
+
};
|
|
125
|
+
start_date: {
|
|
126
|
+
type: string;
|
|
127
|
+
description: string;
|
|
128
|
+
};
|
|
129
|
+
end_date: {
|
|
130
|
+
type: string;
|
|
131
|
+
description: string;
|
|
132
|
+
};
|
|
133
|
+
bucket: {
|
|
134
|
+
type: string;
|
|
135
|
+
enum: string[];
|
|
136
|
+
description: string;
|
|
137
|
+
};
|
|
138
|
+
execution_id: {
|
|
139
|
+
type: string;
|
|
140
|
+
description: string;
|
|
141
|
+
};
|
|
142
|
+
search_id: {
|
|
143
|
+
type: string;
|
|
144
|
+
description: string;
|
|
145
|
+
};
|
|
146
|
+
event_type: {
|
|
147
|
+
type: string;
|
|
148
|
+
description: string;
|
|
149
|
+
};
|
|
150
|
+
kind: {
|
|
151
|
+
type: string;
|
|
152
|
+
description: string;
|
|
153
|
+
};
|
|
154
|
+
success: {
|
|
155
|
+
type: string;
|
|
156
|
+
description: string;
|
|
157
|
+
};
|
|
158
|
+
charge_outcome: {
|
|
159
|
+
type: string;
|
|
160
|
+
enum: string[];
|
|
161
|
+
description: string;
|
|
162
|
+
};
|
|
163
|
+
min_credits: {
|
|
164
|
+
type: string;
|
|
165
|
+
description: string;
|
|
166
|
+
};
|
|
167
|
+
max_credits: {
|
|
168
|
+
type: string;
|
|
169
|
+
description: string;
|
|
170
|
+
};
|
|
171
|
+
limit: {
|
|
172
|
+
type: string;
|
|
173
|
+
description: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
} | {
|
|
178
|
+
name: string;
|
|
179
|
+
description: string;
|
|
180
|
+
inputSchema: {
|
|
181
|
+
type: "object";
|
|
182
|
+
properties: {
|
|
183
|
+
mode: {
|
|
184
|
+
type: string;
|
|
185
|
+
enum: string[];
|
|
186
|
+
description: string;
|
|
187
|
+
default: string;
|
|
188
|
+
};
|
|
189
|
+
start_date: {
|
|
190
|
+
type: string;
|
|
191
|
+
description: string;
|
|
192
|
+
};
|
|
193
|
+
end_date: {
|
|
194
|
+
type: string;
|
|
195
|
+
description: string;
|
|
196
|
+
};
|
|
197
|
+
bucket: {
|
|
198
|
+
type: string;
|
|
199
|
+
enum: string[];
|
|
200
|
+
description: string;
|
|
201
|
+
};
|
|
202
|
+
entry_type: {
|
|
203
|
+
type: string;
|
|
204
|
+
description: string;
|
|
205
|
+
};
|
|
206
|
+
direction: {
|
|
207
|
+
type: string;
|
|
208
|
+
enum: string[];
|
|
209
|
+
description: string;
|
|
210
|
+
default: string;
|
|
211
|
+
};
|
|
212
|
+
min_credits: {
|
|
213
|
+
type: string;
|
|
214
|
+
description: string;
|
|
215
|
+
};
|
|
216
|
+
max_credits: {
|
|
217
|
+
type: string;
|
|
218
|
+
description: string;
|
|
219
|
+
};
|
|
220
|
+
limit: {
|
|
221
|
+
type: string;
|
|
222
|
+
description: string;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
})[];
|
|
227
|
+
export declare const DEPRECATED_ALIASES: Record<string, string>;
|
|
228
|
+
/**
|
|
229
|
+
* Route one MCP tool call to the matching Qveris operation.
|
|
230
|
+
*/
|
|
231
|
+
export declare function executeQverisMcpTool(client: QverisClient, defaultSessionId: string, rawName: string, args: unknown, warn?: (message: string) => void): Promise<CallToolResult>;
|
|
232
|
+
/**
|
|
233
|
+
* Main entry point for the Qveris MCP Server.
|
|
234
|
+
*
|
|
235
|
+
* Sets up the MCP server with stdio transport, registers the discover,
|
|
236
|
+
* inspect, and call handlers, and starts listening for requests.
|
|
237
|
+
*/
|
|
238
|
+
export declare function main(): Promise<void>;
|
|
239
|
+
export declare function isEntrypoint(argvEntry: string | undefined, moduleUrl?: string): boolean;
|
|
27
240
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,oCAAoC,CAAC;AAK5C,OAAO,EAAuB,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAsCpE;;;;;GAKG;AACH,wBAAgB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0DjC;AAGD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIrD,CAAC;AA2CF;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,YAAY,EACpB,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,OAAO,EACb,IAAI,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAiD,GAC3E,OAAO,CAAC,cAAc,CAAC,CA+LzB;AAED;;;;;GAKG;AACH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CA8D1C;AAcD,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,SAAkB,GAAG,OAAO,CAYhG"}
|