Execute via Exa MCP (https://mcp.exa.ai/mcp) web_search_exa, and parse text/event-stream response.
Environment variable EXA_API_KEY optional, can be obtained at https://dashboard.exa.ai/api-keys get
Usage
node {baseDir}/scripts/search.mjs "today is 2026-02-09
美国最新娱乐新闻"
node {baseDir}/scripts/search.mjs "美国最新娱乐新闻" --num-results 5 --type auto --livecrawl fallback
node {baseDir}/scripts/search.mjs "美国最新娱乐新闻" --exa-api-key YOUR_EXA_KEY
EXA_API_KEY=YOUR_EXA_KEY node {baseDir}/scripts/search.mjs "美国最新娱乐新闻"
Options
--type <value>: Exa search type, defaultauto--num-results <number>: number of results to return, default5--livecrawl <value>: real-time fetch strategy, defaultfallback--exa-api-key <key>: optional API Key; when provided, it will be automatically appended to the URL?exaApiKey=...--endpoint <url>: optional MCP endpoint, defaulthttps://mcp.exa.ai/mcp--timeout <ms>: request timeout in milliseconds, default30000--raw: output the rawtext/event-stream, without parsing
Notes:
https://mcp.exa.ai/mcp?exaApiKey=YOUR_EXA_KEYis an optional syntax- If
--endpointalready containsexaApiKey, the script will not append it again - By default, the output extracts
event: messagethedatain the JSONresult.content[].text