财务分析投资助手
STDIO提供实时金融市场分析的MCP服务器
提供实时金融市场分析的MCP服务器
The investor-agent is a Model Context Protocol (MCP) server that provides comprehensive financial insights and analysis to Large Language Models. It leverages real-time market data, fundamental and technical analysis to help users obtain:
The server integrates with yfinance for market data retrieval and fetches Fear & Greed data from CNN. It automatically caches yfinance
API responses for an hour in a local yfinance.cache
file to improve performance and reduce redundant API calls.
Combine this with an MCP server for placing trades on a brokerage platform such as tasty-agent to place trades on tastytrade platform. Make sure to also enable web search functionality if you would like to incoporate latest news in your analysis.
Python: 3.12 or higher
Package Manager: uv. Install if you haven't:
curl -LsSf https://astral.sh/uv/install.sh | sh
calculate_technical_indicator
tool. Follow the official installation instructions for your operating system.The easiest way to run the agent is using uvx
, which fetches and runs the package without installing it globally or in a specific environment:
# Run with core features only uvx investor-agent
If you need the calculate_technical_indicator
tool (and have the prerequisite TA-Lib C Library installed), you can include the optional dependencies:
# Run with technical indicator features included uvx "investor-agent[ta]"
Note: Using uvx "package[extra]"
requires a recent version of uv
(0.7.0 or later).
Note: Using uvx
with [ta]
requires the TA-Lib C library to be properly installed and discoverable on your system beforehand.
The investor-agent server comes with several tools to support financial analysis:
get_ticker_data
ticker
(string): Stock ticker symbol (e.g., "AAPL"
).get_options
ticker_symbol
(string): Stock ticker symbol.num_options
(int, optional): Number of options to return (default: 10).start_date
& end_date
(string, optional): Date range in YYYY-MM-DD
format.strike_lower
& strike_upper
(float, optional): Desired strike price range.option_type
(string, optional): Option type ("C"
for calls, "P"
for puts).get_price_history
ticker
(string): Stock ticker symbol.period
(string): Time period (choose from "1d"
, "5d"
, "1mo"
, "3mo"
, "6mo"
, "1y"
, "2y"
, "5y"
, "10y"
, "ytd"
, "max"
).get_financial_statements
ticker
(string): Stock ticker symbol.statement_type
(string): "income"
, "balance"
, or "cash"
.frequency
(string): "quarterly"
or "annual"
.get_institutional_holders
ticker
(string): Stock ticker symbol.get_earnings_history
ticker
(string): Stock ticker symbol.get_insider_trades
ticker
(string): Stock ticker symbol.get_current_fng_tool
get_historical_fng_tool
days
(int): Number of days of historical data to retrieve.analyze_fng_trend
days
(int): Number of days to include in the trend analysis.calculate_technical_indicator
ta
installation.ticker
(string): Stock ticker symbol (e.g., "AAPL"
).indicator
(string): The indicator to calculate. Choose from "SMA"
, "EMA"
, "RSI"
, "MACD"
, "BBANDS"
.period
(string, optional): Historical data period (e.g., "1y"
, default: "1y"
). Choose from "1mo"
, "3mo"
, "6mo"
, "1y"
, "2y"
, "5y"
.timeperiod
(int, optional): Lookback period for SMA, EMA, RSI, BBANDS (default: 14).fastperiod
(int, optional): Fast EMA period for MACD (default: 12).slowperiod
(int, optional): Slow EMA period for MACD (default: 26).signalperiod
(int, optional): Signal line EMA period for MACD (default: 9).nbdevup
(int, optional): Upper standard deviation multiplier for BBANDS (default: 2).nbdevdn
(int, optional): Lower standard deviation multiplier for BBANDS (default: 2).matype
(int, optional): Moving average type for BBANDS (default: 0 for SMA). See TA-Lib docs.num_results
(int, optional): Number of recent results to display (default: 10).investment_principles
portfolio_construction_prompt
To integrate investor-agent with an MCP client (for example, Claude Desktop), add the following configuration to your claude_desktop_config.json
:
{ "mcpServers": { "investor": { "command": "path/to/uvx/command/uvx", "args": ["investor-agent"], } } }
You can leverage the MCP inspector to debug the server:
npx @modelcontextprotocol/inspector uvx investor-agent
For log monitoring, check the following directories:
~/Library/Logs/Claude/mcp*.log
%APPDATA%\Claude\logs\mcp*.log
This MCP server is licensed under the MIT License. See the LICENSE file for details.