loading…
Search for a command to run...
loading…
Enables fetching stock quotes, historical prices as CSV, and plain-text Unicode price charts via Yahoo Finance data.
Enables fetching stock quotes, historical prices as CSV, and plain-text Unicode price charts via Yahoo Finance data.
A small Model Context Protocol server built with FastMCP. It exposes Yahoo Finance market data (via yfinance) so assistants can fetch quotes, history as CSV, and plain-text Unicode price charts.
pyproject.tomlcd mcp-stock-server
uv sync
The server speaks MCP over stdio (the default for mcp.run()):
uv run python server.py
~/.cursor/mcp.json on macOS/Linux).server.py.uv run (recommended)Replace /absolute/path/to/mcp-stock-server with the real path where you cloned the repo.
{
"mcpServers": {
"FinanceExpert": {
"command": "uv",
"args": ["run", "python", "server.py"],
"cwd": "/absolute/path/to/mcp-stock-server"
}
}
}
After uv sync, this uses the locked dependencies from uv.lock.
Use this if you prefer not to invoke uv from the MCP client:
{
"mcpServers": {
"FinanceExpert": {
"command": "/absolute/path/to/mcp-stock-server/.venv/bin/python",
"args": ["server.py"],
"cwd": "/absolute/path/to/mcp-stock-server"
}
}
}
Create the venv first (from the repo root): uv sync (installs deps into .venv).
get_stock_analysis, get_historical_prices, and get_stock_price_chart.Other MCP clients (e.g. Claude Code, editors with MCP support) use the same idea: command + args + cwd for a stdio server.
| Tool | Description |
|---|---|
get_stock_analysis |
Snapshot text: current price, 50-day average, analyst recommendation key (from Ticker.info). |
get_historical_prices |
Daily close column as CSV for a lookback of days calendar days (period=f"{days}d"). Default days=30. |
get_stock_price_chart |
Box-drawn ASCII/Unicode chart: area fill, price axis, start/end dates on the time axis, and an 8-step sparkline. |
get_stock_price_chart parametersticker — Symbol, e.g. INTU, AAPL.days — Used when period is omitted: Yahoo range Nd (calendar days). Default 30.period — Optional Yahoo period string; when set, it overrides days. Examples: 10y, 5y, 1y, 6mo, ytd, max.Examples:
days=30period="10y"Market data comes from Yahoo through yfinance; semantics match yfinance history(period=...).
Quotes and history are informational only, not investment advice. Yahoo data can lag or contain errors; verify independently for decisions.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"financeexpert": {
"command": "npx",
"args": []
}
}
}