SuperAPI AI Directory

finance-stream-fetch

Data & analytics

View repository

Updated 10-16 03:42

About this skill

finance-stream-fetch

When the user asks a finance question, execute the current script.

What this skill does

  • Execute a local Node script, and via fetch() initiate a SSE/streaming request, and output the content returned by the server in real time.
  • Send the user's question as --prompt to the Agent interface (message/stream), and extract from the stream agentResult.value to facilitate aggregation of the answer by the upper layer.

One-time configuration

  1. Ensure Node.js 18+ is installed (comes with fetch)。
  2. Configure environment variables (PowerShell example):
$env:FINANCE_STREAM_API_URL="https://YOUR_ENDPOINT_HERE"
$env:FINANCE_STREAM_API_KEY="YOUR_KEY_IF_NEEDED"

API Key lookup rules (referencing the approach of wind-mcp-skill)

The script will look for the Key in the following priority order (as long as one is matched, it will be used):

  • Command-line argument:--api-key <KEY>
  • Environment variable:FINANCE_STREAM_API_KEY
  • Current skill configuration:.cursor/skills/finance-stream-fetch/config.json(JSON:{"finance_stream_api_key":"..."})
  • Global configuration:%USERPROFILE%\.finance-stream-fetch\config(dotenv:FINANCE_STREAM_API_KEY=...)

If the interface does not require authentication, the Key can be left unconfigured (the script will omit the Authorization request header).

Usage (Agent workflow)

When the user asks a finance question:

  1. Directly use the user's question as --prompt。
  2. Execute:
node .cursor/skills/finance-stream-fetch/scripts/stream-fetch.mjs --prompt "<USER_QUESTION>"
  1. After the streaming output ends, organize the answer to the user based on the output content.

Notes

  • If the interface returns SSE (Server-Sent Events), the script will parse the data: line and try to parse it as JSON as much as possible; if parsing fails, it will skip that event and continue.
  • If FINANCE_STREAM_API_KEYis set (or --api-keyis passed), it will send in Authorization: Bearer <key> mode.
  • On Windows PowerShell, it is recommended to wrap the prompt directly in double quotes:
node .cursor/skills/finance-stream-fetch/scripts/stream-fetch.mjs --prompt "分析一下茅台股票情况"