Stocks MCP Server
Provides real-time access to financial market data including stock quotes, company information, cryptocurrency exchange rates, historical options chains, and time series data through the Alpha Vantage API.
README
Stocks MCP Server
A 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.
Features
- Real-time stock quotes with price, volume, and change data
- Detailed company information including sector, industry, and market cap
- Real-time cryptocurrency exchange rates with bid/ask prices
- Daily, weekly, and monthly cryptocurrency time series data
- Historical options chain data with advanced filtering and sorting
- Built-in error handling and rate limit management
Installation
Using Claude Desktop
-
Clone the repository and build a local image to be utilized by your Claude desktop client
-
Change your
claude_desktop_config.jsonto match the following, replacingREPLACE_API_KEYwith your actual key:
claude_desktop_config.jsonpath
- On MacOS:
~/Library/Application\ Support/Claude/claude_desktop_config.json- On Windows:
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"alphavantage": {
"command": "python",
"args": [
"-m",
"alpha_vantage_mcp.server",
"run",
"server.py"
],
"env": {
"ALPHA_VANTAGE_API_KEY": "insert_your_alpha_api_key",
"PYTHONPATH": "Path to the server.py"
}
}
}
}
</details>
Install packages
uv add -r requiremets.txt .
Running
After connecting Claude client with the MCP tool via json file and installing the packages, Claude should see the server's mcp tools:
You can run the sever yourself via: In alpha-vantage-mcp repo:
uv run src/alpha_vantage_mcp/server.py
Available Tools
The server implements eight tools:
get-stock-quote: Get the latest stock quote for a specific companyget-company-info: Get stock-related information for a specific companyget-time-series: Get historical daily price data for a stockget-historical-options: Get historical options chain data with sorting capabilitiesget-crypto-exchange-rate: Get current cryptocurrency exchange ratesget-crypto-daily: Get daily time series data for a cryptocurrencyget-crypto-weekly: Get weekly time series data for a cryptocurrencyget-crypto-monthly: Get monthly time series data for a cryptocurrency
get-stock-quote
Input Schema:
{
"symbol": {
"type": "string",
"description": "Stock symbol (e.g., AAPL, MSFT)"
}
}
Example Response:
Stock quote for AAPL:
Price: $198.50
Change: $2.50 (+1.25%)
Volume: 58942301
High: $199.62
Low: $197.20
get-company-info
Retrieves detailed company information for a given symbol.
Input Schema:
{
"symbol": {
"type": "string",
"description": "Stock symbol (e.g., AAPL, MSFT)"
}
}
Example Response:
Company information for AAPL:
Name: Apple Inc
Sector: Technology
Industry: Consumer Electronics
Market Cap: $3000000000000
Description: Apple Inc. designs, manufactures, and markets smartphones...
Exchange: NASDAQ
Currency: USD
get-crypto-exchange-rate
Retrieves real-time cryptocurrency exchange rates with additional market data.
Input Schema:
{
"crypto_symbol": {
"type": "string",
"description": "Cryptocurrency symbol (e.g., BTC, ETH)"
},
"market": {
"type": "string",
"description": "Market currency (e.g., USD, EUR)",
"default": "USD"
}
}
Example Response:
Cryptocurrency exchange rate for BTC/USD:
From: Bitcoin (BTC)
To: United States Dollar (USD)
Exchange Rate: 43521.45000
Last Updated: 2024-12-17 19:45:00 UTC
Bid Price: 43521.00000
Ask Price: 43522.00000
get-time-series
Retrieves daily time series (OHLCV) data.
Input Schema:
{
"symbol": {
"type": "string",
"description": "Stock symbol (e.g., AAPL, MSFT)"
},
"outputsize": {
"type": "string",
"description": "compact (latest 100 data points) or full (up to 20 years of data)",
"default": "compact"
}
}
Example Response:
Time Series Data for AAPL (Last Refreshed: 2024-12-17 16:00:00):
Date: 2024-12-16
Open: $195.09
High: $197.68
Low: $194.83
Close: $197.57
Volume: 55,751,011
get-historical-options
Retrieves historical options chain data with advanced sorting and filtering capabilities.
Input Schema:
{
"symbol": {
"type": "string",
"description": "Stock symbol (e.g., AAPL, MSFT)"
},
"date": {
"type": "string",
"description": "Optional: Trading date in YYYY-MM-DD format (defaults to previous trading day, must be after 2008-01-01)",
"pattern": "^20[0-9]{2}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])$"
},
"limit": {
"type": "integer",
"description": "Optional: Number of contracts to return (default: 10, use -1 for all contracts)",
"default": 10,
"minimum": -1
},
"sort_by": {
"type": "string",
"description": "Optional: Field to sort by",
"enum": ["strike", "expiration", "volume", "open_interest", "implied_volatility", "delta", "gamma", "theta", "vega", "rho", "last", "bid", "ask"],
"default": "strike"
},
"sort_order": {
"type": "string",
"description": "Optional: Sort order",
"enum": ["asc", "desc"],
"default": "asc"
}
}
Example Response:
Historical Options Data for AAPL (2024-02-20):
Contract 1:
Strike: $190.00
Expiration: 2024-03-15
Last: $8.45
Bid: $8.40
Ask: $8.50
Volume: 1245
Open Interest: 4567
Implied Volatility: 0.25
Greeks:
Delta: 0.65
Gamma: 0.04
Theta: -0.15
Vega: 0.30
Rho: 0.25
Contract 2:
...
get-crypto-daily
Retrieves daily time series data for a cryptocurrency.
Input Schema:
{
"symbol": {
"type": "string",
"description": "Cryptocurrency symbol (e.g., BTC, ETH)"
},
"market": {
"type": "string",
"description": "Market currency (e.g., USD, EUR)",
"default": "USD"
}
}
Example Response:
Daily cryptocurrency time series for SOL in USD:
Daily Time Series for Solana (SOL)
Market: United States Dollar (USD)
Last Refreshed: 2025-04-17 00:00:00 UTC
Date: 2025-04-17
Open: 131.31000000 USD
High: 131.67000000 USD
Low: 130.74000000 USD
Close: 131.15000000 USD
Volume: 39652.22195178
---
Date: 2025-04-16
Open: 126.10000000 USD
High: 133.91000000 USD
Low: 123.46000000 USD
Close: 131.32000000 USD
Volume: 1764240.04195810
---
get-crypto-weekly
Retrieves weekly time series data for a cryptocurrency.
Input Schema:
{
"symbol": {
"type": "string",
"description": "Cryptocurrency symbol (e.g., BTC, ETH)"
},
"market": {
"type": "string",
"description": "Market currency (e.g., USD, EUR)",
"default": "USD"
}
}
Example Response:
Weekly cryptocurrency time series for SOL in USD:
Weekly Time Series for Solana (SOL)
Market: United States Dollar (USD)
Last Refreshed: 2025-04-17 00:00:00 UTC
Date: 2025-04-17
Open: 128.32000000 USD
High: 136.00000000 USD
Low: 123.46000000 USD
Close: 131.15000000 USD
Volume: 4823091.05667581
---
Date: 2025-04-13
Open: 105.81000000 USD
High: 134.11000000 USD
Low: 95.16000000 USD
Close: 128.32000000 USD
Volume: 18015328.38860037
---
get-crypto-monthly
Retrieves monthly time series data for a cryptocurrency.
Input Schema:
{
"symbol": {
"type": "string",
"description": "Cryptocurrency symbol (e.g., BTC, ETH)"
},
"market": {
"type": "string",
"description": "Market currency (e.g., USD, EUR)",
"default": "USD"
}
}
Example Response:
Monthly cryptocurrency time series for SOL in USD:
Monthly Time Series for Solana (SOL)
Market: United States Dollar (USD)
Last Refreshed: 2025-04-17 00:00:00 UTC
Date: 2025-04-17
Open: 124.51000000 USD
High: 136.18000000 USD
Low: 95.16000000 USD
Close: 131.15000000 USD
Volume: 34268628.85976021
---
Date: 2025-03-31
Open: 148.09000000 USD
High: 180.00000000 USD
Low: 112.00000000 USD
Close: 124.54000000 USD
Volume: 42360395.75443056
---
requirements
- Python 3.12 or higher
- httpx
- mcp
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。