@guardbee/mcp-prompt-leak-scanner 1.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @guardbee/mcp-prompt-leak-scanner
2
2
 
3
+ ## 1.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#247](https://github.com/GuardBee/guardbee-mcp/pull/247) [`30cc59d`](https://github.com/GuardBee/guardbee-mcp/commit/30cc59d169b9e0146e5ca785de7536c4dc4e98b9) Thanks [@4hmetuyar](https://github.com/4hmetuyar)! - Tool schemas are now declared with `z.object(...)` instead of raw Zod shapes, which MCP SDK v2 deprecates. The JSON Schema sent to clients is unchanged.
8
+
3
9
  ## 1.1.0
4
10
 
5
11
  ### Minor Changes
package/dist/server.js CHANGED
@@ -40,28 +40,28 @@ export async function startServer() {
40
40
  export function registerTools(server) {
41
41
  server.registerTool("scan_text", {
42
42
  description: "Scan a raw text string (e.g. a prompt you're about to send to an LLM) for leaked credentials (API keys, private keys, JWTs) and PII (TC Kimlik No, credit card, IBAN, email, phone) — checksum-validated where applicable to keep false positives low.",
43
- inputSchema: {
43
+ inputSchema: z.object({
44
44
  content: z.string().describe("The text to scan"),
45
45
  label: z.string().optional().describe("Optional label shown in findings"),
46
- },
46
+ }),
47
47
  }, async ({ content, label }) => {
48
48
  const findings = scanText(content, label);
49
49
  return { content: [{ type: "text", text: formatFindings(findings, 1, 0) }] };
50
50
  });
51
51
  server.registerTool("scan_messages", {
52
52
  description: "Scan an OpenAI/Anthropic-style chat request body (a JSON object with a `messages` array and/or a `system` field) for leaked credentials and PII in every message's text content, before it would be sent to the model.",
53
- inputSchema: {
53
+ inputSchema: z.object({
54
54
  body: z.record(z.string(), z.unknown()).describe("The chat request body object, e.g. { model, system, messages: [{ role, content }] }"),
55
- },
55
+ }),
56
56
  }, async ({ body }) => {
57
57
  const { findings } = scanBody(body);
58
58
  return { content: [{ type: "text", text: formatFindings(findings, 1, 0) }] };
59
59
  });
60
60
  server.registerTool("scan_file", {
61
61
  description: "Scan a single file — plain text, or a JSON chat-request-body fixture (auto-detected) — for leaked credentials and PII",
62
- inputSchema: {
62
+ inputSchema: z.object({
63
63
  path: z.string().describe("Absolute or relative path to the file to scan"),
64
- },
64
+ }),
65
65
  }, async ({ path: filePath }) => {
66
66
  const { findings, skipped } = scanFile(filePath);
67
67
  if (skipped) {
@@ -71,12 +71,12 @@ export function registerTools(server) {
71
71
  });
72
72
  server.registerTool("scan_directory", {
73
73
  description: "Recursively scan a directory of prompt logs or request-body fixtures for leaked credentials and PII",
74
- inputSchema: {
74
+ inputSchema: z.object({
75
75
  path: z.string().describe("Absolute or relative path to the directory to scan"),
76
76
  maxFiles: z.number().int().positive().optional().describe("Maximum number of files to scan (default: 5000)"),
77
77
  include: z.array(z.string()).optional().describe("Only scan files whose path contains one of these strings"),
78
78
  exclude: z.array(z.string()).optional().describe("Skip files/dirs whose path contains one of these strings"),
79
- },
79
+ }),
80
80
  }, async ({ path: dirPath, maxFiles, include, exclude }) => {
81
81
  const result = scanDirectory(dirPath, { maxFiles, include, exclude });
82
82
  return { content: [{ type: "text", text: formatFindings(result.findings, result.scannedFiles, result.durationMs) }] };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardbee/mcp-prompt-leak-scanner",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "mcpName": "io.github.GuardBee/prompt-leak-scanner",
5
5
  "description": "PII and secret leak scanner for LLM prompts: catches API keys, TC Kimlik No, cards and IBANs in outbound prompts before they leave your app; MCP server and reverse proxy",
6
6
  "type": "module",