/** * MCP-based URL resolver for eval-samples. * * Reads a MCP config file (.mcp.json), launches configured MCP servers, * and uses them to fetch URL content that cannot be reached via plain HTTP * (e.g. private documentation behind SSO). * * Config format (.mcp.json): * { * "mcpServers": { * "docs": { * "command": "npx", * "args": ["@example/docs-mcp-server"], * "env": { "DOCS_API_TOKEN": "xxx" }, * "urlPatterns": ["docs.example.com"], * "fetchTool": { "name": "get_doc", "urlParam": "url" } * } * } * } * * Advanced: urlTransform + contentExtract for complex MCP tools: * { * "fetchTool": { * "name": "fetch_doc", * "urlTransform": { * "regex": "docs\\.example\\.com/([^/]+/[^/]+)/([^/?#]+)", * "params": { "namespace": "$1", "slug": "$2" } * }, * "contentExtract": "data.body" * } * } */ import type { Sample, McpServers } from '../types/index.js'; /** * Load MCP config from a JSON file. * Returns only servers that declare `urlPatterns` + `fetchTool`. * Returns null if file not found or no eligible servers. */ export declare function loadMcpConfig(configPath?: string): McpServers | null; /** * Resolve URLs in samples via MCP servers. * Mutates samples in-place — same contract as url-fetcher's resolveUrls(). */ export declare function resolveMcpUrls(samples: Sample[], mcpServers: McpServers | null): Promise>; /** * Close all active MCP client connections. * Should be called when the evaluation run finishes. */ export declare function stopAllServers(): Promise;