import type { McpServerRef } from './types.js'; /** * Where MCP clients keep the servers they start, and how to read those files. * * `scan` reads the configuration a developer already has instead of asking for a * tools/list dump: the servers in these files are the ones that reach a model on * this machine, so they are the ones worth vetting. */ export type ClientKind = 'claude-code' | 'claude-desktop' | 'cursor' | 'vscode' | 'windsurf' | 'file'; export declare const CLIENT_KINDS: readonly ClientKind[]; export interface ConfigSource { client: ClientKind; path: string; /** `user` files hold every project's servers; `project` files sit in the working tree. */ scope: 'user' | 'project'; } export interface ConfiguredServer { /** The pin identity, a slug: the config key when it is one, otherwise derived from it. */ id: string; /** The key under which the client lists this server. */ key: string; client: ClientKind; source: string; scope: 'user' | 'project'; ref: McpServerRef; /** Remote servers: headers the client would send (may hold credentials; never printed). */ headers?: Record; /** The client already starts this server through `warden-mcp wrap`. */ wrapped: boolean; /** Why this entry cannot be scanned. A skipped entry is still listed, never silently dropped. */ skipped?: string; } export interface DiscoveryEnv { home: string; cwd: string; platform: NodeJS.Platform; env: Record; } /** Every file a known client reads, whether or not it exists. */ export declare function knownConfigSources(d: DiscoveryEnv): ConfigSource[]; /** Which client a file given on the command line belongs to, from its name and path. */ export declare function guessClient(path: string): ClientKind; /** A pin id from a config key: the key itself when it is a slug, else a slug made from it. */ export declare function pinIdFor(key: string): string; /** * Strip `//` and `/* *\/` comments and trailing commas, outside strings. VS Code's * `mcp.json` is JSONC; the others are plain JSON, for which this is a no-op. */ export declare function stripJsonc(text: string): string; /** * If a config entry starts a server through `warden-mcp wrap`, return the server * behind it, so `scan` vets the real program and the same pin the proxy uses. */ export declare function unwrapWarden(command: string, args: readonly string[]): { id?: string; command: string; args: string[]; } | undefined; /** Parse one client file into the servers it starts. Throws on a file that is not JSON. */ export declare function parseConfigText(text: string, source: ConfigSource, d: DiscoveryEnv): ConfiguredServer[]; export interface SourceResult { source: ConfigSource; servers: ConfiguredServer[]; error?: string; } /** * Read the given files, or every known client file that exists. A file that * cannot be parsed is reported, not skipped: a config the client cannot read is * not a config the client starts servers from, but the scan should say so. */ export declare function discoverServers(paths: readonly string[] | undefined, d: DiscoveryEnv, clients?: readonly ClientKind[]): Promise; //# sourceMappingURL=scan-config.d.ts.map