摘要
来自 Alpha Vantage 的市场数据:全球交易所的股票报价及日线或日内价格历史、公司基本面和盈利、股息、内部人和机构持股、ETF 概况、期权、指数、外汇、加密货币、大宗商品、美国经济指标、技术指标以及带情绪分数的新闻。只读;免费 API 密钥每天可发 25 次请求。
引导式设置
2 分钟将 Alpha Vantage 连接到 Gemini
开始 AnythingMCP Cloud 免费试用,在引导式设置中连接 Alpha Vantage,再把你的 MCP URL 添加到 Gemini。无需代码,也无需自行运行服务器。
无需信用卡 · 7 天试用 · 提供自托管方案
试试这样问
Alpha Vantage 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Alpha Vantage、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Alpha Vantage + Gemini
来自 Alpha Vantage 的市场数据:全球交易所的股票报价及日线或日内价格历史、公司基本面和盈利、股息、内部人和机构持股、ETF 概况、期权、指数、外汇、加密货币、大宗商品、美国经济指标、技术指标以及带情绪分数的新闻。只读;免费 API 密钥每天可发 25 次请求。
前提条件
完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:
ALPHA_VANTAGE_API_KEY
步骤 1 — 获取凭证
设置大约一分钟。你需要一个 Alpha Vantage API 密钥;免费密钥只需一个邮箱地址。
- 在 https://www.alphavantage.co/support/#api-key 领取免费密钥。
- 把它粘贴到
ALPHA_VANTAGE_API_KEY。它作为查询参数apikey发送。 - 安装连接器并运行
alpha_vantage_get_market_status:它会显示当前开市的股票、外汇和加密货币市场,同时确认密钥有效。
套餐:免费密钥每天允许 25 次请求。高级套餐(https://www.alphavantage.co/premium/)将其提高到每分钟 75 次或更多,并解锁美国实时数据、日内历史、复权日线、期权和批量报价。由于每天只有 25 次调用,AI 会挑选能回答问题的那一个工具,而不是逐个尝试。
代码:美国代码直接写(IBM);其他交易所带后缀,例如 TSCO.LON、SAP.DEX、RELIANCE.BSE 或 SHOP.TRT。不确定准确代码时,AI 会先用 alpha_vantage_search_symbols 查找。
可读取的内容:
- 价格:股票或 ETF 的最新报价,一次最多 100 个美国代码的实时报价(高级),20 多年的日、周、月历史(不复权或按拆股和分红复权),以及美国股票 1 到 60 分钟的日内 K 线。全球市场开闭状态,以及当日美国涨幅、跌幅和成交最活跃的前 20 个代码。
- 公司分析:包含行业、估值比率、利润率和分析师目标价的概览;年度和季度利润表、资产负债表和现金流量表;含超预期幅度的每股收益;分析师的 EPS 和收入预测;流通股数;股息和拆股;内部人交易;机构持股;2010Q1 以来的财报电话会议记录。
- 基金和指数:含持仓和行业配置的 ETF 概况,以及
SPX、NDX、VIX等 200 多个市场指数的历史。 - 期权(高级):带希腊值和隐含波动率的美国实时期权链,或 2008 年以来某个历史交易日的期权链。
- 新闻:关于代码或主题的文章,附整体情绪和每个代码的情绪。
- 货币和加密货币:任意法币或加密货币对的汇率,以及日、周、月历史(日内需高级套餐)。
- 宏观:美国实际 GDP、国债收益率、联邦基金利率、CPI、通胀、失业率、非农就业、零售销售和耐用品订单;WTI、布伦特、天然气、铜、小麦和咖啡等大宗商品;黄金和白银的现货价格及历史。
- 50 多种技术指标,例如 SMA、EMA、RSI、MACD、布林带、ADX 或 ATR。
数据格式:数字以字符串返回,常带编号键,例如 "05. price"。时间序列是以日期(YYYY-MM-DD)或时间戳为键的对象,从新到旧排列;日内时间戳为美国东部时间。基本面数据使用报告货币(reportedCurrency)的完整单位,"None" 表示未披露。日线数据为收盘数据,除非设置了高级 entitlement。情绪分数从 -1(看跌)到 1(看涨)。
数据量,无分页:每次调用一次返回完整结果。outputsize 为 compact(此处的默认值)时返回最近 100 个数据点;full 最多可返回 20 年。技术指标总是覆盖该周期的全部历史,所以做长期分析时 AI 使用周线或月线。查询期权时会设置 expiration,让期权链保持精简。
只读:所有工具都只读取,因此无需确认任何操作,安装时也没有关闭的工具。
常见错误:Alpha Vantage 即使出错也返回 HTTP 200;连接器会把这些响应转换为失败的调用。频率限制提示表示每日配额(免费密钥 25 次)或每分钟配额已用完,或调用快于大约每秒一次:请等待或升级套餐。高级套餐提示表示该功能或选项需要付费套餐;免费密钥调用批量报价只会返回示例数据并失败。"Invalid API call" 表示代码或参数错误。401 表示密钥被拒绝。
连接器不使用仅提供 CSV 的端点(上市状态、财报日历、IPO 日历),也不使用高级分析端点。Alpha Vantage 还在 https://mcp.alphavantage.co 运营官方 MCP 服务器。
步骤 2 — 安装 adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
步骤 3 — 在 Gemini 中添加连接器
你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(
https://cloud.anythingmcp.com/mcp/…)。本指南中出现YOUR_SERVER_ID的地方都用它替换。
Gemini CLI 从 ~/.gemini/settings.json(Windows 上为 %USERPROFILE%\.gemini\settings.json)读取 MCP 服务器。添加:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- 在 AnythingMCP 的 MCP Servers → 你的服务器 → API keys 中创建 MCP API 密钥,并用它替换
YOUR_MCP_API_KEY。 - 保存文件并重启
gemini。 - 在 Gemini CLI 中运行
/mcp(或在终端运行gemini mcp list),anythingmcp应显示为已连接。 - 开始输入提示,Gemini CLI 现在可以调用
Alpha Vantage的工具。
可用工具
| Tool | What it does |
|---|---|
alpha_vantage_get_quote | Get the latest quote of one stock or ETF (GLOBAL_QUOTE): price, open, high, low, volume, latest trading day, previous close, change and… |
alpha_vantage_get_bulk_quotes | Get realtime quotes for up to 100 US symbols in one call (REALTIME_BULK_QUOTES), including extended hours |
alpha_vantage_get_time_series | Get the daily, weekly or monthly price history (open, high, low, close, volume) of a stock or ETF, raw or adjusted for splits and dividends… |
alpha_vantage_get_intraday | Get intraday price bars (open, high, low, close, volume) of a US stock at 1 to 60 minute intervals, for the latest days or a given month in… |
alpha_vantage_search_symbols | Find ticker symbols by company name or partial symbol (SYMBOL_SEARCH): symbol, name, type, region, market hours, time zone, currency and… |
alpha_vantage_get_market_status | Get whether the major stock, forex and crypto markets worldwide are open or closed right now, with their local opening and closing times |
alpha_vantage_get_top_movers | Get the top 20 gainers, top 20 losers and 20 most actively traded US tickers of the latest trading day, with price, change and volume |
alpha_vantage_get_news_sentiment | Get market news with AI sentiment scores (NEWS_SENTIMENT): articles from major outlets about given tickers (stocks, crypto CRYPTO:BTC… |
alpha_vantage_get_company_overview | Get the profile and key metrics of a company (OVERVIEW): description, exchange, sector, industry, market capitalisation, EBITDA, P/E, PEG… |
alpha_vantage_get_etf_profile | Get an ETF profile and holdings (ETF_PROFILE): net assets, expense ratio, turnover, dividend yield, inception date, leverage, sector… |
alpha_vantage_get_income_statement | Get the annual and quarterly income statements (revenue, cost of revenue, gross profit, operating income, EBIT, EBITDA, interest, taxes… |
alpha_vantage_get_balance_sheet | Get the annual and quarterly balance sheets (assets, current assets, cash, inventory, liabilities, debt, shareholder equity, shares… |
alpha_vantage_get_cash_flow | Get the annual and quarterly cash flow statements (operating cash flow, capital expenditures, dividends paid, buybacks, financing and… |
alpha_vantage_get_earnings | Get a company's annual and quarterly earnings per share (EARNINGS): reported EPS, estimated EPS, surprise and surprise percent, report date… |
alpha_vantage_get_earnings_estimates | Get analyst EPS and revenue estimates for upcoming fiscal quarters and years (EARNINGS_ESTIMATES): average, high and low estimates, number… |
alpha_vantage_get_corporate_actions | Get the dividend history and declared future dividends (DIVIDENDS: ex-dividend, declaration, record and payment dates and amount) or the… |
alpha_vantage_get_shares_outstanding | Get the quarterly number of basic and diluted shares outstanding of a company (SHARES_OUTSTANDING) |
alpha_vantage_get_insider_transactions | Get insider transactions of a company's executives, directors and major holders (INSIDER_TRANSACTIONS): date, insider name and title… |
alpha_vantage_get_institutional_holdings | Get the institutional ownership of a stock (INSTITUTIONAL_HOLDINGS): the funds and institutions holding it, with shares held, value and… |
alpha_vantage_get_earnings_call_transcript | Get the transcript of a company's earnings call for one fiscal quarter (EARNINGS_CALL_TRANSCRIPT), turn by turn with speaker, title and a… |
alpha_vantage_get_options | Get a US option chain (premium): REALTIME_OPTIONS for the live chain with optional greeks and implied volatility, or HISTORICAL_OPTIONS for… |
alpha_vantage_get_index_data | Get the daily, weekly or monthly open, high, low and close history of a market index (INDEX_DATA), e.g |
alpha_vantage_list_indices | List the market index symbols supported by alpha_vantage_get_index_data with their full names (INDEX_CATALOG) |
alpha_vantage_get_exchange_rate | Get the realtime exchange rate between two currencies, physical or crypto (CURRENCY_EXCHANGE_RATE): rate, bid, ask and last refresh time… |
alpha_vantage_get_fx_time_series | Get the price history (open, high, low, close) of a currency pair: FX_DAILY, FX_WEEKLY, FX_MONTHLY, or FX_INTRADAY bars (premium) |
alpha_vantage_get_crypto_time_series | Get the price and volume history of a cryptocurrency in a market currency: DIGITAL_CURRENCY_DAILY, DIGITAL_CURRENCY_WEEKLY… |
alpha_vantage_get_commodity | Get the price history of a commodity: crude oil WTI and Brent, natural gas (daily, weekly or monthly), copper, aluminum, wheat, corn… |
alpha_vantage_get_precious_metals | Get the live spot price of gold or silver (GOLD_SILVER_SPOT) or their daily, weekly or monthly price history (GOLD_SILVER_HISTORY) |
alpha_vantage_get_economic_indicator | Get a US economic indicator series: real GDP and GDP per capita, treasury yields by maturity, federal funds rate, CPI, inflation, retail… |
alpha_vantage_get_technical_indicator | Compute a technical indicator over a stock's price history: moving averages (SMA, EMA, WMA, DEMA, TEMA, KAMA, MAMA, T3, VWAP), momentum and… |
示例提示
- “Apple 现在股价多少?今天涨跌了多少?”
- “比较 Microsoft 和 Alphabet 过去四个财年的收入、营业利润和自由现金流。”
- “显示 SAP 在 XETRA 最近 100 个交易日的每日收盘价。”
- “关于 NVIDIA 的最新新闻情绪如何?哪些文章最看涨?”
- “过去两年美国 10 年期国债收益率和 CPI 通胀是如何变化的?”
FAQ
Gemini CLI 从哪里读取 MCP 服务器? 用户级配置位于 ~/.gemini/settings.json,项目级配置位于项目内的 .gemini/settings.json。gemini mcp list 会列出每个服务器及其连接状态。
下一步
这份指南对你有帮助吗?