此MCP服务器提供了访问Alpha Vantage金融数据的功能。它包括获取OHLCV数据、股息数据和ETF持仓数据的工具。
获取特定股票代码在给定日期的OHLCV数据(开盘价、最高价、最低价、收盘价、成交量)。
输入:
{
"ticker": "AAPL",
"infoType": "close",
"date": "2024-01-02"
}
示例用法:
获取AAPL在2024年1月2日的收盘价:
mcp call alpha_vantage get_ticker_ohlcv '{"ticker": "AAPL", "infoType": "close", "date": "2024-01-02"}'
获取特定股票代码的股息数据。
输入:
{
"ticker": "AAPL"
}
示例用法:
获取AAPL的股息数据:
mcp call alpha_vantage get_ticker_dividend '{"ticker": "AAPL"}'
获取特定ETF的持仓数据。
输入:
{
"ticker": "SPY"
}
示例用法:
获取SPY的持仓数据:
mcp call alpha_vantage get_etf_holdings '{"ticker": "SPY"}'
获取两种货币之间的汇率(法定货币或加密货币)。
输入:
{
"fromCurrency": "USD",
"toCurrency": "EUR"
}
示例用法:
获取从USD到EUR的汇率:
mcp call alpha_vantage get_exchange_rate '{"fromCurrency": "USD", "toCurrency": "EUR"}'
获取特定股票代码的期权数据。
输入:
{
"ticker": "AAPL"
}
示例用法:
获取AAPL的期权数据:
mcp call alpha_vantage get_ticker_options '{"ticker": "AAPL"}'
该服务器需要在环境变量ALPHAVANTAGE_API_KEY中设置Alpha Vantage API密钥。
要配置MCP服务器,请在您的MCP设置中添加以下内容:
{
"mcpServers": {
"github.com/septemhill/alpha_vantage_mcp": {
"command": "npx",
"args": [
"-y",
"alpha_vantage_finance"
],
"env": {
"ALPHAVANTAGE_API_KEY": "YOUR_API_KEY"
}
}
}
}
将YOUR_API_KEY替换为您自己的Alpha Vantage API密钥。