@qverisai/mcp 0.6.0 → 0.7.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 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
- Add the QVeris server to your MCP client configuration:
27
-
28
- **Claude Desktop** (`claude_desktop_config.json`):
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/QVerisAI.git
302
- cd QVerisAI/packages/mcp
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/QVerisAI/issues)
337
+ - 🐛 [Issue Tracker](https://github.com/QVerisAI/qveris-agent-toolkit/issues)
321
338
  - 💬 Contact: contact@qveris.ai
322
339
 
package/dist/index.d.ts CHANGED
@@ -16,12 +16,224 @@
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
- export {};
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>;
27
239
  //# sourceMappingURL=index.d.ts.map
@@ -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;AAI5C,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;AAEF;;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,CAyLzB;AAED;;;;;GAKG;AACH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CA8D1C"}
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,7 @@
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 { pathToFileURL } from 'node:url';
29
30
  import { v4 as uuidv4 } from 'uuid';
30
31
  import { createClientFromEnv } from './api/client.js';
31
32
  import { searchToolsSchema, executeSearchTools, } from './tools/search.js';
@@ -41,276 +42,291 @@ const SERVER_NAME = 'qveris';
41
42
  const require = createRequire(import.meta.url);
42
43
  const { version: SERVER_VERSION } = require('../package.json');
43
44
  /**
44
- * Main entry point for the Qveris MCP Server.
45
+ * List the MCP tools exposed by this server.
45
46
  *
46
- * Sets up the MCP server with stdio transport, registers the discover,
47
- * inspect, and call handlers, and starts listening for requests.
47
+ * Kept as a pure export so the public MCP interface can be tested without
48
+ * starting stdio transport.
48
49
  */
49
- async function main() {
50
- // Initialize API client (validates QVERIS_API_KEY)
51
- let client;
52
- try {
53
- client = createClientFromEnv();
54
- }
55
- catch (error) {
56
- console.error(error instanceof Error ? error.message : 'Failed to initialize Qveris client');
57
- process.exit(1);
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: {},
50
+ export function listQverisMcpTools() {
51
+ return [
52
+ // Primary tools (aligned with CLI naming)
53
+ {
54
+ name: 'discover',
55
+ description: 'Discover available tools based on natural language queries. ' +
56
+ 'Returns relevant tools that can help accomplish tasks. ' +
57
+ 'Use this to find tools before inspecting or calling them. ' +
58
+ 'Results may include billing_rule metadata for rule-level pricing.',
59
+ inputSchema: searchToolsSchema,
68
60
  },
69
- });
70
- // =========================================================================
71
- // Tool Handlers
72
- // =========================================================================
73
- /**
74
- * Lists available tools.
75
- * Returns the discover, inspect, and call definitions (plus deprecated aliases).
76
- */
77
- server.setRequestHandler(ListToolsRequestSchema, async () => {
78
- return {
79
- tools: [
80
- // Primary tools (aligned with CLI naming)
81
- {
82
- name: 'discover',
83
- description: 'Discover available tools based on natural language queries. ' +
84
- 'Returns relevant tools that can help accomplish tasks. ' +
85
- 'Use this to find tools before inspecting or calling them. ' +
86
- 'Results may include billing_rule metadata for rule-level pricing.',
87
- inputSchema: searchToolsSchema,
88
- },
89
- {
90
- name: 'inspect',
91
- description: 'Inspect tools by their IDs to get detailed information. ' +
92
- 'Returns parameters, success rate, latency, examples, and billing_rule when available. ' +
93
- 'Use tool_ids from a previous discover call.',
94
- inputSchema: getToolsByIdsSchema,
95
- },
96
- {
97
- name: 'call',
98
- description: 'Call a specific remote tool with provided parameters. ' +
99
- 'The tool_id and search_id must come from a previous discover call. ' +
100
- 'Pass parameters to the tool through params_to_tool. ' +
101
- 'The response may include pre-settlement billing; use usage_history or credits_ledger for final charge status.',
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);
61
+ {
62
+ name: 'inspect',
63
+ description: 'Inspect tools by their IDs to get detailed information. ' +
64
+ 'Returns parameters, success rate, latency, examples, and billing_rule when available. ' +
65
+ 'Use tool_ids from a previous discover call.',
66
+ inputSchema: getToolsByIdsSchema,
67
+ },
68
+ {
69
+ name: 'call',
70
+ description: 'Call a specific remote tool with provided parameters. ' +
71
+ 'The tool_id and search_id must come from a previous discover call. ' +
72
+ 'Pass parameters to the tool through params_to_tool. ' +
73
+ 'The response may include pre-settlement billing; use usage_history or credits_ledger for final charge status.',
74
+ inputSchema: executeToolSchema,
75
+ },
76
+ {
77
+ name: 'usage_history',
78
+ 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.',
79
+ inputSchema: usageHistorySchema,
80
+ },
81
+ {
82
+ name: 'credits_ledger',
83
+ 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.',
84
+ inputSchema: creditsLedgerSchema,
85
+ },
86
+ // Deprecated aliases (backward compatibility)
87
+ {
88
+ name: 'search_tools',
89
+ description: '[Deprecated: use "discover" instead] Search for available tools based on natural language queries.',
90
+ inputSchema: searchToolsSchema,
91
+ },
92
+ {
93
+ name: 'get_tools_by_ids',
94
+ description: '[Deprecated: use "inspect" instead] Get descriptions of tools based on their tool IDs.',
95
+ inputSchema: getToolsByIdsSchema,
96
+ },
97
+ {
98
+ name: 'execute_tool',
99
+ description: '[Deprecated: use "call" instead] Execute a specific remote tool with provided parameters.',
100
+ inputSchema: executeToolSchema,
101
+ },
102
+ ];
103
+ }
104
+ // Deprecated tool name aliases -> canonical names.
105
+ export const DEPRECATED_ALIASES = {
106
+ search_tools: 'discover',
107
+ get_tools_by_ids: 'inspect',
108
+ execute_tool: 'call',
109
+ };
110
+ /**
111
+ * Route one MCP tool call to the matching Qveris operation.
112
+ */
113
+ export async function executeQverisMcpTool(client, defaultSessionId, rawName, args, warn = (message) => process.stderr.write(message)) {
114
+ // Resolve deprecated aliases.
115
+ let name = rawName;
116
+ if (DEPRECATED_ALIASES[rawName]) {
117
+ name = DEPRECATED_ALIASES[rawName];
118
+ warn(`[qveris] Deprecated: "${rawName}" -> use "${name}" instead\n`);
119
+ }
120
+ try {
121
+ if (name === 'discover') {
122
+ const input = (args ?? {});
123
+ // Validate required fields.
124
+ if (!input.query || typeof input.query !== 'string') {
244
125
  return {
245
126
  content: [
246
127
  {
247
128
  type: 'text',
248
- text: JSON.stringify(result, null, 2),
129
+ text: JSON.stringify({
130
+ error: 'Missing required parameter: query',
131
+ hint: 'Provide a natural language query describing the tool capability you need',
132
+ }),
249
133
  },
250
134
  ],
135
+ isError: true,
251
136
  };
252
137
  }
253
- if (name === 'credits_ledger') {
254
- const input = (args ?? {});
255
- const result = await executeCreditsLedger(client, input);
138
+ const result = await executeSearchTools(client, input, defaultSessionId);
139
+ return {
140
+ content: [
141
+ {
142
+ type: 'text',
143
+ text: JSON.stringify(result, null, 2),
144
+ },
145
+ ],
146
+ };
147
+ }
148
+ if (name === 'inspect') {
149
+ const input = (args ?? {});
150
+ // Validate required fields.
151
+ if (!input.tool_ids || !Array.isArray(input.tool_ids) || input.tool_ids.length === 0) {
256
152
  return {
257
153
  content: [
258
154
  {
259
155
  type: 'text',
260
- text: JSON.stringify(result, null, 2),
156
+ text: JSON.stringify({
157
+ error: 'Missing or invalid required parameter: tool_ids',
158
+ hint: 'Provide an array of tool IDs (at least one) to retrieve tool information',
159
+ }),
261
160
  },
262
161
  ],
162
+ isError: true,
263
163
  };
264
164
  }
265
- // Unknown tool
165
+ const result = await executeGetToolsByIds(client, input, defaultSessionId);
266
166
  return {
267
167
  content: [
268
168
  {
269
169
  type: 'text',
270
- text: JSON.stringify({
271
- error: `Unknown tool: ${rawName}`,
272
- available_tools: ['discover', 'inspect', 'call', 'usage_history', 'credits_ledger'],
273
- }),
170
+ text: JSON.stringify(result, null, 2),
274
171
  },
275
172
  ],
276
- isError: true,
277
173
  };
278
174
  }
279
- catch (error) {
280
- // Handle API errors
281
- if (isApiError(error)) {
175
+ if (name === 'call') {
176
+ const input = (args ?? {});
177
+ // Validate required fields.
178
+ const missingFields = [];
179
+ if (!input.tool_id)
180
+ missingFields.push('tool_id');
181
+ if (!input.search_id)
182
+ missingFields.push('search_id');
183
+ if (!input.params_to_tool)
184
+ missingFields.push('params_to_tool');
185
+ if (missingFields.length > 0) {
282
186
  return {
283
187
  content: [
284
188
  {
285
189
  type: 'text',
286
190
  text: JSON.stringify({
287
- error: error.message,
288
- status: error.status,
289
- details: error.details,
191
+ error: `Missing required parameters: ${missingFields.join(', ')}`,
192
+ hint: 'tool_id and search_id must come from a previous discover call',
290
193
  }),
291
194
  },
292
195
  ],
293
196
  isError: true,
294
197
  };
295
198
  }
296
- // Handle other errors (including fetch network errors)
297
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
298
- const errorCause = error instanceof Error && error.cause instanceof Error
299
- ? error.cause.message
300
- : undefined;
199
+ const result = await executeExecuteTool(client, input, defaultSessionId);
200
+ return {
201
+ content: [
202
+ {
203
+ type: 'text',
204
+ text: JSON.stringify(result, null, 2),
205
+ },
206
+ ],
207
+ };
208
+ }
209
+ if (name === 'usage_history') {
210
+ const input = (args ?? {});
211
+ const result = await executeUsageHistory(client, input);
212
+ return {
213
+ content: [
214
+ {
215
+ type: 'text',
216
+ text: JSON.stringify(result, null, 2),
217
+ },
218
+ ],
219
+ };
220
+ }
221
+ if (name === 'credits_ledger') {
222
+ const input = (args ?? {});
223
+ const result = await executeCreditsLedger(client, input);
224
+ return {
225
+ content: [
226
+ {
227
+ type: 'text',
228
+ text: JSON.stringify(result, null, 2),
229
+ },
230
+ ],
231
+ };
232
+ }
233
+ // Unknown tool.
234
+ return {
235
+ content: [
236
+ {
237
+ type: 'text',
238
+ text: JSON.stringify({
239
+ error: `Unknown tool: ${rawName}`,
240
+ available_tools: ['discover', 'inspect', 'call', 'usage_history', 'credits_ledger'],
241
+ }),
242
+ },
243
+ ],
244
+ isError: true,
245
+ };
246
+ }
247
+ catch (error) {
248
+ // Handle API errors.
249
+ if (isApiError(error)) {
301
250
  return {
302
251
  content: [
303
252
  {
304
253
  type: 'text',
305
254
  text: JSON.stringify({
306
- error: errorMessage,
307
- ...(errorCause && { cause: errorCause }),
255
+ error: error.message,
256
+ status: error.status,
257
+ details: error.details,
308
258
  }),
309
259
  },
310
260
  ],
311
261
  isError: true,
312
262
  };
313
263
  }
264
+ // Handle other errors (including fetch network errors).
265
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
266
+ const errorCause = error instanceof Error && error.cause instanceof Error
267
+ ? error.cause.message
268
+ : undefined;
269
+ return {
270
+ content: [
271
+ {
272
+ type: 'text',
273
+ text: JSON.stringify({
274
+ error: errorMessage,
275
+ ...(errorCause && { cause: errorCause }),
276
+ }),
277
+ },
278
+ ],
279
+ isError: true,
280
+ };
281
+ }
282
+ }
283
+ /**
284
+ * Main entry point for the Qveris MCP Server.
285
+ *
286
+ * Sets up the MCP server with stdio transport, registers the discover,
287
+ * inspect, and call handlers, and starts listening for requests.
288
+ */
289
+ export async function main() {
290
+ // Initialize API client (validates QVERIS_API_KEY)
291
+ let client;
292
+ try {
293
+ client = createClientFromEnv();
294
+ }
295
+ catch (error) {
296
+ console.error(error instanceof Error ? error.message : 'Failed to initialize Qveris client');
297
+ process.exit(1);
298
+ }
299
+ // Generate a default session ID for this server instance
300
+ const defaultSessionId = uuidv4();
301
+ // Create MCP server
302
+ const server = new Server({
303
+ name: SERVER_NAME,
304
+ version: SERVER_VERSION,
305
+ }, {
306
+ capabilities: {
307
+ tools: {},
308
+ },
309
+ });
310
+ // =========================================================================
311
+ // Tool Handlers
312
+ // =========================================================================
313
+ /**
314
+ * Lists available tools.
315
+ * Returns the discover, inspect, and call definitions (plus deprecated aliases).
316
+ */
317
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
318
+ return {
319
+ tools: listQverisMcpTools(),
320
+ };
321
+ });
322
+ /**
323
+ * Handles tool execution requests.
324
+ * Routes to the appropriate handler based on tool name.
325
+ * Deprecated aliases emit a warning to stderr.
326
+ */
327
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
328
+ const { name, arguments: args } = request.params;
329
+ return executeQverisMcpTool(client, defaultSessionId, name, args);
314
330
  });
315
331
  // =========================================================================
316
332
  // Start Server
@@ -330,9 +346,12 @@ function isApiError(error) {
330
346
  'status' in error &&
331
347
  'message' in error);
332
348
  }
333
- // Run the server
334
- main().catch((error) => {
335
- console.error('Fatal error:', error);
336
- process.exit(1);
337
- });
349
+ // Run the server only when this file is the process entrypoint.
350
+ const entrypoint = process.argv[1] ? pathToFileURL(process.argv[1]).href : undefined;
351
+ if (entrypoint === import.meta.url) {
352
+ main().catch((error) => {
353
+ console.error('Fatal error:', error);
354
+ process.exit(1);
355
+ });
356
+ }
338
357
  //# 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,0BAA0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;IACf,4EAA4E;IAE5E,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,8DAA8D;IAC9D,OAAO,CAAC,KAAK,CAAC,sBAAsB,cAAc,UAAU,CAAC,CAAC;IAC9D,OAAO,CAAC,KAAK,CAAC,eAAe,gBAAgB,EAAE,CAAC,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,QAAQ,IAAI,KAAK;QACjB,SAAS,IAAI,KAAK,CACnB,CAAC;AACJ,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACrF,IAAI,UAAU,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IACnC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -47,7 +47,7 @@ export interface ExecuteToolInput {
47
47
  max_response_size?: number;
48
48
  }
49
49
  /**
50
- * JSON Schema for the execute_tool tool input.
50
+ * JSON Schema for the call tool input.
51
51
  * Used by MCP to validate and document the tool parameters.
52
52
  */
53
53
  export declare const executeToolSchema: {
@@ -78,7 +78,7 @@ export declare const executeToolSchema: {
78
78
  required: string[];
79
79
  };
80
80
  /**
81
- * Executes the execute_tool operation.
81
+ * Executes the call operation.
82
82
  *
83
83
  * @param client - Initialized Qveris API client
84
84
  * @param input - Execution parameters
@@ -7,7 +7,7 @@
7
7
  * @module tools/execute
8
8
  */
9
9
  /**
10
- * JSON Schema for the execute_tool tool input.
10
+ * JSON Schema for the call tool input.
11
11
  * Used by MCP to validate and document the tool parameters.
12
12
  */
13
13
  export const executeToolSchema = {
@@ -44,7 +44,7 @@ export const executeToolSchema = {
44
44
  required: ['tool_id', 'search_id', 'params_to_tool'],
45
45
  };
46
46
  /**
47
- * Executes the execute_tool operation.
47
+ * Executes the call operation.
48
48
  *
49
49
  * @param client - Initialized Qveris API client
50
50
  * @param input - Execution parameters
@@ -32,7 +32,7 @@ export interface GetToolsByIdsInput {
32
32
  session_id?: string;
33
33
  }
34
34
  /**
35
- * JSON Schema for the get_tools_by_ids tool input.
35
+ * JSON Schema for the inspect tool input.
36
36
  * Used by MCP to validate and document the tool parameters.
37
37
  */
38
38
  export declare const getToolsByIdsSchema: {
@@ -58,7 +58,7 @@ export declare const getToolsByIdsSchema: {
58
58
  required: string[];
59
59
  };
60
60
  /**
61
- * Executes the get_tools_by_ids operation.
61
+ * Executes the inspect operation.
62
62
  *
63
63
  * @param client - Initialized Qveris API client
64
64
  * @param input - Request parameters with tool IDs
@@ -8,7 +8,7 @@
8
8
  * @module tools/get-by-ids
9
9
  */
10
10
  /**
11
- * JSON Schema for the get_tools_by_ids tool input.
11
+ * JSON Schema for the inspect tool input.
12
12
  * Used by MCP to validate and document the tool parameters.
13
13
  */
14
14
  export const getToolsByIdsSchema = {
@@ -37,7 +37,7 @@ export const getToolsByIdsSchema = {
37
37
  required: ['tool_ids'],
38
38
  };
39
39
  /**
40
- * Executes the get_tools_by_ids operation.
40
+ * Executes the inspect operation.
41
41
  *
42
42
  * @param client - Initialized Qveris API client
43
43
  * @param input - Request parameters with tool IDs
@@ -35,7 +35,7 @@ export interface SearchToolsInput {
35
35
  session_id?: string;
36
36
  }
37
37
  /**
38
- * JSON Schema for the search_tools tool input.
38
+ * JSON Schema for the discover tool input.
39
39
  * Used by MCP to validate and document the tool parameters.
40
40
  */
41
41
  export declare const searchToolsSchema: {
@@ -60,7 +60,7 @@ export declare const searchToolsSchema: {
60
60
  required: string[];
61
61
  };
62
62
  /**
63
- * Executes the search_tools operation.
63
+ * Executes the discover operation.
64
64
  *
65
65
  * @param client - Initialized Qveris API client
66
66
  * @param input - Search parameters
@@ -7,7 +7,7 @@
7
7
  * @module tools/search
8
8
  */
9
9
  /**
10
- * JSON Schema for the search_tools tool input.
10
+ * JSON Schema for the discover tool input.
11
11
  * Used by MCP to validate and document the tool parameters.
12
12
  */
13
13
  export const searchToolsSchema = {
@@ -35,7 +35,7 @@ export const searchToolsSchema = {
35
35
  required: ['query'],
36
36
  };
37
37
  /**
38
- * Executes the search_tools operation.
38
+ * Executes the discover operation.
39
39
  *
40
40
  * @param client - Initialized Qveris API client
41
41
  * @param input - Search parameters
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qverisai/mcp",
3
- "version": "0.6.0",
4
- "description": "Official QVeris AI MCP Server SDK - Search and execute tools via natural language",
3
+ "version": "0.7.0",
4
+ "description": "QVeris MCP server for agent tool discovery, inspection, and calling",
5
5
  "keywords": [
6
6
  "qveris",
7
7
  "mcp",
@@ -14,12 +14,12 @@
14
14
  "license": "MIT",
15
15
  "repository": {
16
16
  "type": "git",
17
- "url": "https://github.com/QVerisAI/QVerisAI",
17
+ "url": "https://github.com/QVerisAI/qveris-agent-toolkit",
18
18
  "directory": "packages/mcp"
19
19
  },
20
20
  "homepage": "https://qveris.ai",
21
21
  "bugs": {
22
- "url": "https://github.com/QVerisAI/QVerisAI/issues"
22
+ "url": "https://github.com/QVerisAI/qveris-agent-toolkit/issues"
23
23
  },
24
24
  "type": "module",
25
25
  "main": "dist/index.js",
@@ -38,7 +38,8 @@
38
38
  "test:watch": "vitest",
39
39
  "test:coverage": "vitest run --coverage",
40
40
  "prepublishOnly": "npm run build",
41
- "typecheck": "tsc --noEmit"
41
+ "typecheck": "tsc --noEmit",
42
+ "gen:openapi": "openapi-typescript ../../docs/openapi/qveris-public-api.openapi.json -o src/generated/openapi.d.ts && npx prettier --write src/generated/openapi.d.ts"
42
43
  },
43
44
  "dependencies": {
44
45
  "@modelcontextprotocol/sdk": "^1.0.0",
@@ -47,6 +48,7 @@
47
48
  "devDependencies": {
48
49
  "@types/node": "^22.10.1",
49
50
  "@types/uuid": "^10.0.0",
51
+ "openapi-typescript": "7.4.4",
50
52
  "typescript": "^5.7.2",
51
53
  "vitest": "^2.1.0"
52
54
  },