Alpha Vantage API 的 MCP 服务器 (@missionsquad/avantage)
该项目提供了一个模型上下文协议 (MCP) 服务器,它包装了@missionsquad/avantage库,将 Alpha Vantage API 功能公开为语言学习模型 (LLM) 的工具。
概述
该服务器允许 LLM 与 Alpha Vantage API 交互以检索财务数据,包括:
核心股票数据(时间序列、报价、搜索)
基本面数据(公司概况、财务状况、日历)
外汇(FX)数据
加密货币数据
商品数据
经济指标
技术指标
Alpha Intelligence(新闻、情绪等)
期权数据(溢价)
它利用@missionsquad/avantage TypeScript 库并遵循通用 MCP 服务器模板的架构,包括多用户 API 密钥处理和AVantage客户端实例的资源管理。
主要特点:
**全面覆盖:**为
@missionsquad/avantage库中几乎所有可用的功能实现 MCP 工具。**多用户支持:**通过
extraArgs(首选)或回退到环境变量安全地处理 Alpha Vantage API 密钥。**资源管理:**使用
ResourceManager高效管理AVantage客户端实例。**强类型:**使用 TypeScript 构建,利用
@missionsquad/avantage和 Zod 模式的类型作为工具参数。**标准 MCP 接口:**使用
@missionsquad/fastmcp进行 MCP 通信。
入门
先决条件
Node.js v20 或更高版本
npm 或 yarn
Alpha Vantage API 密钥(在此获取)
设置
**克隆或复制:**克隆此存储库或复制文件。
git clone <repository-url> mcp-avantage-server cd mcp-avantage-server安装依赖项:
npm install # or yarn install配置环境:
将
.env.example复制到.env。编辑
.env并将API_KEY设置为您的 Alpha Vantage API 密钥。如果您有高级订阅,则可以选择设置
AV_PREMIUM=true。如果需要,调整
LOG_LEVEL或RESOURCE_CLEANUP_INTERVAL。
构建项目:
npm run build # or yarn build启动服务器:
npm start # or yarn start服务器将在 stdio 上监听 MCP 请求。
验证
服务器使用标准的多用户令牌处理模式:
**
extraArgs.apiKey(推荐):**在 MCPcall_tool请求期间,将用户特定的 Alpha Vantage API 密钥传递到extraArgs对象的apiKey字段中。此密钥不属于工具架构的一部分。**
.env后备:**如果未提供extraArgs.apiKey,服务器将使用.env文件中的API_KEY值。
可用工具
该服务器公开了许多与@missionsquad/avantage库中的方法相对应的工具。这些工具通常以module_method命名(例如coreStock_intraday 、 fundamentalData_companyOverview )。
有关参数和返回结构的详细信息,请参阅Alpha Vantage 文档和@missionsquad/avantage库的类型(库内的src/types/* )。
示例工具调用(概念 MCP 请求):
工具类别(模块):
alphaIntelligence_*commodities_*coreStock_*crypto_*economicIndicators_*forex_*fundamentalData_*optionsData_*(高级版)technicalIndicators_*
使用 MCP list_tools命令获取可用工具的完整列表、其描述和参数模式。
配置
通过.env文件配置:
多变的 | 描述 | 默认 |
| 如果
中没有,则使用后备 Alpha Vantage API 密钥 |
|
| 日志级别(
、
、
、
) |
|
| 清理非活动 AVantage 客户端实例的间隔(毫秒) |
(30米) |
| 设置为
以在
中启用高级端点访问 |
|
项目结构
遵循通用 MCP 服务器模板结构。关键文件:
src/index.ts:主服务器入口点,工具定义。src/config.ts:配置加载。src/logger.ts:日志实用程序。src/resource-manager.ts:管理AVantage实例。src/schemas.ts:工具参数的 Zod 模式。.nexus/:Nexus 文档。
Nexus 文档
执照
MIT(假设模板许可证是 MIT。验证。)
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
模型上下文协议服务器使 LLM 能够访问来自 Alpha Vantage API 的综合财务数据,包括股票价格、基本面、外汇、加密货币和经济指标。
Related MCP Servers
- Asecurity-licenseAqualityThis is an MCP server that provides access to the Alpha Vantage API, allowing stock data retrieval to be used as context to LLMs.Last updated -209
- Asecurity-licenseAqualityA Model Context Protocol (MCP) server that provides real-time access to financial market data through the free Alpha Vantage API. This server implements a standardized interface for retrieving stock quotes and company information.Last updated -77MIT License
- Asecurity-licenseAqualityA Model Context Protocol tool that retrieves daily stock market data for any stock symbol using the Alpha Vantage API.Last updated -702Apache 2.0
- -security-license-qualityA Model Context Protocol server that enables LLMs like Claude to interact with the Alpaca trading API, allowing for trading stocks, checking positions, fetching market data, and managing accounts through natural language.Last updated -3MIT License
Appeared in Searches
- A server for finding scientific articles, creating ad ideas, and deploying Facebook ads
- A platform for live probability option trading with indicators across multiple markets
- A server for obtaining historical cryptocurrency market data
- A tool or service for checking cryptocurrency prices
- A tool for analyzing Indian stock data for investment decisions using LLMs and news insights