@didit-protocol/mcp-server 3.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/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +32 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +818 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/auth.d.ts +6 -0
- package/dist/tools/auth.d.ts.map +1 -0
- package/dist/tools/auth.js +45 -0
- package/dist/tools/auth.js.map +1 -0
- package/dist/tools/billing.d.ts +3 -0
- package/dist/tools/billing.d.ts.map +1 -0
- package/dist/tools/billing.js +22 -0
- package/dist/tools/billing.js.map +1 -0
- package/dist/tools/blocklist.d.ts +4 -0
- package/dist/tools/blocklist.d.ts.map +1 -0
- package/dist/tools/blocklist.js +30 -0
- package/dist/tools/blocklist.js.map +1 -0
- package/dist/tools/questionnaires.d.ts +6 -0
- package/dist/tools/questionnaires.d.ts.map +1 -0
- package/dist/tools/questionnaires.js +44 -0
- package/dist/tools/questionnaires.js.map +1 -0
- package/dist/tools/sessions.d.ts +12 -0
- package/dist/tools/sessions.d.ts.map +1 -0
- package/dist/tools/sessions.js +99 -0
- package/dist/tools/sessions.js.map +1 -0
- package/dist/tools/settings.d.ts +6 -0
- package/dist/tools/settings.d.ts.map +1 -0
- package/dist/tools/settings.js +42 -0
- package/dist/tools/settings.js.map +1 -0
- package/dist/tools/standalone.d.ts +13 -0
- package/dist/tools/standalone.d.ts.map +1 -0
- package/dist/tools/standalone.js +136 -0
- package/dist/tools/standalone.js.map +1 -0
- package/dist/tools/users.d.ts +5 -0
- package/dist/tools/users.d.ts.map +1 -0
- package/dist/tools/users.js +39 -0
- package/dist/tools/users.js.map +1 -0
- package/package.json +27 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,818 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
38
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
39
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
40
|
+
const auth = __importStar(require("./tools/auth"));
|
|
41
|
+
const sessions = __importStar(require("./tools/sessions"));
|
|
42
|
+
const settings = __importStar(require("./tools/settings"));
|
|
43
|
+
const billing = __importStar(require("./tools/billing"));
|
|
44
|
+
const users = __importStar(require("./tools/users"));
|
|
45
|
+
const questionnaires = __importStar(require("./tools/questionnaires"));
|
|
46
|
+
const blocklist = __importStar(require("./tools/blocklist"));
|
|
47
|
+
const standalone = __importStar(require("./tools/standalone"));
|
|
48
|
+
const server = new index_js_1.Server({ name: "didit", version: "3.0.0" }, { capabilities: { tools: {} } });
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
// Tool definitions
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
53
|
+
tools: [
|
|
54
|
+
// ── Auth ────────────────────────────────────────────────────────────
|
|
55
|
+
{
|
|
56
|
+
name: "didit_register",
|
|
57
|
+
description: "Register a new Didit account. A 6-character verification code is sent to the email. Follow up with didit_verify_email.",
|
|
58
|
+
inputSchema: {
|
|
59
|
+
type: "object",
|
|
60
|
+
properties: {
|
|
61
|
+
email: { type: "string", description: "Email address" },
|
|
62
|
+
password: { type: "string", description: "Password (min 8 chars, must include uppercase, lowercase, digit, special char)" },
|
|
63
|
+
},
|
|
64
|
+
required: ["email", "password"],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "didit_verify_email",
|
|
69
|
+
description: "Verify email with the 6-character code. Returns access_token, refresh_token, organization, application (with client_id and api_key).",
|
|
70
|
+
inputSchema: {
|
|
71
|
+
type: "object",
|
|
72
|
+
properties: {
|
|
73
|
+
email: { type: "string" },
|
|
74
|
+
code: { type: "string", description: "6-character alphanumeric code from email" },
|
|
75
|
+
},
|
|
76
|
+
required: ["email", "code"],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "didit_login",
|
|
81
|
+
description: "Login to existing Didit account. Returns access_token and refresh_token.",
|
|
82
|
+
inputSchema: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {
|
|
85
|
+
email: { type: "string" },
|
|
86
|
+
password: { type: "string" },
|
|
87
|
+
},
|
|
88
|
+
required: ["email", "password"],
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: "didit_list_organizations",
|
|
93
|
+
description: "List all organizations the authenticated user belongs to. Requires access_token from login or verify_email.",
|
|
94
|
+
inputSchema: {
|
|
95
|
+
type: "object",
|
|
96
|
+
properties: {
|
|
97
|
+
access_token: { type: "string", description: "Bearer access token from login/verify_email" },
|
|
98
|
+
},
|
|
99
|
+
required: ["access_token"],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "didit_get_application",
|
|
104
|
+
description: "Get application details including client_id and api_key. Requires access_token.",
|
|
105
|
+
inputSchema: {
|
|
106
|
+
type: "object",
|
|
107
|
+
properties: {
|
|
108
|
+
access_token: { type: "string", description: "Bearer access token" },
|
|
109
|
+
organization_id: { type: "string" },
|
|
110
|
+
application_id: { type: "string" },
|
|
111
|
+
},
|
|
112
|
+
required: ["access_token", "organization_id", "application_id"],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
// ── Sessions ────────────────────────────────────────────────────────
|
|
116
|
+
{
|
|
117
|
+
name: "didit_create_session",
|
|
118
|
+
description: "Create a new identity verification session. Returns session_id, session_url, and session_token.",
|
|
119
|
+
inputSchema: {
|
|
120
|
+
type: "object",
|
|
121
|
+
properties: {
|
|
122
|
+
callback_url: { type: "string", description: "URL to redirect user after verification" },
|
|
123
|
+
vendor_data: { type: "string", description: "Your unique identifier for the user (e.g. user ID)" },
|
|
124
|
+
features: { type: "string", description: "Comma-separated features: ocr,face,liveness,aml,phone,email,poa,questionnaire" },
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "didit_list_sessions",
|
|
130
|
+
description: "List verification sessions with optional filters and pagination.",
|
|
131
|
+
inputSchema: {
|
|
132
|
+
type: "object",
|
|
133
|
+
properties: {
|
|
134
|
+
status: { type: "string", description: "Filter by status: Approved, Declined, In Review, Pending" },
|
|
135
|
+
vendor_data: { type: "string", description: "Filter by vendor_data" },
|
|
136
|
+
limit: { type: "string", description: "Number of results per page" },
|
|
137
|
+
offset: { type: "string", description: "Pagination offset" },
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "didit_get_session_decision",
|
|
143
|
+
description: "Get the full verification decision and all extracted data for a session.",
|
|
144
|
+
inputSchema: {
|
|
145
|
+
type: "object",
|
|
146
|
+
properties: {
|
|
147
|
+
session_id: { type: "string", description: "Session UUID" },
|
|
148
|
+
},
|
|
149
|
+
required: ["session_id"],
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "didit_update_session_status",
|
|
154
|
+
description: "Approve, decline, or request resubmission of a session. Resubmitted sessions keep already-approved steps.",
|
|
155
|
+
inputSchema: {
|
|
156
|
+
type: "object",
|
|
157
|
+
properties: {
|
|
158
|
+
session_id: { type: "string" },
|
|
159
|
+
status: { type: "string", description: "New status: Approved, Declined, Resubmission Requested" },
|
|
160
|
+
},
|
|
161
|
+
required: ["session_id", "status"],
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: "didit_delete_session",
|
|
166
|
+
description: "Permanently delete a single verification session and all associated data.",
|
|
167
|
+
inputSchema: {
|
|
168
|
+
type: "object",
|
|
169
|
+
properties: {
|
|
170
|
+
session_id: { type: "string" },
|
|
171
|
+
},
|
|
172
|
+
required: ["session_id"],
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "didit_batch_delete_sessions",
|
|
177
|
+
description: "Delete multiple sessions by session numbers, or delete all sessions.",
|
|
178
|
+
inputSchema: {
|
|
179
|
+
type: "object",
|
|
180
|
+
properties: {
|
|
181
|
+
session_numbers: {
|
|
182
|
+
type: "array",
|
|
183
|
+
items: { type: "number" },
|
|
184
|
+
description: "Array of session numbers to delete",
|
|
185
|
+
},
|
|
186
|
+
delete_all: { type: "boolean", description: "Set true to delete ALL sessions (ignores session_numbers)" },
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "didit_generate_session_pdf",
|
|
192
|
+
description: "Generate a PDF verification report for a session.",
|
|
193
|
+
inputSchema: {
|
|
194
|
+
type: "object",
|
|
195
|
+
properties: {
|
|
196
|
+
session_id: { type: "string" },
|
|
197
|
+
},
|
|
198
|
+
required: ["session_id"],
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: "didit_list_session_reviews",
|
|
203
|
+
description: "List the review history and activity log for a session.",
|
|
204
|
+
inputSchema: {
|
|
205
|
+
type: "object",
|
|
206
|
+
properties: {
|
|
207
|
+
session_id: { type: "string" },
|
|
208
|
+
},
|
|
209
|
+
required: ["session_id"],
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: "didit_add_session_review",
|
|
214
|
+
description: "Add a review note or status change to a session.",
|
|
215
|
+
inputSchema: {
|
|
216
|
+
type: "object",
|
|
217
|
+
properties: {
|
|
218
|
+
session_id: { type: "string" },
|
|
219
|
+
comment: { type: "string", description: "Review comment or note" },
|
|
220
|
+
status: { type: "string", description: "Optional new status" },
|
|
221
|
+
},
|
|
222
|
+
required: ["session_id"],
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: "didit_share_session",
|
|
227
|
+
description: "Share a verified session with a trusted partner for reusable KYC (B2B session sharing).",
|
|
228
|
+
inputSchema: {
|
|
229
|
+
type: "object",
|
|
230
|
+
properties: {
|
|
231
|
+
session_id: { type: "string" },
|
|
232
|
+
partner_client_id: { type: "string", description: "The partner application's client_id" },
|
|
233
|
+
},
|
|
234
|
+
required: ["session_id", "partner_client_id"],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: "didit_import_shared_session",
|
|
239
|
+
description: "Import a shared verification session from a partner (Reusable KYC).",
|
|
240
|
+
inputSchema: {
|
|
241
|
+
type: "object",
|
|
242
|
+
properties: {
|
|
243
|
+
share_token: { type: "string", description: "Token received from the sharing partner" },
|
|
244
|
+
},
|
|
245
|
+
required: ["share_token"],
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
// ── Workflows (Verification Settings) ───────────────────────────────
|
|
249
|
+
{
|
|
250
|
+
name: "didit_list_workflows",
|
|
251
|
+
description: "List all verification workflows for your application. Each workflow defines verification steps, thresholds, and accepted documents.",
|
|
252
|
+
inputSchema: { type: "object", properties: {} },
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: "didit_create_workflow",
|
|
256
|
+
description: "Create a new verification workflow. Enable features like OCR (ID scan), face match, liveness detection, AML screening, phone, email, proof of address, and questionnaire.",
|
|
257
|
+
inputSchema: {
|
|
258
|
+
type: "object",
|
|
259
|
+
properties: {
|
|
260
|
+
workflow_label: { type: "string", description: "Name for the workflow" },
|
|
261
|
+
is_default: { type: "boolean", description: "Set as default workflow for new sessions" },
|
|
262
|
+
is_ocr_enabled: { type: "boolean", description: "Enable ID document scanning" },
|
|
263
|
+
is_face_match_enabled: { type: "boolean", description: "Enable face match against ID photo" },
|
|
264
|
+
is_liveness_enabled: { type: "boolean", description: "Enable anti-spoofing liveness detection" },
|
|
265
|
+
is_aml_enabled: { type: "boolean", description: "Enable AML/sanctions screening" },
|
|
266
|
+
is_phone_verification_enabled: { type: "boolean", description: "Enable phone number verification" },
|
|
267
|
+
is_email_verification_enabled: { type: "boolean", description: "Enable email verification" },
|
|
268
|
+
is_poa_enabled: { type: "boolean", description: "Enable proof of address" },
|
|
269
|
+
is_questionnaire_enabled: { type: "boolean", description: "Enable custom questionnaire" },
|
|
270
|
+
},
|
|
271
|
+
required: ["workflow_label"],
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: "didit_get_workflow",
|
|
276
|
+
description: "Get the full configuration of a specific workflow.",
|
|
277
|
+
inputSchema: {
|
|
278
|
+
type: "object",
|
|
279
|
+
properties: {
|
|
280
|
+
workflow_id: { type: "string", description: "Workflow UUID" },
|
|
281
|
+
},
|
|
282
|
+
required: ["workflow_id"],
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
name: "didit_update_workflow",
|
|
287
|
+
description: "Update a workflow's configuration (feature toggles, thresholds, accepted documents, etc.).",
|
|
288
|
+
inputSchema: {
|
|
289
|
+
type: "object",
|
|
290
|
+
properties: {
|
|
291
|
+
workflow_id: { type: "string", description: "Workflow UUID" },
|
|
292
|
+
workflow_label: { type: "string" },
|
|
293
|
+
is_default: { type: "boolean" },
|
|
294
|
+
is_ocr_enabled: { type: "boolean" },
|
|
295
|
+
is_face_match_enabled: { type: "boolean" },
|
|
296
|
+
is_liveness_enabled: { type: "boolean" },
|
|
297
|
+
is_aml_enabled: { type: "boolean" },
|
|
298
|
+
is_phone_verification_enabled: { type: "boolean" },
|
|
299
|
+
is_email_verification_enabled: { type: "boolean" },
|
|
300
|
+
is_poa_enabled: { type: "boolean" },
|
|
301
|
+
is_questionnaire_enabled: { type: "boolean" },
|
|
302
|
+
},
|
|
303
|
+
required: ["workflow_id"],
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
name: "didit_delete_workflow",
|
|
308
|
+
description: "Delete a verification workflow. Existing sessions using it are not affected.",
|
|
309
|
+
inputSchema: {
|
|
310
|
+
type: "object",
|
|
311
|
+
properties: {
|
|
312
|
+
workflow_id: { type: "string", description: "Workflow UUID" },
|
|
313
|
+
},
|
|
314
|
+
required: ["workflow_id"],
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
// ── Questionnaires ──────────────────────────────────────────────────
|
|
318
|
+
{
|
|
319
|
+
name: "didit_list_questionnaires",
|
|
320
|
+
description: "List all custom questionnaires for your application.",
|
|
321
|
+
inputSchema: { type: "object", properties: {} },
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
name: "didit_create_questionnaire",
|
|
325
|
+
description: "Create a custom questionnaire with questions, branching logic, and multi-language support.",
|
|
326
|
+
inputSchema: {
|
|
327
|
+
type: "object",
|
|
328
|
+
properties: {
|
|
329
|
+
title: { type: "string", description: "Questionnaire title" },
|
|
330
|
+
description: { type: "string", description: "Description shown to the user" },
|
|
331
|
+
questions: {
|
|
332
|
+
type: "array",
|
|
333
|
+
description: "Array of question objects with type, text, options, and optional branching",
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
required: ["title", "questions"],
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
name: "didit_get_questionnaire",
|
|
341
|
+
description: "Get full details of a specific questionnaire (questions, options, translations).",
|
|
342
|
+
inputSchema: {
|
|
343
|
+
type: "object",
|
|
344
|
+
properties: {
|
|
345
|
+
questionnaire_id: { type: "string", description: "Questionnaire UUID" },
|
|
346
|
+
},
|
|
347
|
+
required: ["questionnaire_id"],
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: "didit_update_questionnaire",
|
|
352
|
+
description: "Update a questionnaire's title, description, questions, or translations.",
|
|
353
|
+
inputSchema: {
|
|
354
|
+
type: "object",
|
|
355
|
+
properties: {
|
|
356
|
+
questionnaire_id: { type: "string", description: "Questionnaire UUID" },
|
|
357
|
+
title: { type: "string" },
|
|
358
|
+
description: { type: "string" },
|
|
359
|
+
questions: { type: "array" },
|
|
360
|
+
},
|
|
361
|
+
required: ["questionnaire_id"],
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
name: "didit_delete_questionnaire",
|
|
366
|
+
description: "Delete a questionnaire.",
|
|
367
|
+
inputSchema: {
|
|
368
|
+
type: "object",
|
|
369
|
+
properties: {
|
|
370
|
+
questionnaire_id: { type: "string", description: "Questionnaire UUID" },
|
|
371
|
+
},
|
|
372
|
+
required: ["questionnaire_id"],
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
// ── Users ───────────────────────────────────────────────────────────
|
|
376
|
+
{
|
|
377
|
+
name: "didit_list_users",
|
|
378
|
+
description: "List all verified users. Supports pagination and status filtering.",
|
|
379
|
+
inputSchema: {
|
|
380
|
+
type: "object",
|
|
381
|
+
properties: {
|
|
382
|
+
status: { type: "string", description: "Filter: Approved, Declined, In Review, Pending" },
|
|
383
|
+
limit: { type: "string" },
|
|
384
|
+
offset: { type: "string" },
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
name: "didit_get_user",
|
|
390
|
+
description: "Get details of a specific user by their vendor_data identifier.",
|
|
391
|
+
inputSchema: {
|
|
392
|
+
type: "object",
|
|
393
|
+
properties: {
|
|
394
|
+
vendor_data: { type: "string", description: "The vendor_data value that identifies the user" },
|
|
395
|
+
},
|
|
396
|
+
required: ["vendor_data"],
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
name: "didit_update_user",
|
|
401
|
+
description: "Update user metadata or tags.",
|
|
402
|
+
inputSchema: {
|
|
403
|
+
type: "object",
|
|
404
|
+
properties: {
|
|
405
|
+
vendor_data: { type: "string", description: "The vendor_data value that identifies the user" },
|
|
406
|
+
tags: { type: "array", items: { type: "string" }, description: "Tags to assign" },
|
|
407
|
+
},
|
|
408
|
+
required: ["vendor_data"],
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
name: "didit_delete_users",
|
|
413
|
+
description: "Batch delete users by vendor_data list, or delete all users.",
|
|
414
|
+
inputSchema: {
|
|
415
|
+
type: "object",
|
|
416
|
+
properties: {
|
|
417
|
+
vendor_data_list: {
|
|
418
|
+
type: "array",
|
|
419
|
+
items: { type: "string" },
|
|
420
|
+
description: "Array of vendor_data values to delete",
|
|
421
|
+
},
|
|
422
|
+
delete_all: { type: "boolean", description: "Set true to delete ALL users" },
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
// ── Billing ─────────────────────────────────────────────────────────
|
|
427
|
+
{
|
|
428
|
+
name: "didit_get_balance",
|
|
429
|
+
description: "Get current credit balance and auto-refill settings.",
|
|
430
|
+
inputSchema: { type: "object", properties: {} },
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
name: "didit_top_up",
|
|
434
|
+
description: "Create a Stripe checkout session to top up credits. Returns a checkout URL.",
|
|
435
|
+
inputSchema: {
|
|
436
|
+
type: "object",
|
|
437
|
+
properties: {
|
|
438
|
+
amount_in_dollars: { type: "number", description: "Amount in USD (minimum $50)" },
|
|
439
|
+
},
|
|
440
|
+
required: ["amount_in_dollars"],
|
|
441
|
+
},
|
|
442
|
+
},
|
|
443
|
+
// ── Blocklist ───────────────────────────────────────────────────────
|
|
444
|
+
{
|
|
445
|
+
name: "didit_list_blocklist",
|
|
446
|
+
description: "List blocklist entries. Filter by item_type: face, document, phone, email.",
|
|
447
|
+
inputSchema: {
|
|
448
|
+
type: "object",
|
|
449
|
+
properties: {
|
|
450
|
+
item_type: { type: "string", description: "Filter: face, document, phone, email" },
|
|
451
|
+
limit: { type: "string" },
|
|
452
|
+
offset: { type: "string" },
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
name: "didit_add_to_blocklist",
|
|
458
|
+
description: "Add faces, documents, phones, and/or emails to the blocklist by session ID.",
|
|
459
|
+
inputSchema: {
|
|
460
|
+
type: "object",
|
|
461
|
+
properties: {
|
|
462
|
+
session_id: { type: "string", description: "Session UUID to blocklist items from" },
|
|
463
|
+
face: { type: "boolean", description: "Block the face from this session" },
|
|
464
|
+
document: { type: "boolean", description: "Block the document from this session" },
|
|
465
|
+
phone: { type: "boolean", description: "Block the phone from this session" },
|
|
466
|
+
email: { type: "boolean", description: "Block the email from this session" },
|
|
467
|
+
},
|
|
468
|
+
required: ["session_id"],
|
|
469
|
+
},
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: "didit_remove_from_blocklist",
|
|
473
|
+
description: "Remove faces, documents, phones, and/or emails from the blocklist by session ID.",
|
|
474
|
+
inputSchema: {
|
|
475
|
+
type: "object",
|
|
476
|
+
properties: {
|
|
477
|
+
session_id: { type: "string", description: "Session UUID to unblock items from" },
|
|
478
|
+
face: { type: "boolean" },
|
|
479
|
+
document: { type: "boolean" },
|
|
480
|
+
phone: { type: "boolean" },
|
|
481
|
+
email: { type: "boolean" },
|
|
482
|
+
},
|
|
483
|
+
required: ["session_id"],
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
// ── Standalone: Identity & Documents ────────────────────────────────
|
|
487
|
+
{
|
|
488
|
+
name: "didit_id_verification",
|
|
489
|
+
description: "Verify an identity document by submitting front (and optionally back) images. Returns structured OCR data and authenticity checks.",
|
|
490
|
+
inputSchema: {
|
|
491
|
+
type: "object",
|
|
492
|
+
properties: {
|
|
493
|
+
front_image_path: { type: "string", description: "Absolute path to front image file" },
|
|
494
|
+
back_image_path: { type: "string", description: "Absolute path to back image file (optional)" },
|
|
495
|
+
},
|
|
496
|
+
required: ["front_image_path"],
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
name: "didit_poa_verification",
|
|
501
|
+
description: "Proof of Address verification. Submit document images to extract and validate address information.",
|
|
502
|
+
inputSchema: {
|
|
503
|
+
type: "object",
|
|
504
|
+
properties: {
|
|
505
|
+
front_image_path: { type: "string", description: "Absolute path to front image file" },
|
|
506
|
+
back_image_path: { type: "string", description: "Absolute path to back image file (optional)" },
|
|
507
|
+
},
|
|
508
|
+
required: ["front_image_path"],
|
|
509
|
+
},
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
name: "didit_database_validation",
|
|
513
|
+
description: "Validate identity data against national and global authoritative data sources.",
|
|
514
|
+
inputSchema: {
|
|
515
|
+
type: "object",
|
|
516
|
+
properties: {
|
|
517
|
+
first_name: { type: "string" },
|
|
518
|
+
last_name: { type: "string" },
|
|
519
|
+
date_of_birth: { type: "string", description: "YYYY-MM-DD format" },
|
|
520
|
+
document_number: { type: "string" },
|
|
521
|
+
country: { type: "string", description: "ISO 3166-1 alpha-2 country code" },
|
|
522
|
+
},
|
|
523
|
+
required: ["first_name", "last_name", "date_of_birth", "country"],
|
|
524
|
+
},
|
|
525
|
+
},
|
|
526
|
+
// ── Standalone: Biometrics & Face ───────────────────────────────────
|
|
527
|
+
{
|
|
528
|
+
name: "didit_passive_liveness",
|
|
529
|
+
description: "Passive liveness detection -- verify a person is physically present from a single image (no interaction required).",
|
|
530
|
+
inputSchema: {
|
|
531
|
+
type: "object",
|
|
532
|
+
properties: {
|
|
533
|
+
image_path: { type: "string", description: "Absolute path to facial image file" },
|
|
534
|
+
},
|
|
535
|
+
required: ["image_path"],
|
|
536
|
+
},
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
name: "didit_face_match",
|
|
540
|
+
description: "Compare two facial images to determine if they belong to the same person (1:1 face matching).",
|
|
541
|
+
inputSchema: {
|
|
542
|
+
type: "object",
|
|
543
|
+
properties: {
|
|
544
|
+
image_1_path: { type: "string", description: "Absolute path to first facial image" },
|
|
545
|
+
image_2_path: { type: "string", description: "Absolute path to second facial image" },
|
|
546
|
+
},
|
|
547
|
+
required: ["image_1_path", "image_2_path"],
|
|
548
|
+
},
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: "didit_face_search",
|
|
552
|
+
description: "Search for a face against a database of previously verified faces (1:N face matching).",
|
|
553
|
+
inputSchema: {
|
|
554
|
+
type: "object",
|
|
555
|
+
properties: {
|
|
556
|
+
image_path: { type: "string", description: "Absolute path to facial image file" },
|
|
557
|
+
},
|
|
558
|
+
required: ["image_path"],
|
|
559
|
+
},
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
name: "didit_age_estimation",
|
|
563
|
+
description: "Estimate a person's age from a facial image. Also performs passive liveness check.",
|
|
564
|
+
inputSchema: {
|
|
565
|
+
type: "object",
|
|
566
|
+
properties: {
|
|
567
|
+
image_path: { type: "string", description: "Absolute path to facial image file" },
|
|
568
|
+
},
|
|
569
|
+
required: ["image_path"],
|
|
570
|
+
},
|
|
571
|
+
},
|
|
572
|
+
// ── Standalone: AML Screening ───────────────────────────────────────
|
|
573
|
+
{
|
|
574
|
+
name: "didit_aml_screening",
|
|
575
|
+
description: "AML screening against global watchlists, PEP lists, and sanctions databases. Supports person and company entity types.",
|
|
576
|
+
inputSchema: {
|
|
577
|
+
type: "object",
|
|
578
|
+
properties: {
|
|
579
|
+
full_name: { type: "string", description: "Full name to screen" },
|
|
580
|
+
date_of_birth: { type: "string", description: "YYYY-MM-DD (optional, improves accuracy)" },
|
|
581
|
+
entity_type: { type: "string", description: "person or company (default: person)" },
|
|
582
|
+
countries: { type: "array", items: { type: "string" }, description: "ISO country codes to filter (optional)" },
|
|
583
|
+
},
|
|
584
|
+
required: ["full_name"],
|
|
585
|
+
},
|
|
586
|
+
},
|
|
587
|
+
// ── Standalone: Email & Phone Verification ──────────────────────────
|
|
588
|
+
{
|
|
589
|
+
name: "didit_email_send",
|
|
590
|
+
description: "Send a one-time verification code to an email address. Code valid for 5 minutes.",
|
|
591
|
+
inputSchema: {
|
|
592
|
+
type: "object",
|
|
593
|
+
properties: {
|
|
594
|
+
email: { type: "string", description: "Email address to verify" },
|
|
595
|
+
},
|
|
596
|
+
required: ["email"],
|
|
597
|
+
},
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
name: "didit_email_check",
|
|
601
|
+
description: "Verify the OTP code sent to an email. Max 3 attempts per code.",
|
|
602
|
+
inputSchema: {
|
|
603
|
+
type: "object",
|
|
604
|
+
properties: {
|
|
605
|
+
email: { type: "string" },
|
|
606
|
+
code: { type: "string", description: "Verification code from email" },
|
|
607
|
+
},
|
|
608
|
+
required: ["email", "code"],
|
|
609
|
+
},
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
name: "didit_phone_send",
|
|
613
|
+
description: "Send a one-time verification code to a phone number via SMS. Code valid for 5 minutes.",
|
|
614
|
+
inputSchema: {
|
|
615
|
+
type: "object",
|
|
616
|
+
properties: {
|
|
617
|
+
phone_number: { type: "string", description: "Phone number with country code (e.g. +1234567890)" },
|
|
618
|
+
},
|
|
619
|
+
required: ["phone_number"],
|
|
620
|
+
},
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
name: "didit_phone_check",
|
|
624
|
+
description: "Verify the OTP code sent to a phone number. Max 3 attempts per code.",
|
|
625
|
+
inputSchema: {
|
|
626
|
+
type: "object",
|
|
627
|
+
properties: {
|
|
628
|
+
phone_number: { type: "string" },
|
|
629
|
+
code: { type: "string", description: "Verification code from SMS" },
|
|
630
|
+
},
|
|
631
|
+
required: ["phone_number", "code"],
|
|
632
|
+
},
|
|
633
|
+
},
|
|
634
|
+
],
|
|
635
|
+
}));
|
|
636
|
+
// ---------------------------------------------------------------------------
|
|
637
|
+
// Tool dispatch
|
|
638
|
+
// ---------------------------------------------------------------------------
|
|
639
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
640
|
+
const { name, arguments: args } = request.params;
|
|
641
|
+
try {
|
|
642
|
+
let result;
|
|
643
|
+
switch (name) {
|
|
644
|
+
// Auth
|
|
645
|
+
case "didit_register":
|
|
646
|
+
result = await auth.register(args.email, args.password);
|
|
647
|
+
break;
|
|
648
|
+
case "didit_verify_email":
|
|
649
|
+
result = await auth.verifyEmail(args.email, args.code);
|
|
650
|
+
break;
|
|
651
|
+
case "didit_login":
|
|
652
|
+
result = await auth.login(args.email, args.password);
|
|
653
|
+
break;
|
|
654
|
+
case "didit_list_organizations":
|
|
655
|
+
result = await auth.listOrganizations(args.access_token);
|
|
656
|
+
break;
|
|
657
|
+
case "didit_get_application":
|
|
658
|
+
result = await auth.getApplication(args.access_token, args.organization_id, args.application_id);
|
|
659
|
+
break;
|
|
660
|
+
// Sessions
|
|
661
|
+
case "didit_create_session":
|
|
662
|
+
result = await sessions.createSession(args || {});
|
|
663
|
+
break;
|
|
664
|
+
case "didit_list_sessions":
|
|
665
|
+
result = await sessions.listSessions(args);
|
|
666
|
+
break;
|
|
667
|
+
case "didit_get_session_decision":
|
|
668
|
+
result = await sessions.getSessionDecision(args.session_id);
|
|
669
|
+
break;
|
|
670
|
+
case "didit_update_session_status":
|
|
671
|
+
result = await sessions.updateSessionStatus(args.session_id, args.status);
|
|
672
|
+
break;
|
|
673
|
+
case "didit_delete_session":
|
|
674
|
+
result = await sessions.deleteSession(args.session_id);
|
|
675
|
+
break;
|
|
676
|
+
case "didit_batch_delete_sessions":
|
|
677
|
+
result = await sessions.batchDeleteSessions(args?.session_numbers, args?.delete_all);
|
|
678
|
+
break;
|
|
679
|
+
case "didit_generate_session_pdf":
|
|
680
|
+
result = await sessions.generateSessionPdf(args.session_id);
|
|
681
|
+
break;
|
|
682
|
+
case "didit_list_session_reviews":
|
|
683
|
+
result = await sessions.listSessionReviews(args.session_id);
|
|
684
|
+
break;
|
|
685
|
+
case "didit_add_session_review":
|
|
686
|
+
result = await sessions.addSessionReview(args.session_id, args);
|
|
687
|
+
break;
|
|
688
|
+
case "didit_share_session":
|
|
689
|
+
result = await sessions.shareSession(args.session_id, args);
|
|
690
|
+
break;
|
|
691
|
+
case "didit_import_shared_session":
|
|
692
|
+
result = await sessions.importSharedSession(args);
|
|
693
|
+
break;
|
|
694
|
+
// Workflows
|
|
695
|
+
case "didit_list_workflows":
|
|
696
|
+
result = await settings.listWorkflows();
|
|
697
|
+
break;
|
|
698
|
+
case "didit_create_workflow":
|
|
699
|
+
result = await settings.createWorkflow(args || {});
|
|
700
|
+
break;
|
|
701
|
+
case "didit_get_workflow":
|
|
702
|
+
result = await settings.getWorkflow(args.workflow_id);
|
|
703
|
+
break;
|
|
704
|
+
case "didit_update_workflow": {
|
|
705
|
+
const { workflow_id, ...data } = args;
|
|
706
|
+
result = await settings.updateWorkflow(workflow_id, data);
|
|
707
|
+
break;
|
|
708
|
+
}
|
|
709
|
+
case "didit_delete_workflow":
|
|
710
|
+
result = await settings.deleteWorkflow(args.workflow_id);
|
|
711
|
+
break;
|
|
712
|
+
// Questionnaires
|
|
713
|
+
case "didit_list_questionnaires":
|
|
714
|
+
result = await questionnaires.listQuestionnaires();
|
|
715
|
+
break;
|
|
716
|
+
case "didit_create_questionnaire":
|
|
717
|
+
result = await questionnaires.createQuestionnaire(args);
|
|
718
|
+
break;
|
|
719
|
+
case "didit_get_questionnaire":
|
|
720
|
+
result = await questionnaires.getQuestionnaire(args.questionnaire_id);
|
|
721
|
+
break;
|
|
722
|
+
case "didit_update_questionnaire": {
|
|
723
|
+
const { questionnaire_id, ...data } = args;
|
|
724
|
+
result = await questionnaires.updateQuestionnaire(questionnaire_id, data);
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
case "didit_delete_questionnaire":
|
|
728
|
+
result = await questionnaires.deleteQuestionnaire(args.questionnaire_id);
|
|
729
|
+
break;
|
|
730
|
+
// Users
|
|
731
|
+
case "didit_list_users":
|
|
732
|
+
result = await users.listUsers(args);
|
|
733
|
+
break;
|
|
734
|
+
case "didit_get_user":
|
|
735
|
+
result = await users.getUser(args.vendor_data);
|
|
736
|
+
break;
|
|
737
|
+
case "didit_update_user": {
|
|
738
|
+
const { vendor_data, ...data } = args;
|
|
739
|
+
result = await users.updateUser(vendor_data, data);
|
|
740
|
+
break;
|
|
741
|
+
}
|
|
742
|
+
case "didit_delete_users":
|
|
743
|
+
result = await users.deleteUsers(args?.vendor_data_list, args?.delete_all);
|
|
744
|
+
break;
|
|
745
|
+
// Billing
|
|
746
|
+
case "didit_get_balance":
|
|
747
|
+
result = await billing.getBalance();
|
|
748
|
+
break;
|
|
749
|
+
case "didit_top_up":
|
|
750
|
+
result = await billing.topUp(args.amount_in_dollars);
|
|
751
|
+
break;
|
|
752
|
+
// Blocklist
|
|
753
|
+
case "didit_list_blocklist":
|
|
754
|
+
result = await blocklist.listBlocklist(args);
|
|
755
|
+
break;
|
|
756
|
+
case "didit_add_to_blocklist":
|
|
757
|
+
result = await blocklist.addToBlocklist(args);
|
|
758
|
+
break;
|
|
759
|
+
case "didit_remove_from_blocklist":
|
|
760
|
+
result = await blocklist.removeFromBlocklist(args);
|
|
761
|
+
break;
|
|
762
|
+
// Standalone: Identity & Documents
|
|
763
|
+
case "didit_id_verification":
|
|
764
|
+
result = await standalone.idVerification(args.front_image_path, args?.back_image_path);
|
|
765
|
+
break;
|
|
766
|
+
case "didit_poa_verification":
|
|
767
|
+
result = await standalone.poaVerification(args.front_image_path, args?.back_image_path);
|
|
768
|
+
break;
|
|
769
|
+
case "didit_database_validation":
|
|
770
|
+
result = await standalone.databaseValidation(args);
|
|
771
|
+
break;
|
|
772
|
+
// Standalone: Biometrics
|
|
773
|
+
case "didit_passive_liveness":
|
|
774
|
+
result = await standalone.passiveLiveness(args.image_path);
|
|
775
|
+
break;
|
|
776
|
+
case "didit_face_match":
|
|
777
|
+
result = await standalone.faceMatch(args.image_1_path, args.image_2_path);
|
|
778
|
+
break;
|
|
779
|
+
case "didit_face_search":
|
|
780
|
+
result = await standalone.faceSearch(args.image_path);
|
|
781
|
+
break;
|
|
782
|
+
case "didit_age_estimation":
|
|
783
|
+
result = await standalone.ageEstimation(args.image_path);
|
|
784
|
+
break;
|
|
785
|
+
// Standalone: AML
|
|
786
|
+
case "didit_aml_screening":
|
|
787
|
+
result = await standalone.amlScreening(args);
|
|
788
|
+
break;
|
|
789
|
+
// Standalone: Email & Phone
|
|
790
|
+
case "didit_email_send":
|
|
791
|
+
result = await standalone.emailSend(args);
|
|
792
|
+
break;
|
|
793
|
+
case "didit_email_check":
|
|
794
|
+
result = await standalone.emailCheck(args);
|
|
795
|
+
break;
|
|
796
|
+
case "didit_phone_send":
|
|
797
|
+
result = await standalone.phoneSend(args);
|
|
798
|
+
break;
|
|
799
|
+
case "didit_phone_check":
|
|
800
|
+
result = await standalone.phoneCheck(args);
|
|
801
|
+
break;
|
|
802
|
+
default:
|
|
803
|
+
return { content: [{ type: "text", text: `Unknown tool: ${name}` }], isError: true };
|
|
804
|
+
}
|
|
805
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
806
|
+
}
|
|
807
|
+
catch (error) {
|
|
808
|
+
const message = error?.message || String(error);
|
|
809
|
+
return { content: [{ type: "text", text: `Error: ${message}` }], isError: true };
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
async function main() {
|
|
813
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
814
|
+
await server.connect(transport);
|
|
815
|
+
console.error("Didit MCP Server v3.0.0 running on stdio");
|
|
816
|
+
}
|
|
817
|
+
main().catch(console.error);
|
|
818
|
+
//# sourceMappingURL=index.js.map
|