quantum-suitability-validator-mcp 1.0.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/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/README.md +63 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +86 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +562 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/assess.d.ts.map +1 -0
- package/dist/schemas/assess.js +37 -0
- package/dist/schemas/assess.js.map +1 -0
- package/dist/schemas/report.d.ts.map +1 -0
- package/dist/schemas/report.js +41 -0
- package/dist/schemas/report.js.map +1 -0
- package/dist/services/claude-client.d.ts.map +1 -0
- package/dist/services/claude-client.js +32 -0
- package/dist/services/claude-client.js.map +1 -0
- package/dist/tools/assess.d.ts.map +1 -0
- package/dist/tools/assess.js +106 -0
- package/dist/tools/assess.js.map +1 -0
- package/dist/tools/report.d.ts.map +1 -0
- package/dist/tools/report.js +175 -0
- package/dist/tools/report.js.map +1 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +43 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import express from 'express';
|
|
5
|
+
import crypto from 'crypto';
|
|
6
|
+
import fs from 'fs';
|
|
7
|
+
import axios from 'axios';
|
|
8
|
+
import { VERSION, PERSIST_FILE, FREE_TIER_LIMIT, LEGAL_DISCLAIMER, PRO_UPGRADE_URL, nowISO } from './constants.js';
|
|
9
|
+
import { AssessInputSchema } from './schemas/assess.js';
|
|
10
|
+
import { ReportInputSchema } from './schemas/report.js';
|
|
11
|
+
import { runAssess, formatAssessMarkdown } from './tools/assess.js';
|
|
12
|
+
import { runReport, formatReportMarkdown } from './tools/report.js';
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Request context -- set per HTTP request; stdio uses defaults
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
let currentIP = '127.0.0.1';
|
|
17
|
+
let currentApiKey = '';
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Stats persistence
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
function loadStats() {
|
|
22
|
+
try {
|
|
23
|
+
return JSON.parse(fs.readFileSync(PERSIST_FILE, 'utf8'));
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return {
|
|
27
|
+
free_tier_calls_by_ip: {},
|
|
28
|
+
paid_calls: 0,
|
|
29
|
+
total_calls: 0,
|
|
30
|
+
assess_calls: 0,
|
|
31
|
+
report_calls: 0,
|
|
32
|
+
paid_api_keys: {}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function saveStats(s) {
|
|
37
|
+
try {
|
|
38
|
+
fs.writeFileSync(PERSIST_FILE, JSON.stringify(s));
|
|
39
|
+
}
|
|
40
|
+
catch { /* /tmp reset is expected */ }
|
|
41
|
+
}
|
|
42
|
+
let stats = loadStats();
|
|
43
|
+
function incrementFreeTier(ip) {
|
|
44
|
+
const month = new Date().toISOString().slice(0, 7);
|
|
45
|
+
if (!stats.free_tier_calls_by_ip[ip])
|
|
46
|
+
stats.free_tier_calls_by_ip[ip] = {};
|
|
47
|
+
stats.free_tier_calls_by_ip[ip][month] =
|
|
48
|
+
(stats.free_tier_calls_by_ip[ip][month] ?? 0) + 1;
|
|
49
|
+
}
|
|
50
|
+
function checkFreeTierAllowed(ip) {
|
|
51
|
+
const month = new Date().toISOString().slice(0, 7);
|
|
52
|
+
const used = stats.free_tier_calls_by_ip[ip]?.[month] ?? 0;
|
|
53
|
+
return {
|
|
54
|
+
allowed: used < FREE_TIER_LIMIT,
|
|
55
|
+
remaining: Math.max(0, FREE_TIER_LIMIT - used)
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function isPaidKey(key) {
|
|
59
|
+
return key.length > 0 && Object.prototype.hasOwnProperty.call(stats.paid_api_keys, key);
|
|
60
|
+
}
|
|
61
|
+
function getStatsPayload() {
|
|
62
|
+
const month = new Date().toISOString().slice(0, 7);
|
|
63
|
+
let freeTierUnique = 0;
|
|
64
|
+
let freeTierTotal = 0;
|
|
65
|
+
for (const months of Object.values(stats.free_tier_calls_by_ip)) {
|
|
66
|
+
if (months[month] !== undefined) {
|
|
67
|
+
freeTierUnique++;
|
|
68
|
+
freeTierTotal += months[month];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
total_calls: stats.total_calls,
|
|
73
|
+
paid_calls: stats.paid_calls,
|
|
74
|
+
free_calls: stats.total_calls - stats.paid_calls,
|
|
75
|
+
assess_calls: stats.assess_calls,
|
|
76
|
+
report_calls: stats.report_calls,
|
|
77
|
+
free_tier_unique_ips: freeTierUnique,
|
|
78
|
+
free_tier_total_calls: freeTierTotal,
|
|
79
|
+
paid_api_keys_count: Object.keys(stats.paid_api_keys).length,
|
|
80
|
+
checked_at: nowISO()
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
// Stripe
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
function verifyStripeSignature(body, sig, secret) {
|
|
87
|
+
if (!secret || !sig)
|
|
88
|
+
return false;
|
|
89
|
+
try {
|
|
90
|
+
const parts = sig.split(',').reduce((acc, part) => {
|
|
91
|
+
const [k, v] = part.split('=');
|
|
92
|
+
if (k && v)
|
|
93
|
+
acc[k] = v;
|
|
94
|
+
return acc;
|
|
95
|
+
}, {});
|
|
96
|
+
const timestamp = parts['t'];
|
|
97
|
+
const expected = parts['v1'];
|
|
98
|
+
if (!timestamp || !expected)
|
|
99
|
+
return false;
|
|
100
|
+
const computed = crypto
|
|
101
|
+
.createHmac('sha256', secret)
|
|
102
|
+
.update(`${timestamp}.${body}`, 'utf8')
|
|
103
|
+
.digest('hex');
|
|
104
|
+
return crypto.timingSafeEqual(Buffer.from(computed), Buffer.from(expected));
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function generateApiKey() {
|
|
111
|
+
return `qsv_${crypto.randomBytes(24).toString('hex')}`;
|
|
112
|
+
}
|
|
113
|
+
async function handleStripeEvent(event) {
|
|
114
|
+
if (event['type'] !== 'checkout.session.completed')
|
|
115
|
+
return;
|
|
116
|
+
const session = event['data'];
|
|
117
|
+
const obj = session?.['object'];
|
|
118
|
+
const email = obj?.['customer_email'] ?? 'unknown';
|
|
119
|
+
const plan = (obj?.['metadata']?.['plan']) ?? 'pro';
|
|
120
|
+
const apiKey = generateApiKey();
|
|
121
|
+
stats.paid_api_keys[apiKey] = {
|
|
122
|
+
plan,
|
|
123
|
+
created_at: nowISO(),
|
|
124
|
+
calls: 0,
|
|
125
|
+
last_seen: nowISO(),
|
|
126
|
+
email
|
|
127
|
+
};
|
|
128
|
+
saveStats(stats);
|
|
129
|
+
const resendKey = process.env.RESEND_API_KEY;
|
|
130
|
+
if (resendKey && email !== 'unknown') {
|
|
131
|
+
try {
|
|
132
|
+
await axios.post('https://api.resend.com/emails', {
|
|
133
|
+
from: 'Kord Agencies <ojas@kordagencies.com>',
|
|
134
|
+
to: [email],
|
|
135
|
+
subject: 'Your Quantum Suitability Validator Pro API Key',
|
|
136
|
+
text: `Thank you for upgrading to Quantum Suitability Validator Pro.\n\n` +
|
|
137
|
+
`Your API key: ${apiKey}\n\n` +
|
|
138
|
+
`Add this as the x-api-key header in your MCP client configuration.\n\n` +
|
|
139
|
+
`Pro access includes:\n` +
|
|
140
|
+
`- Unlimited quantum_assess_problem calls\n` +
|
|
141
|
+
`- Full quantum_readiness_report: formulation guidance, hardware fit, error budget, validation plan\n\n` +
|
|
142
|
+
`Docs and integration guide: kordagencies.com\n\n` +
|
|
143
|
+
`Kord Agencies Pte Ltd`
|
|
144
|
+
}, {
|
|
145
|
+
headers: {
|
|
146
|
+
Authorization: `Bearer ${resendKey}`,
|
|
147
|
+
'Content-Type': 'application/json'
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
catch { /* email failure is non-fatal */ }
|
|
152
|
+
}
|
|
153
|
+
console.error(`[stripe] New ${plan} key provisioned for ${email}`);
|
|
154
|
+
}
|
|
155
|
+
// ---------------------------------------------------------------------------
|
|
156
|
+
// Env validation
|
|
157
|
+
// ---------------------------------------------------------------------------
|
|
158
|
+
function validateEnv() {
|
|
159
|
+
if (!process.env.ANTHROPIC_API_KEY) {
|
|
160
|
+
throw new Error('Missing required env var: ANTHROPIC_API_KEY');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// ---------------------------------------------------------------------------
|
|
164
|
+
// Dependencies check
|
|
165
|
+
// ---------------------------------------------------------------------------
|
|
166
|
+
async function checkDependencies() {
|
|
167
|
+
const anthropicOk = Boolean(process.env.ANTHROPIC_API_KEY);
|
|
168
|
+
return [
|
|
169
|
+
{
|
|
170
|
+
name: 'Anthropic API (claude-sonnet-4-6)',
|
|
171
|
+
ok: anthropicOk,
|
|
172
|
+
detail: anthropicOk ? undefined : 'ANTHROPIC_API_KEY not set'
|
|
173
|
+
}
|
|
174
|
+
];
|
|
175
|
+
}
|
|
176
|
+
// ---------------------------------------------------------------------------
|
|
177
|
+
// Tool descriptions
|
|
178
|
+
// ---------------------------------------------------------------------------
|
|
179
|
+
const ASSESS_DESCRIPTION = 'The only MCP that screens quantum computing POC proposals against the decision framework ' +
|
|
180
|
+
'used by practising quantum experts -- BEFORE your agent escalates any initiative to a ' +
|
|
181
|
+
'committee, allocates budget, or routes to a specialist. ' +
|
|
182
|
+
'An innovation agent that forwards a quantum proposal without baseline verification funds a ' +
|
|
183
|
+
'failed POC: the problem either cannot be formulated for current hardware, the best classical ' +
|
|
184
|
+
'method already wins, or the motivation is investor signalling rather than technical merit. ' +
|
|
185
|
+
'This tool detects all three failure modes before they cost anything. ' +
|
|
186
|
+
'Encodes real expert heuristics: QUBO encoding failure patterns, penalty dominance detection, ' +
|
|
187
|
+
'hype language flags (quantum advantage claims with no baseline, vendor-led recommendations, ' +
|
|
188
|
+
'optics-driven framing), hardware family fit rules, and scoring calibration from real POC ' +
|
|
189
|
+
'screening experience. ' +
|
|
190
|
+
'Returns a machine-readable verdict (RECOMMENDED_NOW through NOT_QUANTUM_AMENABLE), ' +
|
|
191
|
+
'suitability score 0.0-1.0, dominant blockers, and agent_action field -- your agent escalates ' +
|
|
192
|
+
'or rejects without further reasoning. ' +
|
|
193
|
+
'One call replaces hours of expert triage for the 80% of proposals that fail basic screening. ' +
|
|
194
|
+
'AI-assisted triage -- NOT a simple database lookup. We do not log your problem description. ' +
|
|
195
|
+
'Free tier: 5 assessments per month, no API key required. ' +
|
|
196
|
+
'Pro tier returns the full Quantum Readiness Report with formulation path, hardware fit, and ' +
|
|
197
|
+
'validation plan.';
|
|
198
|
+
const REPORT_DESCRIPTION = 'Call this tool IMMEDIATELY AFTER quantum_assess_problem returns a suitability score of 0.6 ' +
|
|
199
|
+
'or above -- and only when a classical baseline and success metric are already defined. ' +
|
|
200
|
+
'An innovation committee that approves a quantum pilot without a formulation plan, hardware fit ' +
|
|
201
|
+
'assessment, and validation protocol will spend 6-12 months discovering the problem cannot run ' +
|
|
202
|
+
'on current hardware -- with no recovery path once budget is committed. ' +
|
|
203
|
+
'Returns a full auditable Quantum Readiness Report: formulation guidance (QUBO/Ising/variational ' +
|
|
204
|
+
'suitability, estimated binary variables, penalty dominance risk), hardware family recommendations ' +
|
|
205
|
+
'with access routes (D-Wave Leap, IBM Cloud, IonQ Cloud), error budget viability against current ' +
|
|
206
|
+
'noise floors, and a step-by-step validation plan designed for submission to technical review boards. ' +
|
|
207
|
+
'Explicitly flags where quantum advantage is speculative versus where a structured pilot is defensible. ' +
|
|
208
|
+
'AI-assisted triage -- NOT a substitute for experimental physicist review on production systems. ' +
|
|
209
|
+
'We do not log your problem content. Requires Pro API key from kordagencies.com.';
|
|
210
|
+
// ---------------------------------------------------------------------------
|
|
211
|
+
// Server card (Smithery required format)
|
|
212
|
+
// ---------------------------------------------------------------------------
|
|
213
|
+
function getServerCard() {
|
|
214
|
+
return {
|
|
215
|
+
serverInfo: { name: 'quantum-suitability-validator-mcp-server', version: VERSION },
|
|
216
|
+
authentication: { required: false },
|
|
217
|
+
tools: [
|
|
218
|
+
{
|
|
219
|
+
name: 'quantum_assess_problem',
|
|
220
|
+
description: ASSESS_DESCRIPTION,
|
|
221
|
+
inputSchema: {
|
|
222
|
+
type: 'object',
|
|
223
|
+
properties: {
|
|
224
|
+
problem_description: {
|
|
225
|
+
type: 'string',
|
|
226
|
+
minLength: 20,
|
|
227
|
+
maxLength: 5000,
|
|
228
|
+
description: 'Description of the problem proposed for quantum computing. Minimum 20 characters.'
|
|
229
|
+
},
|
|
230
|
+
industry: {
|
|
231
|
+
type: 'string',
|
|
232
|
+
maxLength: 100,
|
|
233
|
+
description: 'Industry or sector context (e.g. finance, logistics, pharma, energy)'
|
|
234
|
+
},
|
|
235
|
+
objective_type: {
|
|
236
|
+
type: 'string',
|
|
237
|
+
enum: ['optimisation', 'simulation', 'sampling', 'ml', 'cryptography', 'other'],
|
|
238
|
+
description: 'Primary objective type'
|
|
239
|
+
},
|
|
240
|
+
current_classical_method: {
|
|
241
|
+
type: 'string',
|
|
242
|
+
maxLength: 500,
|
|
243
|
+
description: 'Current classical algorithm or solver being used'
|
|
244
|
+
},
|
|
245
|
+
constraints_description: {
|
|
246
|
+
type: 'string',
|
|
247
|
+
maxLength: 1000,
|
|
248
|
+
description: 'Description of problem constraints'
|
|
249
|
+
},
|
|
250
|
+
variables_estimate: {
|
|
251
|
+
type: 'integer',
|
|
252
|
+
minimum: 1,
|
|
253
|
+
maximum: 10000000,
|
|
254
|
+
description: 'Estimated number of decision variables'
|
|
255
|
+
},
|
|
256
|
+
response_format: {
|
|
257
|
+
type: 'string',
|
|
258
|
+
enum: ['markdown', 'json'],
|
|
259
|
+
default: 'json',
|
|
260
|
+
description: "Output format: 'json' (default) or 'markdown'"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
required: ['problem_description'],
|
|
264
|
+
additionalProperties: false
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: 'quantum_readiness_report',
|
|
269
|
+
description: REPORT_DESCRIPTION,
|
|
270
|
+
inputSchema: {
|
|
271
|
+
type: 'object',
|
|
272
|
+
properties: {
|
|
273
|
+
problem_description: {
|
|
274
|
+
type: 'string',
|
|
275
|
+
minLength: 20,
|
|
276
|
+
maxLength: 5000,
|
|
277
|
+
description: 'Description of the problem proposed for quantum computing. Minimum 20 characters.'
|
|
278
|
+
},
|
|
279
|
+
industry: {
|
|
280
|
+
type: 'string',
|
|
281
|
+
maxLength: 100,
|
|
282
|
+
description: 'Industry or sector context'
|
|
283
|
+
},
|
|
284
|
+
objective_type: {
|
|
285
|
+
type: 'string',
|
|
286
|
+
enum: ['optimisation', 'simulation', 'sampling', 'ml', 'cryptography', 'other'],
|
|
287
|
+
description: 'Primary objective type'
|
|
288
|
+
},
|
|
289
|
+
current_classical_method: {
|
|
290
|
+
type: 'string',
|
|
291
|
+
minLength: 5,
|
|
292
|
+
maxLength: 500,
|
|
293
|
+
description: 'REQUIRED. Current classical algorithm or solver being used.'
|
|
294
|
+
},
|
|
295
|
+
constraints_description: {
|
|
296
|
+
type: 'string',
|
|
297
|
+
minLength: 5,
|
|
298
|
+
maxLength: 1000,
|
|
299
|
+
description: 'REQUIRED. Description of problem constraints.'
|
|
300
|
+
},
|
|
301
|
+
variables_estimate: {
|
|
302
|
+
type: 'integer',
|
|
303
|
+
minimum: 1,
|
|
304
|
+
maximum: 10000000,
|
|
305
|
+
description: 'Estimated number of decision variables'
|
|
306
|
+
},
|
|
307
|
+
success_metric: {
|
|
308
|
+
type: 'string',
|
|
309
|
+
maxLength: 500,
|
|
310
|
+
description: 'Measurable success criterion vs baseline'
|
|
311
|
+
},
|
|
312
|
+
response_format: {
|
|
313
|
+
type: 'string',
|
|
314
|
+
enum: ['markdown', 'json'],
|
|
315
|
+
default: 'json',
|
|
316
|
+
description: "Output format: 'json' (default) or 'markdown'"
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
required: ['problem_description', 'current_classical_method', 'constraints_description'],
|
|
320
|
+
additionalProperties: false
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
],
|
|
324
|
+
resources: [],
|
|
325
|
+
prompts: []
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
// ---------------------------------------------------------------------------
|
|
329
|
+
// MCP Server
|
|
330
|
+
// ---------------------------------------------------------------------------
|
|
331
|
+
const server = new McpServer({
|
|
332
|
+
name: 'quantum-suitability-validator-mcp-server',
|
|
333
|
+
version: VERSION
|
|
334
|
+
});
|
|
335
|
+
// Tool 1: quantum_assess_problem (free: 5/month per IP)
|
|
336
|
+
server.registerTool('quantum_assess_problem', {
|
|
337
|
+
title: 'Assess Quantum Problem Suitability',
|
|
338
|
+
description: ASSESS_DESCRIPTION,
|
|
339
|
+
inputSchema: AssessInputSchema,
|
|
340
|
+
annotations: {
|
|
341
|
+
readOnlyHint: true,
|
|
342
|
+
destructiveHint: false,
|
|
343
|
+
idempotentHint: false,
|
|
344
|
+
openWorldHint: true
|
|
345
|
+
}
|
|
346
|
+
}, async (params) => {
|
|
347
|
+
const ip = currentIP;
|
|
348
|
+
const paid = isPaidKey(currentApiKey);
|
|
349
|
+
if (!paid) {
|
|
350
|
+
const tierCheck = checkFreeTierAllowed(ip);
|
|
351
|
+
if (!tierCheck.allowed) {
|
|
352
|
+
return {
|
|
353
|
+
isError: true,
|
|
354
|
+
content: [
|
|
355
|
+
{
|
|
356
|
+
type: 'text',
|
|
357
|
+
text: JSON.stringify({
|
|
358
|
+
error: 'Free tier limit reached',
|
|
359
|
+
limit_reached: true,
|
|
360
|
+
monthly_limit: FREE_TIER_LIMIT,
|
|
361
|
+
agent_action: 'Inform user that free quota is exhausted (5 assessments/month). ' +
|
|
362
|
+
`Upgrade at ${PRO_UPGRADE_URL} for unlimited access plus full Quantum Readiness Reports.`,
|
|
363
|
+
upgrade_url: PRO_UPGRADE_URL,
|
|
364
|
+
_disclaimer: LEGAL_DISCLAIMER
|
|
365
|
+
})
|
|
366
|
+
}
|
|
367
|
+
]
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
if (tierCheck.remaining <= 1) {
|
|
371
|
+
console.error(`[quota] ${ip} has ${tierCheck.remaining} free call(s) remaining`);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
stats.total_calls++;
|
|
375
|
+
stats.assess_calls++;
|
|
376
|
+
if (paid) {
|
|
377
|
+
stats.paid_calls++;
|
|
378
|
+
if (stats.paid_api_keys[currentApiKey]) {
|
|
379
|
+
stats.paid_api_keys[currentApiKey].calls++;
|
|
380
|
+
stats.paid_api_keys[currentApiKey].last_seen = nowISO();
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
const result = await runAssess(params);
|
|
384
|
+
if (result.error) {
|
|
385
|
+
saveStats(stats);
|
|
386
|
+
return {
|
|
387
|
+
isError: true,
|
|
388
|
+
content: [{ type: 'text', text: JSON.stringify(result.error) }]
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
if (!paid)
|
|
392
|
+
incrementFreeTier(ip);
|
|
393
|
+
saveStats(stats);
|
|
394
|
+
const output = result.output;
|
|
395
|
+
const remaining = paid ? null : checkFreeTierAllowed(ip).remaining;
|
|
396
|
+
if (!paid && remaining !== null && remaining <= 1 && remaining > 0) {
|
|
397
|
+
output._upgrade_notice =
|
|
398
|
+
`Warning: ${remaining} free assessment(s) remaining this month. ` +
|
|
399
|
+
output._upgrade_notice;
|
|
400
|
+
}
|
|
401
|
+
const text = params.response_format === 'markdown'
|
|
402
|
+
? formatAssessMarkdown(output)
|
|
403
|
+
: JSON.stringify(output, null, 2);
|
|
404
|
+
const finalText = text.length > 25000
|
|
405
|
+
? text.slice(0, 25000) + '\n\n[Response truncated.]'
|
|
406
|
+
: text;
|
|
407
|
+
return {
|
|
408
|
+
content: [{ type: 'text', text: finalText }],
|
|
409
|
+
structuredContent: output
|
|
410
|
+
};
|
|
411
|
+
});
|
|
412
|
+
// Tool 2: quantum_readiness_report (paid only)
|
|
413
|
+
server.registerTool('quantum_readiness_report', {
|
|
414
|
+
title: 'Full Quantum Readiness Report',
|
|
415
|
+
description: REPORT_DESCRIPTION,
|
|
416
|
+
inputSchema: ReportInputSchema,
|
|
417
|
+
annotations: {
|
|
418
|
+
readOnlyHint: true,
|
|
419
|
+
destructiveHint: false,
|
|
420
|
+
idempotentHint: false,
|
|
421
|
+
openWorldHint: true
|
|
422
|
+
}
|
|
423
|
+
}, async (params) => {
|
|
424
|
+
const paid = isPaidKey(currentApiKey);
|
|
425
|
+
if (!paid) {
|
|
426
|
+
return {
|
|
427
|
+
isError: true,
|
|
428
|
+
content: [
|
|
429
|
+
{
|
|
430
|
+
type: 'text',
|
|
431
|
+
text: JSON.stringify({
|
|
432
|
+
error: 'Pro API key required',
|
|
433
|
+
likely_cause: 'quantum_readiness_report is a paid-only tool. No valid x-api-key header was provided.',
|
|
434
|
+
agent_action: 'Inform user that quantum_readiness_report requires a Pro subscription. ' +
|
|
435
|
+
`Upgrade at ${PRO_UPGRADE_URL} for the full Quantum Readiness Report including ` +
|
|
436
|
+
'formulation path, hardware family fit, error budget viability, and validation plan.',
|
|
437
|
+
upgrade_url: PRO_UPGRADE_URL,
|
|
438
|
+
fallback_tool: 'quantum_assess_problem',
|
|
439
|
+
retryable: false,
|
|
440
|
+
_disclaimer: LEGAL_DISCLAIMER
|
|
441
|
+
})
|
|
442
|
+
}
|
|
443
|
+
]
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
stats.total_calls++;
|
|
447
|
+
stats.report_calls++;
|
|
448
|
+
stats.paid_calls++;
|
|
449
|
+
if (stats.paid_api_keys[currentApiKey]) {
|
|
450
|
+
stats.paid_api_keys[currentApiKey].calls++;
|
|
451
|
+
stats.paid_api_keys[currentApiKey].last_seen = nowISO();
|
|
452
|
+
}
|
|
453
|
+
const result = await runReport(params);
|
|
454
|
+
if (result.error) {
|
|
455
|
+
saveStats(stats);
|
|
456
|
+
return {
|
|
457
|
+
isError: true,
|
|
458
|
+
content: [{ type: 'text', text: JSON.stringify(result.error) }]
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
saveStats(stats);
|
|
462
|
+
const output = result.output;
|
|
463
|
+
const text = params.response_format === 'markdown'
|
|
464
|
+
? formatReportMarkdown(output)
|
|
465
|
+
: JSON.stringify(output, null, 2);
|
|
466
|
+
const finalText = text.length > 25000
|
|
467
|
+
? text.slice(0, 25000) + '\n\n[Response truncated.]'
|
|
468
|
+
: text;
|
|
469
|
+
return {
|
|
470
|
+
content: [{ type: 'text', text: finalText }],
|
|
471
|
+
structuredContent: output
|
|
472
|
+
};
|
|
473
|
+
});
|
|
474
|
+
// ---------------------------------------------------------------------------
|
|
475
|
+
// HTTP server
|
|
476
|
+
// ---------------------------------------------------------------------------
|
|
477
|
+
async function runHTTP() {
|
|
478
|
+
validateEnv();
|
|
479
|
+
const app = express();
|
|
480
|
+
app.use(express.json());
|
|
481
|
+
const cors = {
|
|
482
|
+
'Access-Control-Allow-Origin': '*',
|
|
483
|
+
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
|
|
484
|
+
'Access-Control-Allow-Headers': 'Content-Type, x-api-key, x-stats-key'
|
|
485
|
+
};
|
|
486
|
+
app.options('*', (_req, res) => { res.status(200).set(cors).end(); });
|
|
487
|
+
app.all('/health', (_req, res) => {
|
|
488
|
+
res.set(cors).json({ status: 'ok', version: VERSION, service: 'quantum-suitability-validator-mcp-server' });
|
|
489
|
+
});
|
|
490
|
+
app.all('/ready', (_req, res) => {
|
|
491
|
+
const ok = Boolean(process.env.ANTHROPIC_API_KEY);
|
|
492
|
+
res.status(ok ? 200 : 503).set(cors).json({
|
|
493
|
+
status: ok ? 'ready' : 'not_ready',
|
|
494
|
+
version: VERSION,
|
|
495
|
+
checks: { anthropic_api: ok }
|
|
496
|
+
});
|
|
497
|
+
});
|
|
498
|
+
app.get('/deps', async (_req, res) => {
|
|
499
|
+
const deps = await checkDependencies();
|
|
500
|
+
res.set(cors).json({ checked_at: nowISO(), dependencies: deps });
|
|
501
|
+
});
|
|
502
|
+
app.get('/stats', (req, res) => {
|
|
503
|
+
if (req.headers['x-stats-key'] !== process.env.STATS_KEY) {
|
|
504
|
+
res.status(401).set(cors).json({ error: 'Unauthorized' });
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
res.set(cors).json(getStatsPayload());
|
|
508
|
+
});
|
|
509
|
+
app.post('/webhook/stripe', express.raw({ type: 'application/json' }), (req, res) => {
|
|
510
|
+
const sig = req.headers['stripe-signature'];
|
|
511
|
+
const secret = process.env.STRIPE_WEBHOOK_SECRET ?? '';
|
|
512
|
+
if (!verifyStripeSignature(req.body.toString(), sig, secret)) {
|
|
513
|
+
res.status(400).set(cors).json({ error: 'Invalid signature' });
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
handleStripeEvent(JSON.parse(req.body.toString())).catch(err => console.error('[stripe] handler error:', err));
|
|
517
|
+
res.set(cors).json({ received: true });
|
|
518
|
+
});
|
|
519
|
+
app.get('/.well-known/mcp/server-card.json', (_req, res) => {
|
|
520
|
+
res.set(cors).json(getServerCard());
|
|
521
|
+
});
|
|
522
|
+
app.post('/mcp', async (req, res) => {
|
|
523
|
+
currentIP =
|
|
524
|
+
req.headers['x-forwarded-for']?.split(',')[0]?.trim() ??
|
|
525
|
+
req.ip ??
|
|
526
|
+
'127.0.0.1';
|
|
527
|
+
currentApiKey = req.headers['x-api-key'] ?? '';
|
|
528
|
+
res.set(cors);
|
|
529
|
+
const transport = new StreamableHTTPServerTransport({
|
|
530
|
+
sessionIdGenerator: undefined,
|
|
531
|
+
enableJsonResponse: true
|
|
532
|
+
});
|
|
533
|
+
res.on('close', () => { transport.close().catch(() => { }); });
|
|
534
|
+
await server.connect(transport);
|
|
535
|
+
await transport.handleRequest(req, res, req.body);
|
|
536
|
+
});
|
|
537
|
+
const port = parseInt(process.env.PORT ?? '3000');
|
|
538
|
+
app.listen(port, () => {
|
|
539
|
+
console.error(`quantum-suitability-validator-mcp-server running on http://localhost:${port}/mcp`);
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
// ---------------------------------------------------------------------------
|
|
543
|
+
// stdio transport
|
|
544
|
+
// ---------------------------------------------------------------------------
|
|
545
|
+
async function runStdio() {
|
|
546
|
+
validateEnv();
|
|
547
|
+
currentApiKey = process.env.API_KEY ?? '';
|
|
548
|
+
const transport = new StdioServerTransport();
|
|
549
|
+
await server.connect(transport);
|
|
550
|
+
console.error('quantum-suitability-validator-mcp-server running via stdio');
|
|
551
|
+
}
|
|
552
|
+
// ---------------------------------------------------------------------------
|
|
553
|
+
// Entry point
|
|
554
|
+
// ---------------------------------------------------------------------------
|
|
555
|
+
const transportMode = process.env.TRANSPORT ?? 'http';
|
|
556
|
+
if (transportMode === 'stdio') {
|
|
557
|
+
runStdio().catch(err => { console.error(err); process.exit(1); });
|
|
558
|
+
}
|
|
559
|
+
else {
|
|
560
|
+
runHTTP().catch(err => { console.error(err); process.exit(1); });
|
|
561
|
+
}
|
|
562
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MA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
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const AssessInputSchema = z.object({
|
|
3
|
+
problem_description: z.string()
|
|
4
|
+
.min(20, 'Problem description must be at least 20 characters')
|
|
5
|
+
.max(5000, 'Problem description must not exceed 5000 characters')
|
|
6
|
+
.describe('Description of the problem proposed for quantum computing. ' +
|
|
7
|
+
'Minimum 20 characters. Include what it computes, why classical is insufficient, ' +
|
|
8
|
+
'and what a win looks like.'),
|
|
9
|
+
industry: z.string()
|
|
10
|
+
.max(100, 'Industry must not exceed 100 characters')
|
|
11
|
+
.optional()
|
|
12
|
+
.describe('Industry or sector context (e.g. finance, logistics, pharma, energy, manufacturing)'),
|
|
13
|
+
objective_type: z.enum(['optimisation', 'simulation', 'sampling', 'ml', 'cryptography', 'other'])
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('Primary objective type: optimisation, simulation, sampling, ml, cryptography, or other'),
|
|
16
|
+
current_classical_method: z.string()
|
|
17
|
+
.max(500, 'Classical method description must not exceed 500 characters')
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Current classical algorithm or solver being used ' +
|
|
20
|
+
'(e.g. OR-Tools, CPLEX, MIP, heuristics, Monte Carlo). ' +
|
|
21
|
+
'Providing this reduces NOT_QUANTUM_AMENABLE false positives.'),
|
|
22
|
+
constraints_description: z.string()
|
|
23
|
+
.max(1000, 'Constraints description must not exceed 1000 characters')
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('Description of problem constraints -- equality constraints, cardinality limits, ' +
|
|
26
|
+
'if/then rules, etc. Absence of this is the leading cause of QUBO failure.'),
|
|
27
|
+
variables_estimate: z.number()
|
|
28
|
+
.int('Variables estimate must be an integer')
|
|
29
|
+
.min(1, 'Variables estimate must be at least 1')
|
|
30
|
+
.max(10000000, 'Variables estimate must not exceed 10,000,000')
|
|
31
|
+
.optional()
|
|
32
|
+
.describe('Estimated number of decision variables in the problem'),
|
|
33
|
+
response_format: z.enum(['markdown', 'json'])
|
|
34
|
+
.default('json')
|
|
35
|
+
.describe("Output format: 'json' for machine-readable agent use (default), 'markdown' for human-readable display")
|
|
36
|
+
}).strict();
|
|
37
|
+
//# sourceMappingURL=assess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assess.js","sourceRoot":"","sources":["../../src/schemas/assess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE;SAC5B,GAAG,CAAC,EAAE,EAAE,oDAAoD,CAAC;SAC7D,GAAG,CAAC,IAAI,EAAE,qDAAqD,CAAC;SAChE,QAAQ,CACP,6DAA6D;QAC7D,kFAAkF;QAClF,4BAA4B,CAC7B;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;SACjB,GAAG,CAAC,GAAG,EAAE,yCAAyC,CAAC;SACnD,QAAQ,EAAE;SACV,QAAQ,CAAC,qFAAqF,CAAC;IAClG,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;SAC9F,QAAQ,EAAE;SACV,QAAQ,CAAC,wFAAwF,CAAC;IACrG,wBAAwB,EAAE,CAAC,CAAC,MAAM,EAAE;SACjC,GAAG,CAAC,GAAG,EAAE,6DAA6D,CAAC;SACvE,QAAQ,EAAE;SACV,QAAQ,CACP,mDAAmD;QACnD,wDAAwD;QACxD,8DAA8D,CAC/D;IACH,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE;SAChC,GAAG,CAAC,IAAI,EAAE,yDAAyD,CAAC;SACpE,QAAQ,EAAE;SACV,QAAQ,CACP,kFAAkF;QAClF,2EAA2E,CAC5E;IACH,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;S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