home / mcp / financial data mcp server
Provides real-time stock data, portfolio management, and automated trading analysis via MCP.
Configuration
View docs{
"mcpServers": {
"j1c4b-finance_mcp_server": {
"command": "python3",
"args": [
"financial_mcp_server.py"
]
}
}
}You can use this Financial Data MCP Server to access real-time stock data, manage multiple portfolios, run technical analysis, generate automated trading signals, and receive email reports. It integrates smoothly with MCP clients to provide practical financial insights and actionable recommendations.
You interact with the MCP server from an MCP client to load portfolios, run analyses, and view trading signals. Start the server locally, then connect your client to the available tools to load portfolios, fetch stock data, generate MACD charts, and receive performance metrics.
Typical workflow: - Load your portfolio data - Request a detailed analysis for a portfolio - Generate MACD charts and EMA-based signals - Retrieve performance metrics over time - Optionally receive email reports with attached charts and summaries
# prerequisites
# - Python 3.8+
# - pip available in your environment
# 1. Clone the project repository
git clone https://github.com/j1c4b/finance_mcp_server.git
cd finance_mcp_server
# 2. Create and activate a virtual environment
python3 -m venv mcp_fin_server_venv
source mcp_fin_server_venv/bin/activate # On Windows: mcp_fin_server_venv\Scripts\activate
# 3. Install dependencies
pip install -r clean_requirements.txt
# 4. Run the main MCP server (in another terminal, if needed)
python3 financial_mcp_server.pyYou can configure portfolios and email reports to tailor the server to your needs. The following configuration options are used by the server components.
{
"portfolio": {
"tech_stocks": {
"portfolio": "Technology Giants",
"stock_list": ["AAPL", "GOOGL", "MSFT", "AMZN", "META"]
},
"dividend_portfolio": {
"portfolio": "Dividend Champions",
"stock_list": ["JNJ", "PG", "KO", "PEP", "MMM"]
}
}
}You can access the following MCP tools to load data, analyze portfolios, and fetch stock information.
Ensure your environment has appropriate access controls for any email reports and sensitive portfolio data. Use secure methods to store credentials and rotate access tokens or passwords as needed.
If the server does not start as expected, verify that Python 3.8+ is installed, the virtual environment is activated, and dependencies are installed. Check for common issues such as missing packages or port conflicts and review the console output for any error messages.
This server relies on the free Yahoo Finance data source via yfinance, so data availability may vary by symbol and market. Email reports require proper SMTP configuration if you intend to send automated summaries.
Load portfolio data from portfolio.json to initialize analysis and tracking.
Perform a detailed analysis of a selected portfolio, including EMA and MACD calculations, trend detection, and signal generation.
Provide performance metrics over time for one or more portfolios, including success rates of signals.
Fetch comprehensive information about a specific stock, including price, fundamentals, and recent movements.
Return upcoming earnings announcements for tracked stocks.
Show recent analyst upgrades and downgrades for holdings in your portfolios.
Create MACD charts for selected symbols to visualize momentum and trend strength.
Provide status of major market indices and key market indicators.