/** * MCP stdio server for pi-exa. * * Exposes the same portable Exa tools that extensions/index.ts registers * with Pi. Tool enablement and API key resolution come from environment * variables (and the shared EXA_CONFIG_FILE shape from config.ts) rather * than Pi CLI flags. Precedence mirrors the Pi-side `isToolEnabledForConfig`: * * 1. EXA_ENABLED_TOOLS env (comma-separated allowlist) — overrides * everything else when set. An EXA_ENABLED_TOOLS string that parses * to an empty allowlist (e.g. ",,,") emits a warning and falls * through to the per-tool toggle defaults. * 2. config file's `enabledTools` array — same allowlist semantics. An * empty array means "no tools enabled" — matching the Pi adapter. * 3. Per-tool env toggles (EXA_ENABLE_ADVANCED, EXA_ENABLE_RESEARCH) and * config file's advancedEnabled / researchEnabled. * 4. Default: 8 tools on (4 cheap Exa + 4 planner), 2 hidden * (web_search_advanced_exa, web_research_exa). * * EXA_CONFIG is accepted as a deprecated alias for EXA_CONFIG_FILE. * * The module is strictly import-passive: it exports createMcpServerOptions * and runServer for callers. Stdio is started exclusively by bin/pi-exa.js, * which imports runServer() and invokes it explicitly. Tests import the * exports directly without any side effects. */ import { type CreateMcpServerOptions } from "@feniix/bridgekit/mcp"; import { type ExaConfig } from "./config.js"; import { type ExaToolTimeouts } from "./tools.js"; export declare function createMcpToolGater(config?: ExaConfig | null): (name: string) => boolean; export declare function createMcpApiKeyResolver(config: ExaConfig | null): () => string | undefined; /** * Build an ExaToolTimeouts object from EXA_TIMEOUT_MS (generic default) and * EXA_RESEARCH_TIMEOUT_MS (web_research_exa override). Returns undefined when * neither var is set or both fail to parse — letting createExaTools fall * through to its built-in per-tool defaults (60s / 180s). */ export declare function createMcpTimeoutsFromEnv(): ExaToolTimeouts | undefined; export declare function createMcpServerOptions(): CreateMcpServerOptions; type RunMcpStdioServer = (options: CreateMcpServerOptions) => Promise; export declare function runServer(runMcpStdioServer?: RunMcpStdioServer): Promise; export {};