StockFlow MCP Server
StockFlow MCP Server
Сервер Model Context Protocol (MCP), предоставляющий данные о акциях в реальном времени и анализ опционов через Yahoo Finance. Позволяет LLM получать доступ к рыночным данным, анализировать акции и оценивать опционные стратегии.
Возможности
Данные по акциям
Цены акций в реальном времени и ключевые показатели
Исторические данные о ценах с значениями OHLC
Фундаментальные показатели компании и финансовая отчетность
Рыночные индикаторы и коэффициенты
Анализ опционов
Полные данные по цепочке опционов
Греки (дельта, гамма, тета, вега)
Отслеживание объема и открытого интереса
Анализ опционных стратегий
Related MCP server: MCP Yahoo Finance
Установка
# Install dependencies
pip install mcp yfinance
# Clone the repository
git clone https://github.com/twolven/stockflow
cd stockflowИспользование
Клонируйте репозиторий:
git clone https://github.com/twolven/mcp-stockflow.git
cd mcp-stockflowУстановите зависимости:
pip install -r requirements.txtДобавьте в конфигурацию Claude: В вашем
claude-desktop-config.jsonдобавьте следующее в разделmcpServers:
{
"mcpServers": {
"stockflow": {
"command": "python",
"args": ["path/to/stockflow.py"]
}
}
}Замените "path/to/stockflow.py" на полный путь к файлу stockflow.py, который вы сохранили.
Подсказка для использования с Claude
При работе с Claude вы можете использовать эту подсказку, чтобы помочь ему понять доступные инструменты:
"Я включил инструменты stockflow, которые дают вам доступ к данным фондового рынка. Вы можете использовать эти три основные функции:
get_stock_data- Получить полную информацию об акциях:
{
"symbol": "AAPL",
"include_financials": true, # optional
"include_analysis": true, # optional
"include_calendar": true # optional
}get_historical_data- Получить историю цен и технические индикаторы:
{
"symbol": "AAPL",
"period": "1y", # 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max
"interval": "1d", # 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo
"prepost": false # optional - include pre/post market data
}get_options_chain- Получить данные по опционам:
{
"symbol": "AAPL",
"expiration_date": "2024-12-20", # optional - uses nearest date if not specified
"include_greeks": true # optional
}Все ответы включают текущие данные о ценах, обработку ошибок и полную рыночную информацию."
Запуск сервера
python stockflow.pyИспользование с MCP-клиентом
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
server_params = StdioServerParameters(
command="python",
args=["stockflow.py"]
)
async def run():
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
# Get current stock data
result = await session.call_tool(
"get-stock-data",
arguments={"symbol": "AAPL"}
)
# Get options chain
options = await session.call_tool(
"get-options-chain",
arguments={
"symbol": "AAPL",
"expiration_date": "2024-12-20"
}
)
if __name__ == "__main__":
import asyncio
asyncio.run(run())Доступные инструменты
get-stock-dataТекущая цена и объем
Рыночная капитализация и коэффициент P/E
Максимум/минимум за 52 недели
get-historical-dataЦены OHLC
Настраиваемые временные периоды
Данные об объеме
get-options-chainКоллы и путы
Цены страйк
Греки и IV
Объем и открытый интерес
Доступные ресурсы
company-info://{symbol}Описание компании
Сектор и отрасль
Количество сотрудников
Веб-сайт
financials://{symbol}Отчет о прибылях и убытках
Балансовый отчет
Отчет о движении денежных средств
Промпты
analyze-optionsАнализ опционных стратегий
Оценка риска/доходности
Оценка рыночных условий
Требования
Python 3.12+
mcp
yfinance
Ограничения
Данные получены из Yahoo Finance и могут иметь задержки
Доступность данных по опционам зависит от торговых часов
Применяются ограничения скорости в зависимости от ограничений API Yahoo Finance
Вклад
Вклад приветствуется! Пожалуйста, не стесняйтесь отправлять Pull Request.
Лицензия
Этот проект лицензирован под лицензией MIT — см. файл LICENSE для подробностей.
Автор
Todd Wolven — ведущий AI-разработчик ПО и инженер GenAI с открытым исходным кодом
Благодарности
Создано с использованием Model Context Protocol (MCP) от Anthropic
Данные предоставлены Yahoo Finance
Разработано для использования с Claude от Anthropic
Available Tools
3 toolsget_historical_data_v2C
Get unadjusted/repaired price history and technical indicators.
Inputs: period (required), symbol (required), prepost, interval. Returns: data, success, provider, warnings, +1 more
get_options_chain_v2B
Get an option chain and optionally add theoretical European Black-Scholes Greeks.
Inputs: symbol (required), include_greeks, expiration_date. Returns: data, success, provider, warnings, +1 more
get_stock_data_v2B
Get stock metadata and optional statements, analysis and calendar data.
Inputs: symbol (required), include_analysis, include_calendar, include_financials. Returns: data, success, provider, warnings, +1 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool targets a clearly distinct data domain: metadata/statements, historical prices/indicators, and options chains. There is no functional overlap between the three tools, so an agent can reliably select the correct one.
All tool names follow the exact same get_<resource>_v2 pattern, with consistent snake_case and a uniform version suffix. This makes the naming scheme highly predictable and easy to navigate.
Three tools is a modest but reasonable scope for a focused stock data server. The count is on the lower end, but each tool covers a substantial area, so it does not feel overly thin.
The main investment data workflows—current company data, historical prices, and options—are all covered. Minor gaps such as ticker search or news endpoints exist, but they are not critical dead ends for typical stock analysis use cases.
Related MCP Connectors
Financial data MCP server for Claude, ChatGPT, Cursor and Codex. Real-time stock quotes, financial statements, options flow, SEC filings, insider trades, 13F holdings, macro data and market news from gloom.sh, the open-source Bloomberg Terminal alternative.
A Model Context Protocol server exposing real-time and historical Colombo Stock Exchange (CSE) data to AI agents and LLM applications. Provides quotes and OHLCV price history, full financial statements (income, balance sheet, cash flow), pre-computed technicals (moving averages, RS ratings, volume signals), macroeconomic indicators, corporate actions, and rule-based screening across CSE stocks and sector indices, everything needed to build CSE-aware trading assistants, research tools, and market-analysis agents. This is the official MCP server of www.ceyloncharts.com
Yahoo Finance for AI agents: quotes, price history, options with Greeks, financials, news, movers.
Real-time Yahoo Finance stock/crypto quotes & options, Google Trends, News & Reddit/HN sentiment.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables LLMs to analyze options chains, calculate Greeks, and evaluate basic options strategies through Yahoo Finance data.141MIT
- AlicenseBqualityBmaintenanceA Model Context Protocol server that enables interaction with Yahoo Finance to retrieve stock pricing, company information, and historical financial data through natural language queries.21888 PyPI29MIT
- AlicenseCqualityNot gradedmaintenanceA Model Context Protocol server that provides tools for interacting with Yahoo Finance, allowing users to retrieve stock prices, company information, and perform financial data comparisons.11MIT
- AlicenseCqualityDmaintenanceA Model Context Protocol server providing comprehensive financial data from Yahoo Finance, allowing users to retrieve detailed stock information, financial statements, options data, and market news.34MIT
Appeared in Searches
- Real-Time Stock Options Data for All NASDAQ Stocks
- Yahoo Finance MCP (Model Context Protocol) Server
- A server for exploring business analysis, market research, and idea validation techniques
- A guide to investing in managed funds and equities
- A platform for live probability option trading with indicators across multiple markets