@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/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
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
|
* }
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
27
27
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
28
28
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
29
|
+
import { realpathSync } from 'node:fs';
|
|
30
|
+
import { pathToFileURL } from 'node:url';
|
|
29
31
|
import { v4 as uuidv4 } from 'uuid';
|
|
30
32
|
import { createClientFromEnv } from './api/client.js';
|
|
31
33
|
import { searchToolsSchema, executeSearchTools, } from './tools/search.js';
|
|
@@ -41,276 +43,326 @@ const SERVER_NAME = 'qveris';
|
|
|
41
43
|
const require = createRequire(import.meta.url);
|
|
42
44
|
const { version: SERVER_VERSION } = require('../package.json');
|
|
43
45
|
/**
|
|
44
|
-
*
|
|
46
|
+
* List the MCP tools exposed by this server.
|
|
45
47
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
+
* Kept as a pure export so the public MCP interface can be tested without
|
|
49
|
+
* starting stdio transport.
|
|
48
50
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// Generate a default session ID for this server instance
|
|
60
|
-
const defaultSessionId = uuidv4();
|
|
61
|
-
// Create MCP server
|
|
62
|
-
const server = new Server({
|
|
63
|
-
name: SERVER_NAME,
|
|
64
|
-
version: SERVER_VERSION,
|
|
65
|
-
}, {
|
|
66
|
-
capabilities: {
|
|
67
|
-
tools: {},
|
|
51
|
+
export function listQverisMcpTools() {
|
|
52
|
+
return [
|
|
53
|
+
// Primary tools (aligned with CLI naming)
|
|
54
|
+
{
|
|
55
|
+
name: 'discover',
|
|
56
|
+
description: 'Discover available tools based on natural language queries. ' +
|
|
57
|
+
'Returns relevant tools that can help accomplish tasks. ' +
|
|
58
|
+
'Use this to find tools before inspecting or calling them. ' +
|
|
59
|
+
'Results may include billing_rule metadata for rule-level pricing.',
|
|
60
|
+
inputSchema: searchToolsSchema,
|
|
68
61
|
},
|
|
62
|
+
{
|
|
63
|
+
name: 'inspect',
|
|
64
|
+
description: 'Inspect tools by their IDs to get detailed information. ' +
|
|
65
|
+
'Returns parameters, success rate, latency, examples, and billing_rule when available. ' +
|
|
66
|
+
'Use tool_ids from a previous discover call.',
|
|
67
|
+
inputSchema: getToolsByIdsSchema,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'call',
|
|
71
|
+
description: 'Call a specific remote tool with provided parameters. ' +
|
|
72
|
+
'The tool_id and search_id must come from a previous discover call. ' +
|
|
73
|
+
'Pass parameters to the tool through params_to_tool. ' +
|
|
74
|
+
'The response may include pre-settlement billing; use usage_history or credits_ledger for final charge status.',
|
|
75
|
+
inputSchema: executeToolSchema,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'usage_history',
|
|
79
|
+
description: 'Context-safe usage audit query. Defaults to aggregated summary, supports precise search by execution_id/search_id/charge_outcome/credit range, and writes large exports to a local JSONL file instead of returning all rows.',
|
|
80
|
+
inputSchema: usageHistorySchema,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'credits_ledger',
|
|
84
|
+
description: 'Context-safe final credits ledger query. Defaults to aggregated summary, supports precise search by entry type/direction/credit range, and writes large exports to a local JSONL file instead of returning all rows.',
|
|
85
|
+
inputSchema: creditsLedgerSchema,
|
|
86
|
+
},
|
|
87
|
+
// Deprecated aliases (backward compatibility)
|
|
88
|
+
{
|
|
89
|
+
name: 'search_tools',
|
|
90
|
+
description: '[Deprecated: use "discover" instead] Search for available tools based on natural language queries.',
|
|
91
|
+
inputSchema: searchToolsSchema,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'get_tools_by_ids',
|
|
95
|
+
description: '[Deprecated: use "inspect" instead] Get descriptions of tools based on their tool IDs.',
|
|
96
|
+
inputSchema: getToolsByIdsSchema,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'execute_tool',
|
|
100
|
+
description: '[Deprecated: use "call" instead] Execute a specific remote tool with provided parameters.',
|
|
101
|
+
inputSchema: executeToolSchema,
|
|
102
|
+
},
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
// Deprecated tool name aliases -> canonical names.
|
|
106
|
+
export const DEPRECATED_ALIASES = {
|
|
107
|
+
search_tools: 'discover',
|
|
108
|
+
get_tools_by_ids: 'inspect',
|
|
109
|
+
execute_tool: 'call',
|
|
110
|
+
};
|
|
111
|
+
function buildMcpObservability(requestedTool, mcpTool, args, defaultSessionId) {
|
|
112
|
+
const input = isRecord(args) ? args : {};
|
|
113
|
+
const toolId = readString(input.tool_id);
|
|
114
|
+
return compactObject({
|
|
115
|
+
source: 'qveris_mcp',
|
|
116
|
+
requested_tool: requestedTool,
|
|
117
|
+
mcp_tool: mcpTool,
|
|
118
|
+
session_id: readString(input.session_id) ?? defaultSessionId,
|
|
119
|
+
search_id: readString(input.search_id),
|
|
120
|
+
tool_id: toolId,
|
|
121
|
+
provider_id: inferProviderId(toolId),
|
|
122
|
+
query: readString(input.query),
|
|
69
123
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
inputSchema: executeToolSchema,
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
name: 'usage_history',
|
|
106
|
-
description: 'Context-safe usage audit query. Defaults to aggregated summary, supports precise search by execution_id/search_id/charge_outcome/credit range, and writes large exports to a local JSONL file instead of returning all rows.',
|
|
107
|
-
inputSchema: usageHistorySchema,
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'credits_ledger',
|
|
111
|
-
description: 'Context-safe final credits ledger query. Defaults to aggregated summary, supports precise search by entry type/direction/credit range, and writes large exports to a local JSONL file instead of returning all rows.',
|
|
112
|
-
inputSchema: creditsLedgerSchema,
|
|
113
|
-
},
|
|
114
|
-
// Deprecated aliases (backward compatibility)
|
|
115
|
-
{
|
|
116
|
-
name: 'search_tools',
|
|
117
|
-
description: '[Deprecated: use "discover" instead] Search for available tools based on natural language queries.',
|
|
118
|
-
inputSchema: searchToolsSchema,
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
name: 'get_tools_by_ids',
|
|
122
|
-
description: '[Deprecated: use "inspect" instead] Get descriptions of tools based on their tool IDs.',
|
|
123
|
-
inputSchema: getToolsByIdsSchema,
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
name: 'execute_tool',
|
|
127
|
-
description: '[Deprecated: use "call" instead] Execute a specific remote tool with provided parameters.',
|
|
128
|
-
inputSchema: executeToolSchema,
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
};
|
|
132
|
-
});
|
|
133
|
-
// Deprecated tool name aliases → canonical names
|
|
134
|
-
const DEPRECATED_ALIASES = {
|
|
135
|
-
search_tools: 'discover',
|
|
136
|
-
get_tools_by_ids: 'inspect',
|
|
137
|
-
execute_tool: 'call',
|
|
138
|
-
};
|
|
139
|
-
/**
|
|
140
|
-
* Handles tool execution requests.
|
|
141
|
-
* Routes to the appropriate handler based on tool name.
|
|
142
|
-
* Deprecated aliases emit a warning to stderr.
|
|
143
|
-
*/
|
|
144
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
145
|
-
const { name: rawName, arguments: args } = request.params;
|
|
146
|
-
// Resolve deprecated aliases
|
|
147
|
-
let name = rawName;
|
|
148
|
-
if (DEPRECATED_ALIASES[rawName]) {
|
|
149
|
-
name = DEPRECATED_ALIASES[rawName];
|
|
150
|
-
process.stderr.write(`[qveris] Deprecated: "${rawName}" → use "${name}" instead\n`);
|
|
151
|
-
}
|
|
152
|
-
try {
|
|
153
|
-
if (name === 'discover') {
|
|
154
|
-
const input = (args ?? {});
|
|
155
|
-
// Validate required fields
|
|
156
|
-
if (!input.query || typeof input.query !== 'string') {
|
|
157
|
-
return {
|
|
158
|
-
content: [
|
|
159
|
-
{
|
|
160
|
-
type: 'text',
|
|
161
|
-
text: JSON.stringify({
|
|
162
|
-
error: 'Missing required parameter: query',
|
|
163
|
-
hint: 'Provide a natural language query describing the tool capability you need',
|
|
164
|
-
}),
|
|
165
|
-
},
|
|
166
|
-
],
|
|
167
|
-
isError: true,
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
const result = await executeSearchTools(client, input, defaultSessionId);
|
|
171
|
-
return {
|
|
172
|
-
content: [
|
|
173
|
-
{
|
|
174
|
-
type: 'text',
|
|
175
|
-
text: JSON.stringify(result, null, 2),
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
if (name === 'inspect') {
|
|
181
|
-
const input = (args ?? {});
|
|
182
|
-
// Validate required fields
|
|
183
|
-
if (!input.tool_ids || !Array.isArray(input.tool_ids) || input.tool_ids.length === 0) {
|
|
184
|
-
return {
|
|
185
|
-
content: [
|
|
186
|
-
{
|
|
187
|
-
type: 'text',
|
|
188
|
-
text: JSON.stringify({
|
|
189
|
-
error: 'Missing or invalid required parameter: tool_ids',
|
|
190
|
-
hint: 'Provide an array of tool IDs (at least one) to retrieve tool information',
|
|
191
|
-
}),
|
|
192
|
-
},
|
|
193
|
-
],
|
|
194
|
-
isError: true,
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
const result = await executeGetToolsByIds(client, input, defaultSessionId);
|
|
198
|
-
return {
|
|
199
|
-
content: [
|
|
200
|
-
{
|
|
201
|
-
type: 'text',
|
|
202
|
-
text: JSON.stringify(result, null, 2),
|
|
203
|
-
},
|
|
204
|
-
],
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
if (name === 'call') {
|
|
208
|
-
const input = (args ?? {});
|
|
209
|
-
// Validate required fields
|
|
210
|
-
const missingFields = [];
|
|
211
|
-
if (!input.tool_id)
|
|
212
|
-
missingFields.push('tool_id');
|
|
213
|
-
if (!input.search_id)
|
|
214
|
-
missingFields.push('search_id');
|
|
215
|
-
if (!input.params_to_tool)
|
|
216
|
-
missingFields.push('params_to_tool');
|
|
217
|
-
if (missingFields.length > 0) {
|
|
218
|
-
return {
|
|
219
|
-
content: [
|
|
220
|
-
{
|
|
221
|
-
type: 'text',
|
|
222
|
-
text: JSON.stringify({
|
|
223
|
-
error: `Missing required parameters: ${missingFields.join(', ')}`,
|
|
224
|
-
hint: 'tool_id and search_id must come from a previous discover call',
|
|
225
|
-
}),
|
|
226
|
-
},
|
|
227
|
-
],
|
|
228
|
-
isError: true,
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
const result = await executeExecuteTool(client, input, defaultSessionId);
|
|
232
|
-
return {
|
|
233
|
-
content: [
|
|
234
|
-
{
|
|
235
|
-
type: 'text',
|
|
236
|
-
text: JSON.stringify(result, null, 2),
|
|
237
|
-
},
|
|
238
|
-
],
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
if (name === 'usage_history') {
|
|
242
|
-
const input = (args ?? {});
|
|
243
|
-
const result = await executeUsageHistory(client, input);
|
|
124
|
+
}
|
|
125
|
+
function isRecord(value) {
|
|
126
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
127
|
+
}
|
|
128
|
+
function readString(value) {
|
|
129
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
130
|
+
}
|
|
131
|
+
function inferProviderId(toolId) {
|
|
132
|
+
if (!toolId)
|
|
133
|
+
return undefined;
|
|
134
|
+
const [providerId] = toolId.split('.');
|
|
135
|
+
return providerId || undefined;
|
|
136
|
+
}
|
|
137
|
+
function compactObject(input) {
|
|
138
|
+
return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== undefined));
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Route one MCP tool call to the matching Qveris operation.
|
|
142
|
+
*/
|
|
143
|
+
export async function executeQverisMcpTool(client, defaultSessionId, rawName, args, warn = (message) => process.stderr.write(message)) {
|
|
144
|
+
// Resolve deprecated aliases.
|
|
145
|
+
let name = rawName;
|
|
146
|
+
if (DEPRECATED_ALIASES[rawName]) {
|
|
147
|
+
name = DEPRECATED_ALIASES[rawName];
|
|
148
|
+
warn(`[qveris] Deprecated: "${rawName}" -> use "${name}" instead\n`);
|
|
149
|
+
}
|
|
150
|
+
const mcpObservability = buildMcpObservability(rawName, name, args, defaultSessionId);
|
|
151
|
+
try {
|
|
152
|
+
if (name === 'discover') {
|
|
153
|
+
const input = (args ?? {});
|
|
154
|
+
// Validate required fields.
|
|
155
|
+
if (!input.query || typeof input.query !== 'string') {
|
|
244
156
|
return {
|
|
245
157
|
content: [
|
|
246
158
|
{
|
|
247
159
|
type: 'text',
|
|
248
|
-
text: JSON.stringify(
|
|
160
|
+
text: JSON.stringify({
|
|
161
|
+
error: 'Missing required parameter: query',
|
|
162
|
+
hint: 'Provide a natural language query describing the tool capability you need',
|
|
163
|
+
}),
|
|
249
164
|
},
|
|
250
165
|
],
|
|
166
|
+
isError: true,
|
|
251
167
|
};
|
|
252
168
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
169
|
+
const result = await executeSearchTools(client, input, defaultSessionId);
|
|
170
|
+
return {
|
|
171
|
+
content: [
|
|
172
|
+
{
|
|
173
|
+
type: 'text',
|
|
174
|
+
text: JSON.stringify(result, null, 2),
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
if (name === 'inspect') {
|
|
180
|
+
const input = (args ?? {});
|
|
181
|
+
// Validate required fields.
|
|
182
|
+
if (!input.tool_ids || !Array.isArray(input.tool_ids) || input.tool_ids.length === 0) {
|
|
256
183
|
return {
|
|
257
184
|
content: [
|
|
258
185
|
{
|
|
259
186
|
type: 'text',
|
|
260
|
-
text: JSON.stringify(
|
|
187
|
+
text: JSON.stringify({
|
|
188
|
+
error: 'Missing or invalid required parameter: tool_ids',
|
|
189
|
+
hint: 'Provide an array of tool IDs (at least one) to retrieve tool information',
|
|
190
|
+
}),
|
|
261
191
|
},
|
|
262
192
|
],
|
|
193
|
+
isError: true,
|
|
263
194
|
};
|
|
264
195
|
}
|
|
265
|
-
|
|
196
|
+
const result = await executeGetToolsByIds(client, input, defaultSessionId);
|
|
266
197
|
return {
|
|
267
198
|
content: [
|
|
268
199
|
{
|
|
269
200
|
type: 'text',
|
|
270
|
-
text: JSON.stringify(
|
|
271
|
-
error: `Unknown tool: ${rawName}`,
|
|
272
|
-
available_tools: ['discover', 'inspect', 'call', 'usage_history', 'credits_ledger'],
|
|
273
|
-
}),
|
|
201
|
+
text: JSON.stringify(result, null, 2),
|
|
274
202
|
},
|
|
275
203
|
],
|
|
276
|
-
isError: true,
|
|
277
204
|
};
|
|
278
205
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
206
|
+
if (name === 'call') {
|
|
207
|
+
const input = (args ?? {});
|
|
208
|
+
// Validate required fields.
|
|
209
|
+
const missingFields = [];
|
|
210
|
+
if (!input.tool_id)
|
|
211
|
+
missingFields.push('tool_id');
|
|
212
|
+
if (!input.search_id)
|
|
213
|
+
missingFields.push('search_id');
|
|
214
|
+
if (input.params_to_tool === undefined)
|
|
215
|
+
missingFields.push('params_to_tool');
|
|
216
|
+
if (missingFields.length > 0) {
|
|
282
217
|
return {
|
|
283
218
|
content: [
|
|
284
219
|
{
|
|
285
220
|
type: 'text',
|
|
286
221
|
text: JSON.stringify({
|
|
287
|
-
error:
|
|
288
|
-
|
|
289
|
-
details: error.details,
|
|
222
|
+
error: `Missing required parameters: ${missingFields.join(', ')}`,
|
|
223
|
+
hint: 'tool_id and search_id must come from a previous discover call',
|
|
290
224
|
}),
|
|
291
225
|
},
|
|
292
226
|
],
|
|
293
227
|
isError: true,
|
|
294
228
|
};
|
|
295
229
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
230
|
+
const result = await executeExecuteTool(client, input, defaultSessionId);
|
|
231
|
+
return {
|
|
232
|
+
content: [
|
|
233
|
+
{
|
|
234
|
+
type: 'text',
|
|
235
|
+
text: JSON.stringify(result, null, 2),
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
if (name === 'usage_history') {
|
|
241
|
+
const input = (args ?? {});
|
|
242
|
+
const result = await executeUsageHistory(client, input);
|
|
243
|
+
return {
|
|
244
|
+
content: [
|
|
245
|
+
{
|
|
246
|
+
type: 'text',
|
|
247
|
+
text: JSON.stringify(result, null, 2),
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
if (name === 'credits_ledger') {
|
|
253
|
+
const input = (args ?? {});
|
|
254
|
+
const result = await executeCreditsLedger(client, input);
|
|
255
|
+
return {
|
|
256
|
+
content: [
|
|
257
|
+
{
|
|
258
|
+
type: 'text',
|
|
259
|
+
text: JSON.stringify(result, null, 2),
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
// Unknown tool.
|
|
265
|
+
return {
|
|
266
|
+
content: [
|
|
267
|
+
{
|
|
268
|
+
type: 'text',
|
|
269
|
+
text: JSON.stringify({
|
|
270
|
+
error: `Unknown tool: ${rawName}`,
|
|
271
|
+
available_tools: ['discover', 'inspect', 'call', 'usage_history', 'credits_ledger'],
|
|
272
|
+
}),
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
isError: true,
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
// Handle API errors.
|
|
280
|
+
if (isApiError(error)) {
|
|
301
281
|
return {
|
|
302
282
|
content: [
|
|
303
283
|
{
|
|
304
284
|
type: 'text',
|
|
305
285
|
text: JSON.stringify({
|
|
306
|
-
error:
|
|
307
|
-
|
|
286
|
+
error: error.message,
|
|
287
|
+
status: error.status,
|
|
288
|
+
...(error.details !== undefined && { details: error.details }),
|
|
289
|
+
...(error.cause && { cause: error.cause }),
|
|
290
|
+
observability: compactObject({
|
|
291
|
+
...mcpObservability,
|
|
292
|
+
api: error.observability,
|
|
293
|
+
}),
|
|
308
294
|
}),
|
|
309
295
|
},
|
|
310
296
|
],
|
|
311
297
|
isError: true,
|
|
312
298
|
};
|
|
313
299
|
}
|
|
300
|
+
// Handle other errors (including fetch network errors).
|
|
301
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
302
|
+
const errorCause = error instanceof Error && error.cause instanceof Error
|
|
303
|
+
? error.cause.message
|
|
304
|
+
: undefined;
|
|
305
|
+
return {
|
|
306
|
+
content: [
|
|
307
|
+
{
|
|
308
|
+
type: 'text',
|
|
309
|
+
text: JSON.stringify({
|
|
310
|
+
error: errorMessage,
|
|
311
|
+
...(errorCause && { cause: errorCause }),
|
|
312
|
+
}),
|
|
313
|
+
},
|
|
314
|
+
],
|
|
315
|
+
isError: true,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Main entry point for the Qveris MCP Server.
|
|
321
|
+
*
|
|
322
|
+
* Sets up the MCP server with stdio transport, registers the discover,
|
|
323
|
+
* inspect, and call handlers, and starts listening for requests.
|
|
324
|
+
*/
|
|
325
|
+
export async function main() {
|
|
326
|
+
// Initialize API client (validates QVERIS_API_KEY)
|
|
327
|
+
let client;
|
|
328
|
+
try {
|
|
329
|
+
client = createClientFromEnv();
|
|
330
|
+
}
|
|
331
|
+
catch (error) {
|
|
332
|
+
console.error(error instanceof Error ? error.message : 'Failed to initialize Qveris client');
|
|
333
|
+
process.exit(1);
|
|
334
|
+
}
|
|
335
|
+
// Generate a default session ID for this server instance
|
|
336
|
+
const defaultSessionId = uuidv4();
|
|
337
|
+
// Create MCP server
|
|
338
|
+
const server = new Server({
|
|
339
|
+
name: SERVER_NAME,
|
|
340
|
+
version: SERVER_VERSION,
|
|
341
|
+
}, {
|
|
342
|
+
capabilities: {
|
|
343
|
+
tools: {},
|
|
344
|
+
},
|
|
345
|
+
});
|
|
346
|
+
// =========================================================================
|
|
347
|
+
// Tool Handlers
|
|
348
|
+
// =========================================================================
|
|
349
|
+
/**
|
|
350
|
+
* Lists available tools.
|
|
351
|
+
* Returns the discover, inspect, and call definitions (plus deprecated aliases).
|
|
352
|
+
*/
|
|
353
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
354
|
+
return {
|
|
355
|
+
tools: listQverisMcpTools(),
|
|
356
|
+
};
|
|
357
|
+
});
|
|
358
|
+
/**
|
|
359
|
+
* Handles tool execution requests.
|
|
360
|
+
* Routes to the appropriate handler based on tool name.
|
|
361
|
+
* Deprecated aliases emit a warning to stderr.
|
|
362
|
+
*/
|
|
363
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
364
|
+
const { name, arguments: args } = request.params;
|
|
365
|
+
return executeQverisMcpTool(client, defaultSessionId, name, args);
|
|
314
366
|
});
|
|
315
367
|
// =========================================================================
|
|
316
368
|
// Start Server
|
|
@@ -330,9 +382,26 @@ function isApiError(error) {
|
|
|
330
382
|
'status' in error &&
|
|
331
383
|
'message' in error);
|
|
332
384
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
385
|
+
export function isEntrypoint(argvEntry, moduleUrl = import.meta.url) {
|
|
386
|
+
if (!argvEntry)
|
|
387
|
+
return false;
|
|
388
|
+
try {
|
|
389
|
+
return pathToFileURL(realpathSync(argvEntry)).href === moduleUrl;
|
|
390
|
+
}
|
|
391
|
+
catch {
|
|
392
|
+
try {
|
|
393
|
+
return pathToFileURL(argvEntry).href === moduleUrl;
|
|
394
|
+
}
|
|
395
|
+
catch {
|
|
396
|
+
return false;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
// Run the server only when this file is the process entrypoint.
|
|
401
|
+
if (isEntrypoint(process.argv[1])) {
|
|
402
|
+
main().catch((error) => {
|
|
403
|
+
console.error('Fatal error:', error);
|
|
404
|
+
process.exit(1);
|
|
405
|
+
});
|
|
406
|
+
}
|
|
338
407
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,mBAAmB,EAAgB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EACL,iBAAiB,EACjB,kBAAkB,GAEnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,GAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GAErB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GAErB,MAAM,2BAA2B,CAAC;AAGnC,+EAA+E;AAC/E,uBAAuB;AACvB,+EAA+E;AAE/E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,GAAG,QAAQ,CAAC;AAC7B,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/D;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,MAAM,E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