@streamblur/mcp 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.js +257 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/patterns.js +24 -4
- package/dist/src/patterns.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +256 -2
- package/src/patterns.ts +27 -4
package/dist/src/index.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const node_fs_1 = require("node:fs");
|
|
5
5
|
const node_path_1 = require("node:path");
|
|
6
|
+
const node_child_process_1 = require("node:child_process");
|
|
7
|
+
const node_os_1 = require("node:os");
|
|
6
8
|
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
7
9
|
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
8
10
|
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
@@ -142,7 +144,7 @@ function scanDirectory(dirPath, maxFiles = 500) {
|
|
|
142
144
|
return results;
|
|
143
145
|
}
|
|
144
146
|
// ─── Server Setup ──────────────────────────────────────────────────────────
|
|
145
|
-
const server = new index_js_1.Server({ name: "streamblur-mcp", version: "1.
|
|
147
|
+
const server = new index_js_1.Server({ name: "streamblur-mcp", version: "1.1.0" }, { capabilities: { tools: {} } });
|
|
146
148
|
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
|
147
149
|
const proActive = await isPro();
|
|
148
150
|
const tools = [
|
|
@@ -198,6 +200,70 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
|
|
198
200
|
required: ["path"],
|
|
199
201
|
additionalProperties: false
|
|
200
202
|
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "scan_repo",
|
|
206
|
+
description: proActive
|
|
207
|
+
? "Clones a GitHub repository to a temp directory, scans all source files for exposed secrets, returns findings with file paths and line numbers, then deletes the temp clone. Pro feature."
|
|
208
|
+
: "Clones a GitHub repo and scans all files for leaked secrets. Pro feature - set STREAMBLUR_LICENSE_KEY to unlock.",
|
|
209
|
+
inputSchema: {
|
|
210
|
+
type: "object",
|
|
211
|
+
properties: {
|
|
212
|
+
repo_url: { type: "string", description: "GitHub repo URL (e.g. https://github.com/owner/repo)" },
|
|
213
|
+
max_files: { type: "number", description: "Max files to scan (default 300)" }
|
|
214
|
+
},
|
|
215
|
+
required: ["repo_url"],
|
|
216
|
+
additionalProperties: false
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: "audit_env_file",
|
|
221
|
+
description: "Reads a .env file and returns a full security report: detected secrets, formatting issues, placeholder values, and rotation recommendations. File is not modified.",
|
|
222
|
+
inputSchema: {
|
|
223
|
+
type: "object",
|
|
224
|
+
properties: {
|
|
225
|
+
path: { type: "string", description: "Path to .env file" }
|
|
226
|
+
},
|
|
227
|
+
required: ["path"],
|
|
228
|
+
additionalProperties: false
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: "check_gitignore",
|
|
233
|
+
description: "Checks a project directory .gitignore to verify that .env files, key files, and secret directories are properly excluded. Returns a security gap report.",
|
|
234
|
+
inputSchema: {
|
|
235
|
+
type: "object",
|
|
236
|
+
properties: {
|
|
237
|
+
path: { type: "string", description: "Project root directory path" }
|
|
238
|
+
},
|
|
239
|
+
required: ["path"],
|
|
240
|
+
additionalProperties: false
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "explain_detection",
|
|
245
|
+
description: "Given a detected secret type (e.g. stripe_secret_live, aws_access_key), explains what it is, the blast radius if leaked, and exactly where to go to revoke and rotate it immediately.",
|
|
246
|
+
inputSchema: {
|
|
247
|
+
type: "object",
|
|
248
|
+
properties: {
|
|
249
|
+
type: { type: "string", description: "Secret type string from a scan result (e.g. openai_api_key)" }
|
|
250
|
+
},
|
|
251
|
+
required: ["type"],
|
|
252
|
+
additionalProperties: false
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
name: "generate_env_template",
|
|
257
|
+
description: "Generates a safe .env.example template with placeholder values and security comments for common project types.",
|
|
258
|
+
inputSchema: {
|
|
259
|
+
type: "object",
|
|
260
|
+
properties: {
|
|
261
|
+
project_type: { type: "string", description: "Project type: nextjs, rails, django, express, nuxt, sveltekit" },
|
|
262
|
+
services: { type: "array", items: { type: "string" }, description: "Additional services: stripe, openai, anthropic, supabase, firebase, aws, sendgrid, twilio" }
|
|
263
|
+
},
|
|
264
|
+
required: ["project_type"],
|
|
265
|
+
additionalProperties: false
|
|
266
|
+
}
|
|
201
267
|
}
|
|
202
268
|
];
|
|
203
269
|
return { tools };
|
|
@@ -280,6 +346,196 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
|
280
346
|
throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Could not scan directory: ${msg}`);
|
|
281
347
|
}
|
|
282
348
|
}
|
|
349
|
+
case "scan_repo": {
|
|
350
|
+
const proActive = await isPro();
|
|
351
|
+
if (!proActive) {
|
|
352
|
+
return {
|
|
353
|
+
content: [{
|
|
354
|
+
type: "text",
|
|
355
|
+
text: "scan_repo is a StreamBlur Pro feature.\n\nSet STREAMBLUR_LICENSE_KEY to your Pro email or license key.\nGet Pro at https://streamblur.com/pricing - $2.99 one-time."
|
|
356
|
+
}]
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
const repoUrl = args.repo_url;
|
|
360
|
+
if (typeof repoUrl !== "string" || !repoUrl.startsWith("http")) {
|
|
361
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, "'repo_url' must be a valid GitHub URL");
|
|
362
|
+
}
|
|
363
|
+
const maxFiles = typeof args.max_files === "number" ? args.max_files : 300;
|
|
364
|
+
const tmpDir = (0, node_path_1.join)((0, node_os_1.tmpdir)(), "streamblur-scan-" + Date.now());
|
|
365
|
+
try {
|
|
366
|
+
(0, node_fs_1.mkdirSync)(tmpDir, { recursive: true });
|
|
367
|
+
(0, node_child_process_1.execSync)(`git clone --depth 1 "${repoUrl}" "${tmpDir}"`, { timeout: 60000, stdio: "pipe" });
|
|
368
|
+
const results = scanDirectory(tmpDir, maxFiles);
|
|
369
|
+
if (results.length === 0) {
|
|
370
|
+
return { content: [{ type: "text", text: `No secrets detected in ${repoUrl}` }] };
|
|
371
|
+
}
|
|
372
|
+
const summary = results.map(r => `${r.file.replace(tmpDir + "/", "")}\n${r.detections.map((d) => ` Line ${d.line}:${d.column} - ${d.type}`).join("\n")}`).join("\n\n");
|
|
373
|
+
return {
|
|
374
|
+
content: [{
|
|
375
|
+
type: "text",
|
|
376
|
+
text: `Found secrets in ${results.length} file(s) in ${repoUrl}:\n\n${summary}`
|
|
377
|
+
}]
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
catch (err) {
|
|
381
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
382
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Repo scan failed: ${msg}`);
|
|
383
|
+
}
|
|
384
|
+
finally {
|
|
385
|
+
try {
|
|
386
|
+
(0, node_fs_1.rmSync)(tmpDir, { recursive: true, force: true });
|
|
387
|
+
}
|
|
388
|
+
catch { /* cleanup */ }
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
case "audit_env_file": {
|
|
392
|
+
const filePath = args.path;
|
|
393
|
+
if (typeof filePath !== "string") {
|
|
394
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, "'path' must be a string");
|
|
395
|
+
}
|
|
396
|
+
try {
|
|
397
|
+
const content = (0, node_fs_1.readFileSync)(filePath, "utf8");
|
|
398
|
+
const lines = content.split("\n");
|
|
399
|
+
const issues = [];
|
|
400
|
+
const secrets = [];
|
|
401
|
+
const placeholders = [];
|
|
402
|
+
for (let i = 0; i < lines.length; i++) {
|
|
403
|
+
const line = lines[i].trim();
|
|
404
|
+
if (!line || line.startsWith("#"))
|
|
405
|
+
continue;
|
|
406
|
+
const eqIdx = line.indexOf("=");
|
|
407
|
+
if (eqIdx === -1) {
|
|
408
|
+
issues.push(`Line ${i + 1}: Missing = sign: ${line}`);
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
const key = line.slice(0, eqIdx).trim();
|
|
412
|
+
const val = line.slice(eqIdx + 1).trim();
|
|
413
|
+
if (/\s/.test(key))
|
|
414
|
+
issues.push(`Line ${i + 1}: Key has spaces: ${key}`);
|
|
415
|
+
if (val === "" || val === '""' || val === "''")
|
|
416
|
+
issues.push(`Line ${i + 1}: Empty value for ${key}`);
|
|
417
|
+
if (/^(your[_-]|xxx|placeholder|changeme|todo|replace|insert|example)/i.test(val.replace(/['"]/g, ""))) {
|
|
418
|
+
placeholders.push(`Line ${i + 1}: ${key} has placeholder value`);
|
|
419
|
+
}
|
|
420
|
+
const detected = (0, redact_1.scanText)(line);
|
|
421
|
+
if (detected.length > 0) {
|
|
422
|
+
secrets.push(`Line ${i + 1}: ${key} - detected as ${detected.map((d) => d.type).join(", ")}`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
let report = `Env File Audit: ${filePath}\n${"=".repeat(40)}\n`;
|
|
426
|
+
report += `Lines: ${lines.length} | Variables: ${lines.filter(l => l.includes("=") && !l.startsWith("#")).length}\n\n`;
|
|
427
|
+
if (secrets.length > 0)
|
|
428
|
+
report += `SECRETS DETECTED (${secrets.length}):\n${secrets.join("\n")}\n\n`;
|
|
429
|
+
if (issues.length > 0)
|
|
430
|
+
report += `FORMAT ISSUES (${issues.length}):\n${issues.join("\n")}\n\n`;
|
|
431
|
+
if (placeholders.length > 0)
|
|
432
|
+
report += `PLACEHOLDERS (${placeholders.length}):\n${placeholders.join("\n")}\n\n`;
|
|
433
|
+
if (secrets.length === 0 && issues.length === 0)
|
|
434
|
+
report += `No issues found. File looks clean.\n`;
|
|
435
|
+
report += `\nReminder: ensure this file is in .gitignore and never committed to version control.`;
|
|
436
|
+
return { content: [{ type: "text", text: report }] };
|
|
437
|
+
}
|
|
438
|
+
catch (err) {
|
|
439
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
440
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Could not read file: ${msg}`);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
case "check_gitignore": {
|
|
444
|
+
const dirPath = args.path;
|
|
445
|
+
if (typeof dirPath !== "string") {
|
|
446
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, "'path' must be a string");
|
|
447
|
+
}
|
|
448
|
+
const gitignorePath = (0, node_path_1.join)(dirPath, ".gitignore");
|
|
449
|
+
const mustIgnore = [".env", ".env.local", ".env.production", ".env.*.local", "*.pem", "*.key", ".secret"];
|
|
450
|
+
const shouldIgnore = [".env.development", ".env.staging", "secrets/", "credentials/"];
|
|
451
|
+
try {
|
|
452
|
+
if (!(0, node_fs_1.existsSync)(gitignorePath)) {
|
|
453
|
+
return {
|
|
454
|
+
content: [{
|
|
455
|
+
type: "text",
|
|
456
|
+
text: `No .gitignore found in ${dirPath}.\n\nCRITICAL: Create a .gitignore immediately and add:\n${mustIgnore.join("\n")}`
|
|
457
|
+
}]
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
const content = (0, node_fs_1.readFileSync)(gitignorePath, "utf8");
|
|
461
|
+
const missing = mustIgnore.filter(p => !content.includes(p));
|
|
462
|
+
const suggested = shouldIgnore.filter(p => !content.includes(p));
|
|
463
|
+
let report = `.gitignore Audit: ${gitignorePath}\n${"=".repeat(40)}\n`;
|
|
464
|
+
if (missing.length === 0) {
|
|
465
|
+
report += `All critical patterns are covered.\n`;
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
report += `CRITICAL - Missing patterns (add these NOW):\n${missing.map(p => ` ${p}`).join("\n")}\n\n`;
|
|
469
|
+
}
|
|
470
|
+
if (suggested.length > 0) {
|
|
471
|
+
report += `Recommended additions:\n${suggested.map(p => ` ${p}`).join("\n")}\n`;
|
|
472
|
+
}
|
|
473
|
+
return { content: [{ type: "text", text: report }] };
|
|
474
|
+
}
|
|
475
|
+
catch (err) {
|
|
476
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
477
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Could not check gitignore: ${msg}`);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
case "explain_detection": {
|
|
481
|
+
const detectionType = args.type;
|
|
482
|
+
if (typeof detectionType !== "string") {
|
|
483
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, "'type' must be a string");
|
|
484
|
+
}
|
|
485
|
+
const explanations = {
|
|
486
|
+
openai_api_key: { name: "OpenAI API Key", risk: "HIGH - Full API access. Attacker can run unlimited GPT-4 requests at your expense. Costs can hit thousands of dollars within hours.", action: "1. Go to platform.openai.com/api-keys\n2. Delete the exposed key immediately\n3. Create a new key\n4. Update all services using the old key", url: "https://platform.openai.com/api-keys" },
|
|
487
|
+
anthropic_api_key: { name: "Anthropic API Key", risk: "HIGH - Full Claude API access. Unauthorized usage billed to your account.", action: "1. Go to console.anthropic.com/settings/keys\n2. Delete the exposed key\n3. Generate a new key\n4. Update environment variables", url: "https://console.anthropic.com/settings/keys" },
|
|
488
|
+
stripe_secret_live: { name: "Stripe Live Secret Key", risk: "CRITICAL - Full access to your Stripe account. Attacker can create charges, issue refunds, access customer data, and drain your balance.", action: "1. Go to dashboard.stripe.com/apikeys\n2. Roll (rotate) the key immediately\n3. Update all integrations", url: "https://dashboard.stripe.com/apikeys" },
|
|
489
|
+
aws_access_key: { name: "AWS Access Key ID", risk: "CRITICAL - Combined with secret key, gives full AWS account access. Can spin up infrastructure, access S3 data, and incur massive costs.", action: "1. Go to AWS IAM console\n2. Deactivate the key immediately\n3. Create new credentials\n4. Check CloudTrail for unauthorized activity", url: "https://console.aws.amazon.com/iam/home#/security_credentials" },
|
|
490
|
+
github_pat: { name: "GitHub Personal Access Token", risk: "HIGH - Can access private repos, commit code, read secrets in Actions, and depending on scope, full org access.", action: "1. Go to github.com/settings/tokens\n2. Delete the exposed token immediately\n3. Audit recent activity on affected repos", url: "https://github.com/settings/tokens" },
|
|
491
|
+
discord_bot_token: { name: "Discord Bot Token", risk: "MEDIUM-HIGH - Full control of the bot. Can read all messages the bot has access to, send messages as the bot, manage channels.", action: "1. Go to discord.com/developers/applications\n2. Select your app > Bot > Reset Token\n3. Update your deployment with the new token", url: "https://discord.com/developers/applications" },
|
|
492
|
+
stripe_secret_test: { name: "Stripe Test Secret Key", risk: "LOW - Test mode only, no real money. Best practice to rotate anyway.", action: "1. Go to dashboard.stripe.com/apikeys\n2. Roll the test key", url: "https://dashboard.stripe.com/apikeys" },
|
|
493
|
+
google_api_key: { name: "Google API Key", risk: "MEDIUM-HIGH - Depending on enabled APIs, can incur costs or expose data.", action: "1. Go to console.cloud.google.com/apis/credentials\n2. Delete or restrict the key\n3. Create a new restricted key", url: "https://console.cloud.google.com/apis/credentials" },
|
|
494
|
+
huggingface_token: { name: "Hugging Face Token", risk: "MEDIUM - Access to models, datasets, and spaces under your account.", action: "1. Go to huggingface.co/settings/tokens\n2. Delete the exposed token\n3. Create a new one", url: "https://huggingface.co/settings/tokens" },
|
|
495
|
+
supabase_service_role_key: { name: "Supabase Service Role Key", risk: "CRITICAL - Bypasses Row Level Security entirely. Full read/write access to all database tables.", action: "1. Go to supabase.com/dashboard > Project Settings > API\n2. Rotate the service role key\n3. Update all server-side integrations", url: "https://supabase.com/dashboard" },
|
|
496
|
+
};
|
|
497
|
+
const info = explanations[detectionType];
|
|
498
|
+
if (!info) {
|
|
499
|
+
return {
|
|
500
|
+
content: [{
|
|
501
|
+
type: "text",
|
|
502
|
+
text: `Detection type: ${detectionType}\n\nNo specific guidance available for this type yet.\n\nGeneral advice:\n- Treat it as potentially sensitive\n- Search your provider dashboard for API keys or tokens section\n- Revoke/rotate the value immediately\n- Check logs for unauthorized usage\n- Update all services using the old value`
|
|
503
|
+
}]
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
return {
|
|
507
|
+
content: [{
|
|
508
|
+
type: "text",
|
|
509
|
+
text: `${info.name}\n${"=".repeat(info.name.length)}\n\nRisk: ${info.risk}\n\nImmediate action:\n${info.action}\n\nDashboard: ${info.url}`
|
|
510
|
+
}]
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
case "generate_env_template": {
|
|
514
|
+
const projectType = (args.project_type || "nextjs").toLowerCase();
|
|
515
|
+
const services = Array.isArray(args.services) ? args.services : [];
|
|
516
|
+
const templates = {
|
|
517
|
+
nextjs: `# Next.js Environment Variables\n# Copy to .env.local - NEVER commit .env.local to git\n\n# App\nNEXT_PUBLIC_APP_URL=http://localhost:3000\nNEXT_PUBLIC_APP_NAME=your-app-name\n\n# Database\nDATABASE_URL=postgresql://user:password@localhost:5432/dbname`,
|
|
518
|
+
express: `# Express Environment Variables\n# Copy to .env - NEVER commit .env to git\n\nNODE_ENV=development\nPORT=3000\n\n# Database\nDATABASE_URL=postgresql://user:password@localhost:5432/dbname\n\n# Session\nSESSION_SECRET=replace-with-random-32-char-string`,
|
|
519
|
+
django: `# Django Environment Variables\n# Copy to .env - NEVER commit .env to git\n\nDJANGO_SECRET_KEY=replace-with-50-char-random-string\nDEBUG=True\nALLOWED_HOSTS=localhost,127.0.0.1\n\n# Database\nDATABASE_URL=postgresql://user:password@localhost:5432/dbname`,
|
|
520
|
+
rails: `# Rails Environment Variables\n# Copy to .env - NEVER commit .env to git\n\nRAILS_ENV=development\nSECRET_KEY_BASE=replace-with-rails-credentials-output\n\n# Database\nDATABASE_URL=postgresql://user:password@localhost:5432/dbname`,
|
|
521
|
+
nuxt: `# Nuxt Environment Variables\n# Copy to .env - NEVER commit .env to git\n\nNUXT_PUBLIC_SITE_URL=http://localhost:3000\nNUXT_SECRET_KEY=replace-with-random-32-char-string`,
|
|
522
|
+
sveltekit: `# SvelteKit Environment Variables\n# Copy to .env - NEVER commit .env to git\n\nPUBLIC_APP_URL=http://localhost:5173\nPRIVATE_SECRET_KEY=replace-with-random-32-char-string`,
|
|
523
|
+
};
|
|
524
|
+
const serviceAdditions = {
|
|
525
|
+
stripe: `\n# Stripe\nSTRIPE_SECRET_KEY=sk_test_replace-with-your-stripe-test-key\nSTRIPE_PUBLISHABLE_KEY=pk_test_replace-with-your-stripe-publishable-key\nSTRIPE_WEBHOOK_SECRET=whsec_replace-with-your-webhook-secret`,
|
|
526
|
+
openai: `\n# OpenAI\nOPENAI_API_KEY=sk-proj-replace-with-your-openai-key`,
|
|
527
|
+
anthropic: `\n# Anthropic\nANTHROPIC_API_KEY=sk-ant-replace-with-your-anthropic-key`,
|
|
528
|
+
supabase: `\n# Supabase\nNEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co\nNEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ-replace-with-anon-key\nSUPABASE_SERVICE_ROLE_KEY=eyJ-replace-with-service-role-key-KEEP-SECRET`,
|
|
529
|
+
firebase: `\n# Firebase\nFIREBASE_PROJECT_ID=your-project-id\nFIREBASE_CLIENT_EMAIL=firebase-adminsdk@your-project.iam.gserviceaccount.com\nFIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\\nreplace\\n-----END PRIVATE KEY-----\\n"`,
|
|
530
|
+
aws: `\n# AWS\nAWS_ACCESS_KEY_ID=AKIA-replace-with-your-key\nAWS_SECRET_ACCESS_KEY=replace-with-your-secret\nAWS_REGION=us-east-1`,
|
|
531
|
+
sendgrid: `\n# SendGrid\nSENDGRID_API_KEY=SG.replace-with-your-sendgrid-key`,
|
|
532
|
+
twilio: `\n# Twilio\nTWILIO_ACCOUNT_SID=AC-replace-with-your-account-sid\nTWILIO_AUTH_TOKEN=replace-with-your-auth-token`,
|
|
533
|
+
};
|
|
534
|
+
const base = templates[projectType] || templates["nextjs"];
|
|
535
|
+
const additions = services.map((s) => serviceAdditions[s] || "").join("");
|
|
536
|
+
const result = base + additions + "\n\n# Add this file to .gitignore:\n# echo '.env.local' >> .gitignore";
|
|
537
|
+
return { content: [{ type: "text", text: result }] };
|
|
538
|
+
}
|
|
283
539
|
default:
|
|
284
540
|
throw new types_js_1.McpError(types_js_1.ErrorCode.MethodNotFound, `Unknown tool: ${request.params.name}`);
|
|
285
541
|
}
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAEA,qCAA8D;AAC9D,yCAA0C;AAC1C,wEAAmE;AACnE,wEAAiF;AACjF,iEAK4C;AAC5C,qCAAgD;AAEhD,8EAA8E;AAE9E,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,EAAE,CAAC;AAC7D,IAAI,YAAY,GAAmB,IAAI,CAAC,CAAC,yBAAyB;AAElE,KAAK,UAAU,eAAe,CAAC,KAAa;IAC1C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,qDAAqD,EAAE;YAC7E,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC;YAC/B,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;SAClC,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,KAAK,CAAC;QAC1B,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAyB,CAAC;QACrD,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,KAAK,UAAU,KAAK;IAClB,IAAI,YAAY,KAAK,IAAI;QAAE,OAAO,YAAY,CAAC;IAC/C,IAAI,CAAC,WAAW,EAAE,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CAAC;YAE1G,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QACvD,CAAC;QAED;YACE,MAAM,IAAI,mBAAQ,CAAC,oBAAS,CAAC,cAAc,EAAE,iBAAiB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACzF,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;IACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/src/patterns.js
CHANGED
|
@@ -12,7 +12,7 @@ exports.credentialPatterns = [
|
|
|
12
12
|
{ type: "aws_access_key", regex: /\b(?:AKIA|ASIA)[A-Z0-9]{16}\b/g },
|
|
13
13
|
{ type: "aws_secret_key", regex: /\b(?:AWS_SECRET_ACCESS_KEY|aws_secret_access_key)\s*[:=]\s*['\"]?[A-Za-z0-9\/+=]{40}['\"]?/g },
|
|
14
14
|
{ type: "aws_secret_key_raw", regex: /\b[A-Za-z0-9\/+=]{40}\b/g },
|
|
15
|
-
{ type: "google_api_key", regex: /\bAIza[0-9A-Za-z_-]{
|
|
15
|
+
{ type: "google_api_key", regex: /\bAIza[0-9A-Za-z_-]{30,40}\b/g },
|
|
16
16
|
{ type: "stripe_secret_live", regex: /\bsk_live_[A-Za-z0-9]{16,120}\b/g },
|
|
17
17
|
{ type: "stripe_publishable_live", regex: /\bpk_live_[A-Za-z0-9]{16,120}\b/g },
|
|
18
18
|
{ type: "stripe_secret_test", regex: /\bsk_test_[A-Za-z0-9]{16,120}\b/g },
|
|
@@ -24,7 +24,7 @@ exports.credentialPatterns = [
|
|
|
24
24
|
{ type: "slack_bot_token", regex: /\bxoxb-[0-9A-Za-z-]{20,120}\b/g },
|
|
25
25
|
{ type: "slack_user_token", regex: /\bxoxp-[0-9A-Za-z-]{20,120}\b/g },
|
|
26
26
|
{ type: "slack_session_token", regex: /\bxoxs-[0-9A-Za-z-]{20,120}\b/g },
|
|
27
|
-
{ type: "discord_bot_token", regex: /\b[A-Za-z\d_-]{
|
|
27
|
+
{ type: "discord_bot_token", regex: /\b[A-Za-z\d_-]{23,28}\.[A-Za-z\d_-]{6}\.[A-Za-z\d_-]{27,38}\b/g },
|
|
28
28
|
{ type: "jwt_token", regex: /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g },
|
|
29
29
|
{ type: "postgres_url", regex: /\bpostgres(?:ql)?:\/\/[^\s'"`]+:[^\s'"`]+@[^\s'"`]+\b/g },
|
|
30
30
|
{ type: "mysql_url", regex: /\bmysql:\/\/[^\s'"`]+:[^\s'"`]+@[^\s'"`]+\b/g },
|
|
@@ -37,7 +37,7 @@ exports.credentialPatterns = [
|
|
|
37
37
|
{ type: "openssh_private_key", regex: /-----BEGIN OPENSSH PRIVATE KEY-----[\s\S]+?-----END OPENSSH PRIVATE KEY-----/g },
|
|
38
38
|
{ type: "dsa_private_key", regex: /-----BEGIN DSA PRIVATE KEY-----[\s\S]+?-----END DSA PRIVATE KEY-----/g },
|
|
39
39
|
{ type: "authorization_bearer", regex: /Authorization\s*:\s*Bearer\s+[A-Za-z0-9._-]{12,}/gi },
|
|
40
|
-
{ type: "firebase_web_api_key", regex: /\bAIza[0-9A-Za-z_-]{
|
|
40
|
+
{ type: "firebase_web_api_key", regex: /\bAIza[0-9A-Za-z_-]{30,40}\b/g },
|
|
41
41
|
{ type: "firebase_db_url", regex: /\bhttps:\/\/[a-z0-9-]+\.firebaseio\.com\b/gi },
|
|
42
42
|
{ type: "firebase_service_account", regex: /"type"\s*:\s*"service_account"[\s\S]*?"private_key"\s*:\s*"-----BEGIN PRIVATE KEY-----[\s\S]*?-----END PRIVATE KEY-----\\n"/g },
|
|
43
43
|
{ type: "netlify_token", regex: /\bnfp_[A-Za-z0-9]{20,120}\b/g },
|
|
@@ -68,6 +68,26 @@ exports.credentialPatterns = [
|
|
|
68
68
|
{ type: "oauth_refresh_token", regex: /\b1\/\/[A-Za-z0-9_-]{20,}\b/g },
|
|
69
69
|
{ type: "mailgun_api_key", regex: /\bkey-[A-Za-z0-9]{32}\b/g },
|
|
70
70
|
{ type: "shopify_access_token", regex: /\bshpat_[A-Za-z0-9]{20,120}\b/g },
|
|
71
|
-
{ type: "gitlab_token", regex: /\bglpat-[A-Za-z0-9_-]{20,120}\b/g }
|
|
71
|
+
{ type: "gitlab_token", regex: /\bglpat-[A-Za-z0-9_-]{20,120}\b/g },
|
|
72
|
+
// AI/ML platforms
|
|
73
|
+
{ type: "huggingface_token", regex: /\bhf_[A-Za-z0-9]{20,120}\b/g },
|
|
74
|
+
{ type: "replicate_token", regex: /\br8_[A-Za-z0-9]{20,120}\b/g },
|
|
75
|
+
{ type: "together_ai_key", regex: /\b(?:TOGETHER_API_KEY|together_api_key)\s*[:=]\s*['"\\]?[A-Za-z0-9]{32,120}['"\\]?/g },
|
|
76
|
+
{ type: "groq_api_key", regex: /\bgsk_[A-Za-z0-9]{20,120}\b/g },
|
|
77
|
+
{ type: "cohere_api_key", regex: /\b(?:COHERE_API_KEY|co-[A-Za-z0-9]{32,120})\b/g },
|
|
78
|
+
{ type: "elevenlabs_api_key", regex: /\b(?:ELEVENLABS_API_KEY|XI_API_KEY)\s*[:=]\s*['"\\]?[A-Za-z0-9]{32,120}['"\\]?/g },
|
|
79
|
+
{ type: "pinecone_api_key", regex: /\b(?:PINECONE_API_KEY)\s*[:=]\s*['"\\]?[A-Za-z0-9-]{20,120}['"\\]?/g },
|
|
80
|
+
// Database/infra platforms
|
|
81
|
+
{ type: "supabase_service_role_key", regex: /\b(?:SUPABASE_SERVICE_ROLE_KEY|supabase_service_role_key)\s*[:=]\s*['"\\]?eyJ[A-Za-z0-9_-]{50,}['"\\]?/g },
|
|
82
|
+
{ type: "planetscale_token", regex: /\bpscale_tkn_[A-Za-z0-9]{20,120}\b/g },
|
|
83
|
+
{ type: "railway_token", regex: /\b(?:RAILWAY_TOKEN|RAILWAY_API_KEY)\s*[:=]\s*['"\\]?[A-Za-z0-9-]{20,120}['"\\]?/g },
|
|
84
|
+
// Dev tools
|
|
85
|
+
{ type: "resend_api_key", regex: /\bre_[A-Za-z0-9]{20,120}\b/g },
|
|
86
|
+
{ type: "linear_api_key", regex: /\blin_api_[A-Za-z0-9]{20,120}\b/g },
|
|
87
|
+
{ type: "notion_api_key", regex: /\bsecret_[A-Za-z0-9]{40,120}\b/g },
|
|
88
|
+
{ type: "airtable_api_key", regex: /\bpat[A-Za-z0-9]{14}\.[A-Za-z0-9]{64}\b/g },
|
|
89
|
+
{ type: "doppler_token", regex: /\bdp\.pt\.[A-Za-z0-9]{40,120}\b/g },
|
|
90
|
+
{ type: "pulumi_access_token", regex: /\bpul-[A-Za-z0-9]{40,120}\b/g },
|
|
91
|
+
{ type: "cursor_session_token", regex: /\b(?:CURSOR_SESSION_TOKEN|cursor_session)\s*[:=]\s*['"\\]?[A-Za-z0-9._-]{20,120}['"\\]?/g }
|
|
72
92
|
];
|
|
73
93
|
//# sourceMappingURL=patterns.js.map
|
package/dist/src/patterns.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patterns.js","sourceRoot":"","sources":["../../src/patterns.ts"],"names":[],"mappings":";;;AAKa,QAAA,kBAAkB,GAAwB;IACrD,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,qCAAqC,EAAE;IAC3E,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,gCAAgC,EAAE;IACvE,EAA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AAE;CACpI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamblur/mcp",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "StreamBlur MCP server - redact API keys
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "StreamBlur MCP server - redact API keys and secrets from text and files. 9 tools, 77+ secret patterns. Pro: file, directory and repo scanning.",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"streamblur-mcp": "dist/src/index.js"
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { readFileSync, readdirSync, statSync } from "node:fs";
|
|
3
|
+
import { readFileSync, readdirSync, statSync, mkdirSync, rmSync, existsSync } from "node:fs";
|
|
4
4
|
import { join, extname } from "node:path";
|
|
5
|
+
import { execSync } from "node:child_process";
|
|
6
|
+
import { tmpdir } from "node:os";
|
|
5
7
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
6
8
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
7
9
|
import {
|
|
@@ -150,7 +152,7 @@ function scanDirectory(dirPath: string, maxFiles = 500): DirectoryScanResult[] {
|
|
|
150
152
|
// ─── Server Setup ──────────────────────────────────────────────────────────
|
|
151
153
|
|
|
152
154
|
const server = new Server(
|
|
153
|
-
{ name: "streamblur-mcp", version: "1.
|
|
155
|
+
{ name: "streamblur-mcp", version: "1.1.0" },
|
|
154
156
|
{ capabilities: { tools: {} } }
|
|
155
157
|
);
|
|
156
158
|
|
|
@@ -210,6 +212,70 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
210
212
|
required: ["path"],
|
|
211
213
|
additionalProperties: false
|
|
212
214
|
}
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: "scan_repo",
|
|
218
|
+
description: proActive
|
|
219
|
+
? "Clones a GitHub repository to a temp directory, scans all source files for exposed secrets, returns findings with file paths and line numbers, then deletes the temp clone. Pro feature."
|
|
220
|
+
: "Clones a GitHub repo and scans all files for leaked secrets. Pro feature - set STREAMBLUR_LICENSE_KEY to unlock.",
|
|
221
|
+
inputSchema: {
|
|
222
|
+
type: "object",
|
|
223
|
+
properties: {
|
|
224
|
+
repo_url: { type: "string", description: "GitHub repo URL (e.g. https://github.com/owner/repo)" },
|
|
225
|
+
max_files: { type: "number", description: "Max files to scan (default 300)" }
|
|
226
|
+
},
|
|
227
|
+
required: ["repo_url"],
|
|
228
|
+
additionalProperties: false
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: "audit_env_file",
|
|
233
|
+
description: "Reads a .env file and returns a full security report: detected secrets, formatting issues, placeholder values, and rotation recommendations. File is not modified.",
|
|
234
|
+
inputSchema: {
|
|
235
|
+
type: "object",
|
|
236
|
+
properties: {
|
|
237
|
+
path: { type: "string", description: "Path to .env file" }
|
|
238
|
+
},
|
|
239
|
+
required: ["path"],
|
|
240
|
+
additionalProperties: false
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "check_gitignore",
|
|
245
|
+
description: "Checks a project directory .gitignore to verify that .env files, key files, and secret directories are properly excluded. Returns a security gap report.",
|
|
246
|
+
inputSchema: {
|
|
247
|
+
type: "object",
|
|
248
|
+
properties: {
|
|
249
|
+
path: { type: "string", description: "Project root directory path" }
|
|
250
|
+
},
|
|
251
|
+
required: ["path"],
|
|
252
|
+
additionalProperties: false
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
name: "explain_detection",
|
|
257
|
+
description: "Given a detected secret type (e.g. stripe_secret_live, aws_access_key), explains what it is, the blast radius if leaked, and exactly where to go to revoke and rotate it immediately.",
|
|
258
|
+
inputSchema: {
|
|
259
|
+
type: "object",
|
|
260
|
+
properties: {
|
|
261
|
+
type: { type: "string", description: "Secret type string from a scan result (e.g. openai_api_key)" }
|
|
262
|
+
},
|
|
263
|
+
required: ["type"],
|
|
264
|
+
additionalProperties: false
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: "generate_env_template",
|
|
269
|
+
description: "Generates a safe .env.example template with placeholder values and security comments for common project types.",
|
|
270
|
+
inputSchema: {
|
|
271
|
+
type: "object",
|
|
272
|
+
properties: {
|
|
273
|
+
project_type: { type: "string", description: "Project type: nextjs, rails, django, express, nuxt, sveltekit" },
|
|
274
|
+
services: { type: "array", items: { type: "string" }, description: "Additional services: stripe, openai, anthropic, supabase, firebase, aws, sendgrid, twilio" }
|
|
275
|
+
},
|
|
276
|
+
required: ["project_type"],
|
|
277
|
+
additionalProperties: false
|
|
278
|
+
}
|
|
213
279
|
}
|
|
214
280
|
];
|
|
215
281
|
|
|
@@ -300,6 +366,194 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
300
366
|
}
|
|
301
367
|
}
|
|
302
368
|
|
|
369
|
+
case "scan_repo": {
|
|
370
|
+
const proActive = await isPro();
|
|
371
|
+
if (!proActive) {
|
|
372
|
+
return {
|
|
373
|
+
content: [{
|
|
374
|
+
type: "text",
|
|
375
|
+
text: "scan_repo is a StreamBlur Pro feature.\n\nSet STREAMBLUR_LICENSE_KEY to your Pro email or license key.\nGet Pro at https://streamblur.com/pricing - $2.99 one-time."
|
|
376
|
+
}]
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
const repoUrl = args.repo_url;
|
|
380
|
+
if (typeof repoUrl !== "string" || !repoUrl.startsWith("http")) {
|
|
381
|
+
throw new McpError(ErrorCode.InvalidParams, "'repo_url' must be a valid GitHub URL");
|
|
382
|
+
}
|
|
383
|
+
const maxFiles = typeof args.max_files === "number" ? args.max_files : 300;
|
|
384
|
+
const tmpDir = join(tmpdir(), "streamblur-scan-" + Date.now());
|
|
385
|
+
try {
|
|
386
|
+
mkdirSync(tmpDir, { recursive: true });
|
|
387
|
+
execSync(`git clone --depth 1 "${repoUrl}" "${tmpDir}"`, { timeout: 60000, stdio: "pipe" });
|
|
388
|
+
const results = scanDirectory(tmpDir, maxFiles);
|
|
389
|
+
if (results.length === 0) {
|
|
390
|
+
return { content: [{ type: "text", text: `No secrets detected in ${repoUrl}` }] };
|
|
391
|
+
}
|
|
392
|
+
const summary = results.map(r =>
|
|
393
|
+
`${r.file.replace(tmpDir + "/", "")}\n${r.detections.map((d: { line: number; column: number; type: string }) => ` Line ${d.line}:${d.column} - ${d.type}`).join("\n")}`
|
|
394
|
+
).join("\n\n");
|
|
395
|
+
return {
|
|
396
|
+
content: [{
|
|
397
|
+
type: "text",
|
|
398
|
+
text: `Found secrets in ${results.length} file(s) in ${repoUrl}:\n\n${summary}`
|
|
399
|
+
}]
|
|
400
|
+
};
|
|
401
|
+
} catch (err: unknown) {
|
|
402
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
403
|
+
throw new McpError(ErrorCode.InternalError, `Repo scan failed: ${msg}`);
|
|
404
|
+
} finally {
|
|
405
|
+
try { rmSync(tmpDir, { recursive: true, force: true }); } catch { /* cleanup */ }
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
case "audit_env_file": {
|
|
410
|
+
const filePath = args.path;
|
|
411
|
+
if (typeof filePath !== "string") {
|
|
412
|
+
throw new McpError(ErrorCode.InvalidParams, "'path' must be a string");
|
|
413
|
+
}
|
|
414
|
+
try {
|
|
415
|
+
const content = readFileSync(filePath, "utf8");
|
|
416
|
+
const lines = content.split("\n");
|
|
417
|
+
const issues: string[] = [];
|
|
418
|
+
const secrets: string[] = [];
|
|
419
|
+
const placeholders: string[] = [];
|
|
420
|
+
|
|
421
|
+
for (let i = 0; i < lines.length; i++) {
|
|
422
|
+
const line = lines[i].trim();
|
|
423
|
+
if (!line || line.startsWith("#")) continue;
|
|
424
|
+
const eqIdx = line.indexOf("=");
|
|
425
|
+
if (eqIdx === -1) { issues.push(`Line ${i+1}: Missing = sign: ${line}`); continue; }
|
|
426
|
+
const key = line.slice(0, eqIdx).trim();
|
|
427
|
+
const val = line.slice(eqIdx + 1).trim();
|
|
428
|
+
if (/\s/.test(key)) issues.push(`Line ${i+1}: Key has spaces: ${key}`);
|
|
429
|
+
if (val === "" || val === '""' || val === "''") issues.push(`Line ${i+1}: Empty value for ${key}`);
|
|
430
|
+
if (/^(your[_-]|xxx|placeholder|changeme|todo|replace|insert|example)/i.test(val.replace(/['"]/g, ""))) {
|
|
431
|
+
placeholders.push(`Line ${i+1}: ${key} has placeholder value`);
|
|
432
|
+
}
|
|
433
|
+
const detected = scanText(line);
|
|
434
|
+
if (detected.length > 0) {
|
|
435
|
+
secrets.push(`Line ${i+1}: ${key} - detected as ${detected.map((d: { type: string }) => d.type).join(", ")}`);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
let report = `Env File Audit: ${filePath}\n${"=".repeat(40)}\n`;
|
|
440
|
+
report += `Lines: ${lines.length} | Variables: ${lines.filter(l => l.includes("=") && !l.startsWith("#")).length}\n\n`;
|
|
441
|
+
if (secrets.length > 0) report += `SECRETS DETECTED (${secrets.length}):\n${secrets.join("\n")}\n\n`;
|
|
442
|
+
if (issues.length > 0) report += `FORMAT ISSUES (${issues.length}):\n${issues.join("\n")}\n\n`;
|
|
443
|
+
if (placeholders.length > 0) report += `PLACEHOLDERS (${placeholders.length}):\n${placeholders.join("\n")}\n\n`;
|
|
444
|
+
if (secrets.length === 0 && issues.length === 0) report += `No issues found. File looks clean.\n`;
|
|
445
|
+
report += `\nReminder: ensure this file is in .gitignore and never committed to version control.`;
|
|
446
|
+
|
|
447
|
+
return { content: [{ type: "text", text: report }] };
|
|
448
|
+
} catch (err: unknown) {
|
|
449
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
450
|
+
throw new McpError(ErrorCode.InternalError, `Could not read file: ${msg}`);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
case "check_gitignore": {
|
|
455
|
+
const dirPath = args.path;
|
|
456
|
+
if (typeof dirPath !== "string") {
|
|
457
|
+
throw new McpError(ErrorCode.InvalidParams, "'path' must be a string");
|
|
458
|
+
}
|
|
459
|
+
const gitignorePath = join(dirPath, ".gitignore");
|
|
460
|
+
const mustIgnore = [".env", ".env.local", ".env.production", ".env.*.local", "*.pem", "*.key", ".secret"];
|
|
461
|
+
const shouldIgnore = [".env.development", ".env.staging", "secrets/", "credentials/"];
|
|
462
|
+
|
|
463
|
+
try {
|
|
464
|
+
if (!existsSync(gitignorePath)) {
|
|
465
|
+
return {
|
|
466
|
+
content: [{
|
|
467
|
+
type: "text",
|
|
468
|
+
text: `No .gitignore found in ${dirPath}.\n\nCRITICAL: Create a .gitignore immediately and add:\n${mustIgnore.join("\n")}`
|
|
469
|
+
}]
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
const content = readFileSync(gitignorePath, "utf8");
|
|
473
|
+
const missing = mustIgnore.filter(p => !content.includes(p));
|
|
474
|
+
const suggested = shouldIgnore.filter(p => !content.includes(p));
|
|
475
|
+
let report = `.gitignore Audit: ${gitignorePath}\n${"=".repeat(40)}\n`;
|
|
476
|
+
if (missing.length === 0) {
|
|
477
|
+
report += `All critical patterns are covered.\n`;
|
|
478
|
+
} else {
|
|
479
|
+
report += `CRITICAL - Missing patterns (add these NOW):\n${missing.map(p => ` ${p}`).join("\n")}\n\n`;
|
|
480
|
+
}
|
|
481
|
+
if (suggested.length > 0) {
|
|
482
|
+
report += `Recommended additions:\n${suggested.map(p => ` ${p}`).join("\n")}\n`;
|
|
483
|
+
}
|
|
484
|
+
return { content: [{ type: "text", text: report }] };
|
|
485
|
+
} catch (err: unknown) {
|
|
486
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
487
|
+
throw new McpError(ErrorCode.InternalError, `Could not check gitignore: ${msg}`);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
case "explain_detection": {
|
|
492
|
+
const detectionType = args.type;
|
|
493
|
+
if (typeof detectionType !== "string") {
|
|
494
|
+
throw new McpError(ErrorCode.InvalidParams, "'type' must be a string");
|
|
495
|
+
}
|
|
496
|
+
const explanations: Record<string, { name: string; risk: string; action: string; url: string }> = {
|
|
497
|
+
openai_api_key: { name: "OpenAI API Key", risk: "HIGH - Full API access. Attacker can run unlimited GPT-4 requests at your expense. Costs can hit thousands of dollars within hours.", action: "1. Go to platform.openai.com/api-keys\n2. Delete the exposed key immediately\n3. Create a new key\n4. Update all services using the old key", url: "https://platform.openai.com/api-keys" },
|
|
498
|
+
anthropic_api_key: { name: "Anthropic API Key", risk: "HIGH - Full Claude API access. Unauthorized usage billed to your account.", action: "1. Go to console.anthropic.com/settings/keys\n2. Delete the exposed key\n3. Generate a new key\n4. Update environment variables", url: "https://console.anthropic.com/settings/keys" },
|
|
499
|
+
stripe_secret_live: { name: "Stripe Live Secret Key", risk: "CRITICAL - Full access to your Stripe account. Attacker can create charges, issue refunds, access customer data, and drain your balance.", action: "1. Go to dashboard.stripe.com/apikeys\n2. Roll (rotate) the key immediately\n3. Update all integrations", url: "https://dashboard.stripe.com/apikeys" },
|
|
500
|
+
aws_access_key: { name: "AWS Access Key ID", risk: "CRITICAL - Combined with secret key, gives full AWS account access. Can spin up infrastructure, access S3 data, and incur massive costs.", action: "1. Go to AWS IAM console\n2. Deactivate the key immediately\n3. Create new credentials\n4. Check CloudTrail for unauthorized activity", url: "https://console.aws.amazon.com/iam/home#/security_credentials" },
|
|
501
|
+
github_pat: { name: "GitHub Personal Access Token", risk: "HIGH - Can access private repos, commit code, read secrets in Actions, and depending on scope, full org access.", action: "1. Go to github.com/settings/tokens\n2. Delete the exposed token immediately\n3. Audit recent activity on affected repos", url: "https://github.com/settings/tokens" },
|
|
502
|
+
discord_bot_token: { name: "Discord Bot Token", risk: "MEDIUM-HIGH - Full control of the bot. Can read all messages the bot has access to, send messages as the bot, manage channels.", action: "1. Go to discord.com/developers/applications\n2. Select your app > Bot > Reset Token\n3. Update your deployment with the new token", url: "https://discord.com/developers/applications" },
|
|
503
|
+
stripe_secret_test: { name: "Stripe Test Secret Key", risk: "LOW - Test mode only, no real money. Best practice to rotate anyway.", action: "1. Go to dashboard.stripe.com/apikeys\n2. Roll the test key", url: "https://dashboard.stripe.com/apikeys" },
|
|
504
|
+
google_api_key: { name: "Google API Key", risk: "MEDIUM-HIGH - Depending on enabled APIs, can incur costs or expose data.", action: "1. Go to console.cloud.google.com/apis/credentials\n2. Delete or restrict the key\n3. Create a new restricted key", url: "https://console.cloud.google.com/apis/credentials" },
|
|
505
|
+
huggingface_token: { name: "Hugging Face Token", risk: "MEDIUM - Access to models, datasets, and spaces under your account.", action: "1. Go to huggingface.co/settings/tokens\n2. Delete the exposed token\n3. Create a new one", url: "https://huggingface.co/settings/tokens" },
|
|
506
|
+
supabase_service_role_key: { name: "Supabase Service Role Key", risk: "CRITICAL - Bypasses Row Level Security entirely. Full read/write access to all database tables.", action: "1. Go to supabase.com/dashboard > Project Settings > API\n2. Rotate the service role key\n3. Update all server-side integrations", url: "https://supabase.com/dashboard" },
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
const info = explanations[detectionType];
|
|
510
|
+
if (!info) {
|
|
511
|
+
return {
|
|
512
|
+
content: [{
|
|
513
|
+
type: "text",
|
|
514
|
+
text: `Detection type: ${detectionType}\n\nNo specific guidance available for this type yet.\n\nGeneral advice:\n- Treat it as potentially sensitive\n- Search your provider dashboard for API keys or tokens section\n- Revoke/rotate the value immediately\n- Check logs for unauthorized usage\n- Update all services using the old value`
|
|
515
|
+
}]
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
return {
|
|
519
|
+
content: [{
|
|
520
|
+
type: "text",
|
|
521
|
+
text: `${info.name}\n${"=".repeat(info.name.length)}\n\nRisk: ${info.risk}\n\nImmediate action:\n${info.action}\n\nDashboard: ${info.url}`
|
|
522
|
+
}]
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
case "generate_env_template": {
|
|
527
|
+
const projectType = (args.project_type as string || "nextjs").toLowerCase();
|
|
528
|
+
const services = Array.isArray(args.services) ? args.services as string[] : [];
|
|
529
|
+
|
|
530
|
+
const templates: Record<string, string> = {
|
|
531
|
+
nextjs: `# Next.js Environment Variables\n# Copy to .env.local - NEVER commit .env.local to git\n\n# App\nNEXT_PUBLIC_APP_URL=http://localhost:3000\nNEXT_PUBLIC_APP_NAME=your-app-name\n\n# Database\nDATABASE_URL=postgresql://user:password@localhost:5432/dbname`,
|
|
532
|
+
express: `# Express Environment Variables\n# Copy to .env - NEVER commit .env to git\n\nNODE_ENV=development\nPORT=3000\n\n# Database\nDATABASE_URL=postgresql://user:password@localhost:5432/dbname\n\n# Session\nSESSION_SECRET=replace-with-random-32-char-string`,
|
|
533
|
+
django: `# Django Environment Variables\n# Copy to .env - NEVER commit .env to git\n\nDJANGO_SECRET_KEY=replace-with-50-char-random-string\nDEBUG=True\nALLOWED_HOSTS=localhost,127.0.0.1\n\n# Database\nDATABASE_URL=postgresql://user:password@localhost:5432/dbname`,
|
|
534
|
+
rails: `# Rails Environment Variables\n# Copy to .env - NEVER commit .env to git\n\nRAILS_ENV=development\nSECRET_KEY_BASE=replace-with-rails-credentials-output\n\n# Database\nDATABASE_URL=postgresql://user:password@localhost:5432/dbname`,
|
|
535
|
+
nuxt: `# Nuxt Environment Variables\n# Copy to .env - NEVER commit .env to git\n\nNUXT_PUBLIC_SITE_URL=http://localhost:3000\nNUXT_SECRET_KEY=replace-with-random-32-char-string`,
|
|
536
|
+
sveltekit: `# SvelteKit Environment Variables\n# Copy to .env - NEVER commit .env to git\n\nPUBLIC_APP_URL=http://localhost:5173\nPRIVATE_SECRET_KEY=replace-with-random-32-char-string`,
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
const serviceAdditions: Record<string, string> = {
|
|
540
|
+
stripe: `\n# Stripe\nSTRIPE_SECRET_KEY=sk_test_replace-with-your-stripe-test-key\nSTRIPE_PUBLISHABLE_KEY=pk_test_replace-with-your-stripe-publishable-key\nSTRIPE_WEBHOOK_SECRET=whsec_replace-with-your-webhook-secret`,
|
|
541
|
+
openai: `\n# OpenAI\nOPENAI_API_KEY=sk-proj-replace-with-your-openai-key`,
|
|
542
|
+
anthropic: `\n# Anthropic\nANTHROPIC_API_KEY=sk-ant-replace-with-your-anthropic-key`,
|
|
543
|
+
supabase: `\n# Supabase\nNEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co\nNEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ-replace-with-anon-key\nSUPABASE_SERVICE_ROLE_KEY=eyJ-replace-with-service-role-key-KEEP-SECRET`,
|
|
544
|
+
firebase: `\n# Firebase\nFIREBASE_PROJECT_ID=your-project-id\nFIREBASE_CLIENT_EMAIL=firebase-adminsdk@your-project.iam.gserviceaccount.com\nFIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\\nreplace\\n-----END PRIVATE KEY-----\\n"`,
|
|
545
|
+
aws: `\n# AWS\nAWS_ACCESS_KEY_ID=AKIA-replace-with-your-key\nAWS_SECRET_ACCESS_KEY=replace-with-your-secret\nAWS_REGION=us-east-1`,
|
|
546
|
+
sendgrid: `\n# SendGrid\nSENDGRID_API_KEY=SG.replace-with-your-sendgrid-key`,
|
|
547
|
+
twilio: `\n# Twilio\nTWILIO_ACCOUNT_SID=AC-replace-with-your-account-sid\nTWILIO_AUTH_TOKEN=replace-with-your-auth-token`,
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
const base = templates[projectType] || templates["nextjs"];
|
|
551
|
+
const additions = services.map((s: string) => serviceAdditions[s] || "").join("");
|
|
552
|
+
const result = base + additions + "\n\n# Add this file to .gitignore:\n# echo '.env.local' >> .gitignore";
|
|
553
|
+
|
|
554
|
+
return { content: [{ type: "text", text: result }] };
|
|
555
|
+
}
|
|
556
|
+
|
|
303
557
|
default:
|
|
304
558
|
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${request.params.name}`);
|
|
305
559
|
}
|
package/src/patterns.ts
CHANGED
|
@@ -17,7 +17,7 @@ export const credentialPatterns: CredentialPattern[] = [
|
|
|
17
17
|
{ type: "aws_secret_key", regex: /\b(?:AWS_SECRET_ACCESS_KEY|aws_secret_access_key)\s*[:=]\s*['\"]?[A-Za-z0-9\/+=]{40}['\"]?/g },
|
|
18
18
|
{ type: "aws_secret_key_raw", regex: /\b[A-Za-z0-9\/+=]{40}\b/g },
|
|
19
19
|
|
|
20
|
-
{ type: "google_api_key", regex: /\bAIza[0-9A-Za-z_-]{
|
|
20
|
+
{ type: "google_api_key", regex: /\bAIza[0-9A-Za-z_-]{30,40}\b/g },
|
|
21
21
|
|
|
22
22
|
{ type: "stripe_secret_live", regex: /\bsk_live_[A-Za-z0-9]{16,120}\b/g },
|
|
23
23
|
{ type: "stripe_publishable_live", regex: /\bpk_live_[A-Za-z0-9]{16,120}\b/g },
|
|
@@ -34,7 +34,7 @@ export const credentialPatterns: CredentialPattern[] = [
|
|
|
34
34
|
{ type: "slack_user_token", regex: /\bxoxp-[0-9A-Za-z-]{20,120}\b/g },
|
|
35
35
|
{ type: "slack_session_token", regex: /\bxoxs-[0-9A-Za-z-]{20,120}\b/g },
|
|
36
36
|
|
|
37
|
-
{ type: "discord_bot_token", regex: /\b[A-Za-z\d_-]{
|
|
37
|
+
{ type: "discord_bot_token", regex: /\b[A-Za-z\d_-]{23,28}\.[A-Za-z\d_-]{6}\.[A-Za-z\d_-]{27,38}\b/g },
|
|
38
38
|
|
|
39
39
|
{ type: "jwt_token", regex: /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g },
|
|
40
40
|
|
|
@@ -53,7 +53,7 @@ export const credentialPatterns: CredentialPattern[] = [
|
|
|
53
53
|
|
|
54
54
|
{ type: "authorization_bearer", regex: /Authorization\s*:\s*Bearer\s+[A-Za-z0-9._-]{12,}/gi },
|
|
55
55
|
|
|
56
|
-
{ type: "firebase_web_api_key", regex: /\bAIza[0-9A-Za-z_-]{
|
|
56
|
+
{ type: "firebase_web_api_key", regex: /\bAIza[0-9A-Za-z_-]{30,40}\b/g },
|
|
57
57
|
{ type: "firebase_db_url", regex: /\bhttps:\/\/[a-z0-9-]+\.firebaseio\.com\b/gi },
|
|
58
58
|
{ type: "firebase_service_account", regex: /"type"\s*:\s*"service_account"[\s\S]*?"private_key"\s*:\s*"-----BEGIN PRIVATE KEY-----[\s\S]*?-----END PRIVATE KEY-----\\n"/g },
|
|
59
59
|
|
|
@@ -87,5 +87,28 @@ export const credentialPatterns: CredentialPattern[] = [
|
|
|
87
87
|
{ type: "oauth_refresh_token", regex: /\b1\/\/[A-Za-z0-9_-]{20,}\b/g },
|
|
88
88
|
{ type: "mailgun_api_key", regex: /\bkey-[A-Za-z0-9]{32}\b/g },
|
|
89
89
|
{ type: "shopify_access_token", regex: /\bshpat_[A-Za-z0-9]{20,120}\b/g },
|
|
90
|
-
{ type: "gitlab_token", regex: /\bglpat-[A-Za-z0-9_-]{20,120}\b/g }
|
|
90
|
+
{ type: "gitlab_token", regex: /\bglpat-[A-Za-z0-9_-]{20,120}\b/g },
|
|
91
|
+
|
|
92
|
+
// AI/ML platforms
|
|
93
|
+
{ type: "huggingface_token", regex: /\bhf_[A-Za-z0-9]{20,120}\b/g },
|
|
94
|
+
{ type: "replicate_token", regex: /\br8_[A-Za-z0-9]{20,120}\b/g },
|
|
95
|
+
{ type: "together_ai_key", regex: /\b(?:TOGETHER_API_KEY|together_api_key)\s*[:=]\s*['"\\]?[A-Za-z0-9]{32,120}['"\\]?/g },
|
|
96
|
+
{ type: "groq_api_key", regex: /\bgsk_[A-Za-z0-9]{20,120}\b/g },
|
|
97
|
+
{ type: "cohere_api_key", regex: /\b(?:COHERE_API_KEY|co-[A-Za-z0-9]{32,120})\b/g },
|
|
98
|
+
{ type: "elevenlabs_api_key", regex: /\b(?:ELEVENLABS_API_KEY|XI_API_KEY)\s*[:=]\s*['"\\]?[A-Za-z0-9]{32,120}['"\\]?/g },
|
|
99
|
+
{ type: "pinecone_api_key", regex: /\b(?:PINECONE_API_KEY)\s*[:=]\s*['"\\]?[A-Za-z0-9-]{20,120}['"\\]?/g },
|
|
100
|
+
|
|
101
|
+
// Database/infra platforms
|
|
102
|
+
{ type: "supabase_service_role_key", regex: /\b(?:SUPABASE_SERVICE_ROLE_KEY|supabase_service_role_key)\s*[:=]\s*['"\\]?eyJ[A-Za-z0-9_-]{50,}['"\\]?/g },
|
|
103
|
+
{ type: "planetscale_token", regex: /\bpscale_tkn_[A-Za-z0-9]{20,120}\b/g },
|
|
104
|
+
{ type: "railway_token", regex: /\b(?:RAILWAY_TOKEN|RAILWAY_API_KEY)\s*[:=]\s*['"\\]?[A-Za-z0-9-]{20,120}['"\\]?/g },
|
|
105
|
+
|
|
106
|
+
// Dev tools
|
|
107
|
+
{ type: "resend_api_key", regex: /\bre_[A-Za-z0-9]{20,120}\b/g },
|
|
108
|
+
{ type: "linear_api_key", regex: /\blin_api_[A-Za-z0-9]{20,120}\b/g },
|
|
109
|
+
{ type: "notion_api_key", regex: /\bsecret_[A-Za-z0-9]{40,120}\b/g },
|
|
110
|
+
{ type: "airtable_api_key", regex: /\bpat[A-Za-z0-9]{14}\.[A-Za-z0-9]{64}\b/g },
|
|
111
|
+
{ type: "doppler_token", regex: /\bdp\.pt\.[A-Za-z0-9]{40,120}\b/g },
|
|
112
|
+
{ type: "pulumi_access_token", regex: /\bpul-[A-Za-z0-9]{40,120}\b/g },
|
|
113
|
+
{ type: "cursor_session_token", regex: /\b(?:CURSOR_SESSION_TOKEN|cursor_session)\s*[:=]\s*['"\\]?[A-Za-z0-9._-]{20,120}['"\\]?/g }
|
|
91
114
|
];
|