/** * MCP (Model Context Protocol) server configuration scanner. * * MCP servers are configured in JSON files checked into repos * (.mcp.json, .cursor/mcp.json, .vscode/mcp.json, claude_desktop_config.json, * .gemini/settings.json) and launched automatically by AI coding agents. * That makes them a supply-chain attack surface: a malicious server package * (postmark-mcp 1.0.16 was the first documented hostile MCP server; * Shai-Hulud 2.0 targeted mcp-server npm packages), a C2-controlled remote * endpoint, or a prompt-injection payload in a tool description all execute * with the agent's privileges. * * Checks per configured server: * - command/args launching packages (npx/uvx/python -m/node) matched against * the threat-intel feed and the known-bad-version blocklist * - remote "url" endpoints matched against the C2/IOC blocklist * - plain-http (non-localhost) endpoints * - credential-looking env vars forwarded to servers * - prompt-injection tokens in description/instructions strings * - npx -y with an unpinned package (mutable server, rug-pull enabler) * * Future work (not in this version): stateful baseline tracking of server * definitions across scans to detect rug-pulls - a server whose package * version, command, or URL silently changed since the last scan. Requires * persisting a baseline like continuous-monitor.ts does for risk history. */ import type { Finding } from "./types.js"; import { type FeedIOC } from "./threat-intel.js"; /** MCP config file locations, relative to the scanned directory (never the user home). */ export declare const MCP_CONFIG_FILES: string[]; /** * Check whether the directory contains any MCP config file. */ export declare function hasMcpConfigFiles(dir: string): boolean; /** * Scan all MCP config files in a directory. */ export declare function scanMcpConfigs(dir: string): Finding[]; /** * Scan the content of a single MCP config file. */ export declare function scanMcpConfigContent(content: string, relativePath: string, feed?: FeedIOC[]): Finding[]; //# sourceMappingURL=mcp-scanner.d.ts.map