@safekeylab/mcp-pii 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.
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * SafeKeyLab PII Detection MCP Server
4
+ *
5
+ * Provides tools for detecting and redacting PII in text, images, and documents.
6
+ *
7
+ * Tools:
8
+ * - detect_pii: Detect PII entities in text
9
+ * - detect_pii_batch: Batch PII detection
10
+ * - detect_pii_in_file: Detect PII in files
11
+ * - redact_text: Redact PII from text
12
+ * - anonymize_text: Replace PII with synthetic data
13
+ * - scan_image: Extract and detect PII in images
14
+ * - scan_document: Deep document analysis
15
+ * - get_pii_summary: Summary of PII in content
16
+ *
17
+ * Resources:
18
+ * - safekeylab://pii/entity-types: Supported PII types
19
+ * - safekeylab://pii/detection-stats: Detection statistics
20
+ */
21
+ export {};
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;GAkBG"}
package/dist/index.js ADDED
@@ -0,0 +1,547 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * SafeKeyLab PII Detection MCP Server
4
+ *
5
+ * Provides tools for detecting and redacting PII in text, images, and documents.
6
+ *
7
+ * Tools:
8
+ * - detect_pii: Detect PII entities in text
9
+ * - detect_pii_batch: Batch PII detection
10
+ * - detect_pii_in_file: Detect PII in files
11
+ * - redact_text: Redact PII from text
12
+ * - anonymize_text: Replace PII with synthetic data
13
+ * - scan_image: Extract and detect PII in images
14
+ * - scan_document: Deep document analysis
15
+ * - get_pii_summary: Summary of PII in content
16
+ *
17
+ * Resources:
18
+ * - safekeylab://pii/entity-types: Supported PII types
19
+ * - safekeylab://pii/detection-stats: Detection statistics
20
+ */
21
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
22
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
23
+ import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ErrorCode, McpError, } from '@modelcontextprotocol/sdk/types.js';
24
+ import { z } from 'zod';
25
+ import { getClient, SafeKeyLabError } from '@safekeylab/mcp-core';
26
+ // =============================================================================
27
+ // Tool Schemas
28
+ // =============================================================================
29
+ const DetectPIISchema = z.object({
30
+ text: z.string().describe('Text to analyze for PII'),
31
+ entity_types: z.array(z.string()).optional()
32
+ .describe('Specific entity types to detect (e.g., "ssn", "email", "credit_card")'),
33
+ confidence_threshold: z.number().min(0).max(1).default(0.8)
34
+ .describe('Minimum confidence score (0-1) for detection'),
35
+ });
36
+ const DetectPIIBatchSchema = z.object({
37
+ texts: z.array(z.string()).describe('Array of texts to analyze'),
38
+ entity_types: z.array(z.string()).optional()
39
+ .describe('Specific entity types to detect'),
40
+ confidence_threshold: z.number().min(0).max(1).default(0.8)
41
+ .describe('Minimum confidence score'),
42
+ });
43
+ const DetectPIIInFileSchema = z.object({
44
+ content: z.string().describe('Base64-encoded file content or file path'),
45
+ file_type: z.string().describe('File type: pdf, docx, xlsx, png, jpg, etc.'),
46
+ entity_types: z.array(z.string()).optional()
47
+ .describe('Specific entity types to detect'),
48
+ });
49
+ const RedactTextSchema = z.object({
50
+ text: z.string().describe('Text to redact'),
51
+ redaction_method: z.enum(['mask', 'hash', 'replace', 'remove', 'tokenize']).default('mask')
52
+ .describe('How to redact: mask ([REDACTED]), hash (SHA256), replace (synthetic), remove, tokenize'),
53
+ entity_types: z.array(z.string()).optional()
54
+ .describe('Specific entity types to redact (default: all)'),
55
+ });
56
+ const AnonymizeTextSchema = z.object({
57
+ text: z.string().describe('Text to anonymize'),
58
+ preserve_format: z.boolean().default(true)
59
+ .describe('Preserve format of replaced values (e.g., phone number format)'),
60
+ });
61
+ const ScanImageSchema = z.object({
62
+ content: z.string().describe('Base64-encoded image content'),
63
+ image_type: z.enum(['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp']).default('png')
64
+ .describe('Image format'),
65
+ });
66
+ const ScanDocumentSchema = z.object({
67
+ content: z.string().describe('Base64-encoded document content'),
68
+ document_type: z.enum(['pdf', 'docx', 'xlsx', 'pptx', 'txt', 'csv']).describe('Document type'),
69
+ include_metadata: z.boolean().default(false)
70
+ .describe('Include document metadata in analysis'),
71
+ });
72
+ const GetPIISummarySchema = z.object({
73
+ text: z.string().describe('Text to summarize'),
74
+ format: z.enum(['brief', 'detailed', 'json']).default('brief')
75
+ .describe('Output format'),
76
+ });
77
+ // =============================================================================
78
+ // Tool Definitions
79
+ // =============================================================================
80
+ const TOOLS = [
81
+ {
82
+ name: 'detect_pii',
83
+ description: 'Detect PII (Personally Identifiable Information) entities in text. Returns detected entities with types, values, confidence scores, and positions.',
84
+ inputSchema: {
85
+ type: 'object',
86
+ properties: {
87
+ text: { type: 'string', description: 'Text to analyze for PII' },
88
+ entity_types: {
89
+ type: 'array',
90
+ items: { type: 'string' },
91
+ description: 'Specific entity types to detect (e.g., "ssn", "email", "credit_card")',
92
+ },
93
+ confidence_threshold: {
94
+ type: 'number',
95
+ minimum: 0,
96
+ maximum: 1,
97
+ default: 0.8,
98
+ description: 'Minimum confidence score (0-1) for detection',
99
+ },
100
+ },
101
+ required: ['text'],
102
+ },
103
+ },
104
+ {
105
+ name: 'detect_pii_batch',
106
+ description: 'Detect PII in multiple texts at once. More efficient than calling detect_pii multiple times.',
107
+ inputSchema: {
108
+ type: 'object',
109
+ properties: {
110
+ texts: {
111
+ type: 'array',
112
+ items: { type: 'string' },
113
+ description: 'Array of texts to analyze',
114
+ },
115
+ entity_types: {
116
+ type: 'array',
117
+ items: { type: 'string' },
118
+ description: 'Specific entity types to detect',
119
+ },
120
+ confidence_threshold: {
121
+ type: 'number',
122
+ minimum: 0,
123
+ maximum: 1,
124
+ default: 0.8,
125
+ description: 'Minimum confidence score',
126
+ },
127
+ },
128
+ required: ['texts'],
129
+ },
130
+ },
131
+ {
132
+ name: 'detect_pii_in_file',
133
+ description: 'Detect PII in files including PDFs, Word documents, Excel spreadsheets, and images.',
134
+ inputSchema: {
135
+ type: 'object',
136
+ properties: {
137
+ content: {
138
+ type: 'string',
139
+ description: 'Base64-encoded file content',
140
+ },
141
+ file_type: {
142
+ type: 'string',
143
+ description: 'File type: pdf, docx, xlsx, png, jpg, etc.',
144
+ },
145
+ entity_types: {
146
+ type: 'array',
147
+ items: { type: 'string' },
148
+ description: 'Specific entity types to detect',
149
+ },
150
+ },
151
+ required: ['content', 'file_type'],
152
+ },
153
+ },
154
+ {
155
+ name: 'redact_text',
156
+ description: 'Redact PII from text using various methods: mask ([REDACTED]), hash (SHA256), replace (synthetic data), remove, or tokenize.',
157
+ inputSchema: {
158
+ type: 'object',
159
+ properties: {
160
+ text: { type: 'string', description: 'Text to redact' },
161
+ redaction_method: {
162
+ type: 'string',
163
+ enum: ['mask', 'hash', 'replace', 'remove', 'tokenize'],
164
+ default: 'mask',
165
+ description: 'How to redact PII',
166
+ },
167
+ entity_types: {
168
+ type: 'array',
169
+ items: { type: 'string' },
170
+ description: 'Specific entity types to redact (default: all)',
171
+ },
172
+ },
173
+ required: ['text'],
174
+ },
175
+ },
176
+ {
177
+ name: 'anonymize_text',
178
+ description: 'Replace PII with realistic synthetic data while preserving text format and readability.',
179
+ inputSchema: {
180
+ type: 'object',
181
+ properties: {
182
+ text: { type: 'string', description: 'Text to anonymize' },
183
+ preserve_format: {
184
+ type: 'boolean',
185
+ default: true,
186
+ description: 'Preserve format of replaced values',
187
+ },
188
+ },
189
+ required: ['text'],
190
+ },
191
+ },
192
+ {
193
+ name: 'scan_image',
194
+ description: 'Extract text from images using OCR and detect PII. Supports ID documents, screenshots, and photos.',
195
+ inputSchema: {
196
+ type: 'object',
197
+ properties: {
198
+ content: {
199
+ type: 'string',
200
+ description: 'Base64-encoded image content',
201
+ },
202
+ image_type: {
203
+ type: 'string',
204
+ enum: ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp'],
205
+ default: 'png',
206
+ description: 'Image format',
207
+ },
208
+ },
209
+ required: ['content'],
210
+ },
211
+ },
212
+ {
213
+ name: 'scan_document',
214
+ description: 'Deep analysis of documents for PII. Parses structure, extracts text from all pages/sheets, and identifies PII with location context.',
215
+ inputSchema: {
216
+ type: 'object',
217
+ properties: {
218
+ content: {
219
+ type: 'string',
220
+ description: 'Base64-encoded document content',
221
+ },
222
+ document_type: {
223
+ type: 'string',
224
+ enum: ['pdf', 'docx', 'xlsx', 'pptx', 'txt', 'csv'],
225
+ description: 'Document type',
226
+ },
227
+ include_metadata: {
228
+ type: 'boolean',
229
+ default: false,
230
+ description: 'Include document metadata in analysis',
231
+ },
232
+ },
233
+ required: ['content', 'document_type'],
234
+ },
235
+ },
236
+ {
237
+ name: 'get_pii_summary',
238
+ description: 'Get a human-readable summary of PII found in text, including counts by type and risk assessment.',
239
+ inputSchema: {
240
+ type: 'object',
241
+ properties: {
242
+ text: { type: 'string', description: 'Text to summarize' },
243
+ format: {
244
+ type: 'string',
245
+ enum: ['brief', 'detailed', 'json'],
246
+ default: 'brief',
247
+ description: 'Output format',
248
+ },
249
+ },
250
+ required: ['text'],
251
+ },
252
+ },
253
+ ];
254
+ // =============================================================================
255
+ // Resource Definitions
256
+ // =============================================================================
257
+ const RESOURCES = [
258
+ {
259
+ uri: 'safekeylab://pii/entity-types',
260
+ name: 'PII Entity Types',
261
+ description: 'List of all supported PII entity types with descriptions and patterns',
262
+ mimeType: 'application/json',
263
+ },
264
+ {
265
+ uri: 'safekeylab://pii/detection-stats',
266
+ name: 'Detection Statistics',
267
+ description: 'Your PII detection usage statistics for the past 7 days',
268
+ mimeType: 'application/json',
269
+ },
270
+ ];
271
+ const ENTITY_TYPES_DATA = {
272
+ entity_types: [
273
+ { type: 'ssn', name: 'Social Security Number', description: 'US Social Security Numbers (XXX-XX-XXXX)', example: '123-45-6789' },
274
+ { type: 'credit_card', name: 'Credit Card Number', description: 'Credit/debit card numbers (Visa, MC, Amex, etc.)', example: '4111-1111-1111-1111' },
275
+ { type: 'email', name: 'Email Address', description: 'Email addresses', example: 'john.doe@example.com' },
276
+ { type: 'phone', name: 'Phone Number', description: 'Phone numbers (US and international)', example: '+1 (555) 123-4567' },
277
+ { type: 'address', name: 'Physical Address', description: 'Street addresses, PO boxes', example: '123 Main St, City, ST 12345' },
278
+ { type: 'name', name: 'Person Name', description: 'Full names, first/last names', example: 'John Doe' },
279
+ { type: 'date_of_birth', name: 'Date of Birth', description: 'Birth dates', example: '01/15/1990' },
280
+ { type: 'passport', name: 'Passport Number', description: 'Passport numbers (various countries)', example: '123456789' },
281
+ { type: 'driver_license', name: 'Driver License', description: 'Driver license numbers', example: 'D1234567' },
282
+ { type: 'bank_account', name: 'Bank Account', description: 'Bank account numbers', example: '1234567890' },
283
+ { type: 'iban', name: 'IBAN', description: 'International Bank Account Numbers', example: 'DE89370400440532013000' },
284
+ { type: 'ip_address', name: 'IP Address', description: 'IPv4 and IPv6 addresses', example: '192.168.1.1' },
285
+ { type: 'url', name: 'URL', description: 'Web URLs that may contain PII', example: 'https://example.com/user/12345' },
286
+ { type: 'bitcoin_address', name: 'Bitcoin Address', description: 'Bitcoin wallet addresses', example: '1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2' },
287
+ { type: 'ethereum_address', name: 'Ethereum Address', description: 'Ethereum wallet addresses', example: '0x742d35Cc6634C0532925a3b844Bc9e7595f...' },
288
+ { type: 'medical_record', name: 'Medical Record Number', description: 'Medical/health record IDs', example: 'MRN-123456' },
289
+ { type: 'health_insurance', name: 'Health Insurance ID', description: 'Health insurance policy numbers', example: 'XYZ123456789' },
290
+ { type: 'api_key', name: 'API Key', description: 'API keys and tokens', example: 'sk-xxx...xxx' },
291
+ { type: 'aws_key', name: 'AWS Access Key', description: 'AWS access key IDs', example: 'AKIA...' },
292
+ { type: 'password', name: 'Password', description: 'Passwords and secrets in text', example: 'password: xxx' },
293
+ { type: 'national_id', name: 'National ID', description: 'National identification numbers', example: 'Various formats' },
294
+ { type: 'tax_id', name: 'Tax ID', description: 'Tax identification numbers (EIN, ITIN, etc.)', example: '12-3456789' },
295
+ { type: 'vin', name: 'Vehicle VIN', description: 'Vehicle Identification Numbers', example: '1HGCM82633A004352' },
296
+ { type: 'mac_address', name: 'MAC Address', description: 'Network MAC addresses', example: '00:1A:2B:3C:4D:5E' },
297
+ { type: 'imei', name: 'IMEI', description: 'Mobile device IMEI numbers', example: '351234567890123' },
298
+ ],
299
+ total_types: 25,
300
+ categories: {
301
+ identity: ['ssn', 'passport', 'driver_license', 'national_id', 'name', 'date_of_birth'],
302
+ financial: ['credit_card', 'bank_account', 'iban', 'bitcoin_address', 'ethereum_address', 'tax_id'],
303
+ contact: ['email', 'phone', 'address'],
304
+ health: ['medical_record', 'health_insurance'],
305
+ technical: ['ip_address', 'url', 'api_key', 'aws_key', 'password', 'mac_address', 'imei', 'vin'],
306
+ },
307
+ };
308
+ // =============================================================================
309
+ // Server Implementation
310
+ // =============================================================================
311
+ class SafeKeyLabPIIServer {
312
+ server;
313
+ constructor() {
314
+ this.server = new Server({
315
+ name: 'safekeylab-pii',
316
+ version: '1.0.0',
317
+ }, {
318
+ capabilities: {
319
+ tools: {},
320
+ resources: {},
321
+ },
322
+ });
323
+ this.setupHandlers();
324
+ }
325
+ setupHandlers() {
326
+ // List available tools
327
+ this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
328
+ tools: TOOLS,
329
+ }));
330
+ // List available resources
331
+ this.server.setRequestHandler(ListResourcesRequestSchema, async () => ({
332
+ resources: RESOURCES,
333
+ }));
334
+ // Handle resource reads
335
+ this.server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
336
+ const { uri } = request.params;
337
+ switch (uri) {
338
+ case 'safekeylab://pii/entity-types':
339
+ return {
340
+ contents: [
341
+ {
342
+ uri,
343
+ mimeType: 'application/json',
344
+ text: JSON.stringify(ENTITY_TYPES_DATA, null, 2),
345
+ },
346
+ ],
347
+ };
348
+ case 'safekeylab://pii/detection-stats':
349
+ try {
350
+ const client = getClient();
351
+ const stats = await client.getUsageMetrics();
352
+ return {
353
+ contents: [
354
+ {
355
+ uri,
356
+ mimeType: 'application/json',
357
+ text: JSON.stringify(stats, null, 2),
358
+ },
359
+ ],
360
+ };
361
+ }
362
+ catch (error) {
363
+ throw new McpError(ErrorCode.InternalError, `Failed to fetch stats: ${error instanceof Error ? error.message : 'Unknown error'}`);
364
+ }
365
+ default:
366
+ throw new McpError(ErrorCode.InvalidRequest, `Unknown resource: ${uri}`);
367
+ }
368
+ });
369
+ // Handle tool calls
370
+ this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
371
+ const { name, arguments: args } = request.params;
372
+ try {
373
+ const client = getClient();
374
+ switch (name) {
375
+ case 'detect_pii': {
376
+ const parsed = DetectPIISchema.parse(args);
377
+ const result = await client.detectPII(parsed.text, {
378
+ entityTypes: parsed.entity_types,
379
+ confidenceThreshold: parsed.confidence_threshold,
380
+ });
381
+ return {
382
+ content: [
383
+ {
384
+ type: 'text',
385
+ text: JSON.stringify(result, null, 2),
386
+ },
387
+ ],
388
+ };
389
+ }
390
+ case 'detect_pii_batch': {
391
+ const parsed = DetectPIIBatchSchema.parse(args);
392
+ const results = await client.detectPIIBatch(parsed.texts, {
393
+ entityTypes: parsed.entity_types,
394
+ confidenceThreshold: parsed.confidence_threshold,
395
+ });
396
+ return {
397
+ content: [
398
+ {
399
+ type: 'text',
400
+ text: JSON.stringify({ results, count: results.length }, null, 2),
401
+ },
402
+ ],
403
+ };
404
+ }
405
+ case 'detect_pii_in_file': {
406
+ const parsed = DetectPIIInFileSchema.parse(args);
407
+ const result = await client.detectPIIInFile(parsed.content, parsed.file_type, {
408
+ entityTypes: parsed.entity_types,
409
+ });
410
+ return {
411
+ content: [
412
+ {
413
+ type: 'text',
414
+ text: JSON.stringify(result, null, 2),
415
+ },
416
+ ],
417
+ };
418
+ }
419
+ case 'redact_text': {
420
+ const parsed = RedactTextSchema.parse(args);
421
+ const result = await client.redactText(parsed.text, {
422
+ redactionMethod: parsed.redaction_method,
423
+ entityTypes: parsed.entity_types,
424
+ });
425
+ return {
426
+ content: [
427
+ {
428
+ type: 'text',
429
+ text: JSON.stringify(result, null, 2),
430
+ },
431
+ ],
432
+ };
433
+ }
434
+ case 'anonymize_text': {
435
+ const parsed = AnonymizeTextSchema.parse(args);
436
+ const result = await client.anonymizeText(parsed.text, {
437
+ preserveFormat: parsed.preserve_format,
438
+ });
439
+ return {
440
+ content: [
441
+ {
442
+ type: 'text',
443
+ text: JSON.stringify(result, null, 2),
444
+ },
445
+ ],
446
+ };
447
+ }
448
+ case 'scan_image': {
449
+ const parsed = ScanImageSchema.parse(args);
450
+ const result = await client.detectPIIInFile(parsed.content, parsed.image_type);
451
+ return {
452
+ content: [
453
+ {
454
+ type: 'text',
455
+ text: JSON.stringify(result, null, 2),
456
+ },
457
+ ],
458
+ };
459
+ }
460
+ case 'scan_document': {
461
+ const parsed = ScanDocumentSchema.parse(args);
462
+ const result = await client.detectPIIInFile(parsed.content, parsed.document_type);
463
+ return {
464
+ content: [
465
+ {
466
+ type: 'text',
467
+ text: JSON.stringify({
468
+ ...result,
469
+ include_metadata: parsed.include_metadata,
470
+ }, null, 2),
471
+ },
472
+ ],
473
+ };
474
+ }
475
+ case 'get_pii_summary': {
476
+ const parsed = GetPIISummarySchema.parse(args);
477
+ const result = await client.detectPII(parsed.text);
478
+ // Generate summary based on format
479
+ let summary;
480
+ if (parsed.format === 'json') {
481
+ summary = JSON.stringify(result, null, 2);
482
+ }
483
+ else if (parsed.format === 'detailed') {
484
+ const entityCounts = {};
485
+ for (const entity of result.entities) {
486
+ entityCounts[entity.type] = (entityCounts[entity.type] || 0) + 1;
487
+ }
488
+ summary = `PII Detection Summary\n${'='.repeat(40)}\n\n`;
489
+ summary += `Total PII Entities Found: ${result.entity_count}\n`;
490
+ summary += `Processing Time: ${result.processing_time_ms}ms\n\n`;
491
+ summary += `Entities by Type:\n`;
492
+ for (const [type, count] of Object.entries(entityCounts)) {
493
+ summary += ` - ${type}: ${count}\n`;
494
+ }
495
+ summary += `\nDetailed Findings:\n`;
496
+ for (const entity of result.entities) {
497
+ summary += ` [${entity.type}] "${entity.value}" (confidence: ${(entity.confidence * 100).toFixed(1)}%)\n`;
498
+ }
499
+ }
500
+ else {
501
+ // Brief format
502
+ if (!result.pii_found) {
503
+ summary = 'No PII detected in the provided text.';
504
+ }
505
+ else {
506
+ const types = [...new Set(result.entities.map(e => e.type))];
507
+ summary = `Found ${result.entity_count} PII ${result.entity_count === 1 ? 'entity' : 'entities'} of ${types.length} ${types.length === 1 ? 'type' : 'types'}: ${types.join(', ')}`;
508
+ }
509
+ }
510
+ return {
511
+ content: [
512
+ {
513
+ type: 'text',
514
+ text: summary,
515
+ },
516
+ ],
517
+ };
518
+ }
519
+ default:
520
+ throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
521
+ }
522
+ }
523
+ catch (error) {
524
+ if (error instanceof z.ZodError) {
525
+ throw new McpError(ErrorCode.InvalidParams, `Invalid parameters: ${error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ')}`);
526
+ }
527
+ if (error instanceof SafeKeyLabError) {
528
+ throw new McpError(ErrorCode.InternalError, `API error: ${error.message}`);
529
+ }
530
+ if (error instanceof McpError)
531
+ throw error;
532
+ throw new McpError(ErrorCode.InternalError, `Unexpected error: ${error instanceof Error ? error.message : 'Unknown'}`);
533
+ }
534
+ });
535
+ }
536
+ async run() {
537
+ const transport = new StdioServerTransport();
538
+ await this.server.connect(transport);
539
+ console.error('SafeKeyLab PII MCP Server running on stdio');
540
+ }
541
+ }
542
+ // =============================================================================
543
+ // Main Entry Point
544
+ // =============================================================================
545
+ const server = new SafeKeyLabPIIServer();
546
+ server.run().catch(console.error);
547
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,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images, and documents",
5
+ "type": "module",
6
+ "bin": {
7
+ "safekeylab-mcp-pii": "./dist/index.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "files": ["dist"],
12
+ "scripts": {
13
+ "build": "tsc",
14
+ "clean": "rm -rf dist",
15
+ "start": "node dist/index.js",
16
+ "prepublishOnly": "npm run build"
17
+ },
18
+ "dependencies": {
19
+ "@modelcontextprotocol/sdk": "^1.0.0",
20
+ "@safekeylab/mcp-core": "^1.0.0",
21
+ "zod": "^3.22.0"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "^20.10.0",
25
+ "typescript": "^5.3.0"
26
+ },
27
+ "author": "SafeKey Lab Inc.",
28
+ "license": "MIT",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/SafeKeylab/safekeylab-mcp.git",
32
+ "directory": "packages/mcp-pii"
33
+ },
34
+ "keywords": [
35
+ "safekeylab",
36
+ "mcp",
37
+ "model-context-protocol",
38
+ "pii-detection",
39
+ "data-privacy",
40
+ "gdpr",
41
+ "hipaa",
42
+ "ai-security"
43
+ ]
44
+ }