/** * MCP Server Trust Utilities * * Validates that MCP servers configured in Cursor are trusted. * Cursor requires explicit trust for MCP servers before they can be used. * * @module agents/cursor/mcp/trust */ /** * MCP server configuration from Cursor's mcp.json. */ export interface McpServerConfig { /** Server command to execute */ command?: string; /** Command arguments */ args?: string[]; /** Environment variables */ env?: Record; /** Whether user has trusted this server */ trusted?: boolean; } /** * Root structure of Cursor's mcp.json configuration file. */ export interface McpConfig { /** Map of server name to server configuration */ mcpServers?: Record; } /** * Get the default path to Cursor's MCP configuration file. * * The configuration is typically stored at `~/.cursor/mcp.json`. * * @returns Absolute path to mcp.json * * @example * ```typescript * const configPath = getDefaultMcpConfigPath(); * // Returns: /Users/username/.cursor/mcp.json * ``` */ export declare function getDefaultMcpConfigPath(): string; /** * Check if MCP servers are configured and trusted. * * Reads Cursor's MCP configuration and warns about any untrusted servers. * This is non-blocking - execution continues even if servers are untrusted, * but warnings are logged to help users understand why MCP tools might fail. * * @param workDir - Working directory (currently unused, for future filtering) * @returns Promise that resolves when check is complete * * @example * ```typescript * // Before executing Cursor task with MCP servers * await ensureMcpServerTrust('/path/to/project'); * ``` */ export declare function ensureMcpServerTrust(workDir: string): Promise; /** * Read MCP configuration from Cursor's config file. * * This is a lower-level utility that reads and parses the MCP config * without performing any validation or warnings. * * @param configPath - Optional custom path to mcp.json (defaults to ~/.cursor/mcp.json) * @returns Parsed MCP configuration, or null if file doesn't exist or is invalid * * @example * ```typescript * const config = await readMcpConfig(); * if (config?.mcpServers) { * console.log('Configured servers:', Object.keys(config.mcpServers)); * } * ``` */ export declare function readMcpConfig(configPath?: string): Promise; /** * Check if a specific MCP server is trusted. * * @param serverName - Name of the MCP server to check * @param configPath - Optional custom path to mcp.json * @returns True if server exists and is trusted, false otherwise * * @example * ```typescript * if (await isMcpServerTrusted('filesystem')) { * console.log('Filesystem MCP server is trusted'); * } * ``` */ export declare function isMcpServerTrusted(serverName: string, configPath?: string): Promise; /** * Get list of all configured MCP servers. * * @param configPath - Optional custom path to mcp.json * @returns Array of server names, or empty array if no servers configured * * @example * ```typescript * const servers = await listMcpServers(); * console.log('Configured MCP servers:', servers); * ``` */ export declare function listMcpServers(configPath?: string): Promise; //# sourceMappingURL=trust.d.ts.map