Stock Market Tracker

by osamadev

Not rated
GitHub

About

MCP server for advanced financial analysis, stock monitoring, and real-time market intelligence to support buy/sell decisions

Details

Author
osamadev
Categories
Other, Finance

Alert Configuration (config/alerts_config.json)

- Organize stocks by sector, with customizable upper/lower price thresholds and descriptions.
- Example structure:

{ "Tech Giants": { "AAPL": {"above": 200, "below": 180, "description": "Apple Inc."} }, "Financial": { "JPM": {"above": 160, "below": 140, "description": "JPMorgan Chase"} } }

Set these in a.envfile or your system environment:

MCP_TRANSPORT=stdio HOST=0.0.0.0 PORT=8000 LOG_LEVEL=INFO MCP_AUTH_MODE=static # Used when MCP_AUTH_MODE=static MCP_ACCESS_TOKEN=replace_with_strong_secret_for_http # Used when MCP_AUTH_MODE=oauth OAUTH_ISSUER_URL= # Optional additional issuers (space/comma-separated), e.g. sts.windows.net tenant issuer # OAUTH_ISSUER_URLS= # Optional JWKS override (otherwise discovered from issuer metadata) # OAUTH_JWKS_URL= OAUTH_AUDIENCE= OAUTH_REQUIRED_SCOPES=mcp.tools # Optional metadata scopes advertised to clients (use full Entra scope if needed): # OAUTH_SCOPES_SUPPORTED=api://<api-app-id>/mcp.tools MCP_RESOURCE_SERVER_URL= # Optional: built-in OAuth broker for Claude + Entra resource/scope translation # OAUTH_BROKER_ENABLED=false # OAUTH_BROKER_SCOPE=api://<api-app-id>/mcp.tools # OAUTH_BROKER_CLIENT_ID= # OAUTH_BROKER_CLIENT_SECRET= TELEGRAM_BOT_TOKEN=your_bot_token TELEGRAM_USER_ID=your_chat_id SERPAPI_API_KEY=your_serpapi_key # Optional (deploy templates support it; quotes currently use yfinance) # ALPHA_VANTAGE_API_KEY= SUMMARIZER_PROVIDER=ollama OLLAMA_HOST=http://localhost:11434 OLLAMA_MODEL=mistral OPENAI_API_KEY= OPENAI_MODEL=gpt-4o-mini # Optional custom OpenAI-compatible base URL # OPENAI_BASE_URL= # Optional: set true only for local streamable-http tests # ALLOW_UNAUTHENTICATED_HTTP=false # Optional: send Telegram notifications when alerts trigger # ENABLE_TELEGRAM_ALERTS=false # Optional persistent path for portfolio file in cloud # PORTFOLIO_FILE=/data/user_portfolio.json

- static: validates a single bearer token (MCP_ACCESS_TOKEN). LeaveMCP_RESOURCE_SERVER_URLunset so the server does not publish OAuth protected-resource metadata (recommended for Postman and simple Claude bearer setup).
- oauth: validates JWT access tokens from an external OIDC provider usingOAUTH_ISSUER_URL+OAUTH_AUDIENCE(+ optionalOAUTH_JWKS_URL). OptionalOAUTH_ISSUER_URLSallows additional trusted issuers (for examplests.windows.netwhen Entra returns v1 issuer claims). Client ID and client secret belong in theconnector / IdP app, not on this server.
- none: only for local tests withALLOW_UNAUTHENTICATED_HTTP=true.

For Claude OAuth connectors, register an EntraAPI appand a separateclient app, deploy the backend withMCP_AUTH_MODE=oauth, then configure Claude with the client app credentials.

Step-by-step Entra and Claude setup:](https://github.com/osamadev/financial_mcp_server/blob/HEAD/DEPLOY.md)DEPLOY.md— OAuth (Entra ID).

If Claude keeps failing with EntraAADSTS9010010while Postman works with the same token, enable the built-in broker described inDEPLOY.md— OAuth Broker For Claude + Entra.

Example: Claude Desktop MCP Server Configuration

After installing and registering the Financial MCP Server, you can add it to your Claude Desktop configuration. Here is a sampleclaude_desktop_config.jsonsnippet:

{ "mcpServers": { "Financial-MCP-Server": { "command": "uv", "args": [ "run", "--with", "mcp[cli]", "mcp", "run", "server.py" ], "env": { "SERPAPI_API_KEY": "", "TELEGRAM_BOT_TOKEN": "", "TELEGRAM_USER_ID": "", "OPENAI_API_KEY": "" } } } }

- Update theenvsection with your actual API keys and tokens as needed.
- This configuration ensures Claude Desktop can launch and communicate with your Financial MCP Server using the correct environment and command-line arguments.

After installing and connecting your custom Financial MCP Server, all available tools will automatically appear in Claude Desktop's tool menu. You can enable or disable each tool individually, making it easy to access functionalities such as financial context analysis, market summaries, portfolio management, and stock alerts directly from the Claude interface.

Below is a screenshot showing how the tools from your MCP server will be listed and toggled in Claude Desktop:

- Each tool (e.g.,financial_context,market_summary,add_stock, etc.) can be enabled or disabled as needed.
- This seamless integration allows you to interact with your financial analysis server using natural language and tool-based workflows within Claude Desktop.

- Get Live Quotes: Useget_stock_quoteandget_company_overviewfor practical stock checks.
- Track Portfolio: Useadd_stock,remove_stock, andget_portfolioto maintain and value your watchlist.
- Evaluate Alerts: Useset_stock_alertandget_portfolio_alertsfor threshold-based signals.
- Contextual Analysis: Usefinancial_contextto fetch and summarize market context for a query.

- All logs are written tofinancial_mcp.login the project root.
- For debugging, check the log file and ensure your environment variables and configuration files are correct.
- If you encounter issues with Telegram or news fetching, verify your API keys and internet connection.

AI trading memory layer for MT5/forex with 15 MCP tools — store/recall trades, pattern discovery, strategy evolution, and Outcome-Weighted Memory.

EUR settlement for AI agents. USDC/EURC to EUR via SEPA Instant. Trust scoring (KYA 0-100), market data, crypto analytics, AI tools.

Full-lifecycle algorithmic trading: describe strategies in plain English, AI generates code, backtest on real data, deploy live to 10+ brokers. Stocks, options, crypto, futures. Free tier available.

MCP server for cryptocurrency asset prices, exchange rates, and market metadata via Crypto APIs

Free MCP server for real-time cryptocurrency data. 5 tools: get_price, get_market_overview, get_token_info, get_historical_prices, get_trending. 70+ tokens supported via CoinGecko API.

Provides real-time cryptocurrency market data using the CoinGecko API.

Live Stock Market Data, SEC Filings, Stock Screener, and analysis

Crypto research & trading MCP — swaps, earn, perps, Polymarket across major chains.

Financial market intelligence with 12 tools: real-time stock quotes, crypto prices, technical analysis (RSI, MACD, Bollinger Bands), market overview, and portfolio tracking. Zero API keys required.

Institutional-grade orderflow intelligence for AI agents. Detects spoofing, buy-absorption, and liquidity events with a 15-30s lead time over price action. Audited by Manus AI (0.85 confidence)

Azure / Render / GCP Cloud Run host the MCP backend · Cloudflare deploys the optional HTTPS proxy

A custom Model Context Protocol (MCP) server for advanced financial analysis, stock monitoring, and real-time market intelligence. This server provides a suite of tools and API endpoints for portfolio management, market summaries, stock alerts, and contextual financial insights, designed for seamless integration with Claude Desktop and other MCP-compatible clients.

Use the buttons at the top of this page or the full guide inDEPLOY.mdto launch a remote MCP endpoint athttps://<host>/mcp.

- Local default:MCP_TRANSPORT=stdio(Claude Desktop / local MCP clients)
- Cloud default:MCP_TRANSPORT=streamable-http
- Auth modes:MCP_AUTH_MODE=static|oauth|none— OAuth client ID/secret go inClaude, not on the server

- Core Stock Toolkit: Quotes, company overview, and price history tools for practical analysis workflows.
- Portfolio With Live Values: Maintain a watchlist/positions store and return portfolio-level valuation context.
- Configurable Price Alerts: Set per-tickerabove/belowthresholds and evaluate triggered alert events.
- News + Context Layer: Retrieve market news and optional sentiment-rich context summaries for research workflows.
- Secure Streamable HTTP: Static bearer (MCP_ACCESS_TOKEN) or OAuth JWT validation (MCP_AUTH_MODE=oauth) for public deployments.
- Cloud-Ready Deployment: Docker + one-click deploys for Azure Container Apps, Render, Google Cloud Run, and Cloudflare Worker proxy.

- get_stock_quote(ticker: str)

- Returns normalized live quote data (price, change, market cap, volume, exchange, timestamp).

- Returns chart-ready OHLCV history points for backtesting and trend analysis.

- Returns company profile metadata and key valuation fields when available.

- Returns positions/watchlist plus live quote enrichment and portfolio market value summary.

- Add or remove symbols in the persistent portfolio store.

- Configure and evaluate price-threshold alerts from portfolio-backed rules.

- Provide raw financial headlines and optional LLM-ready context summaries.

- Telegram Integration: Sends formatted alerts and summaries to a configured Telegram chat.
- Trading Opportunities: Detects and notifies about actionable trading signals.

- News Summarizer: Uses configurable LLM backends (ollama,openai, orauto) to generate detailed, sentiment-tagged summaries.
- Prompt Builder: Constructs a market-aware prompt for use in downstream LLMs or assistants.

config/ alerts_config.json # Main alert configuration (sector/ticker/thresholds) tech_alerts_config.json # Tech sector-specific alerts services/ alerts.py # Core alert logic tech_alerts.py # Tech sector alert logic telegram_alerts.py # Telegram integration market_summary.py # Market data and news summarizer.py # News summarization (LLM) fetcher.py # Web data fetching context_builder.py # Prompt/context construction intent_parser.py # Financial entity extraction portfolio.py # Portfolio management server.py # MCP server entry point and API definitions requirements.txt # Python dependencies

Alert Configuration (config/alerts_config.json)

- Organize stocks by sector, with customizable upper/lower price thresholds and descriptions.
- Example structure:

{ "Tech Giants": { "AAPL": {"above": 200, "below": 180, "description": "Apple Inc."} }, "Financial": { "JPM": {"above": 160, "below": 140, "description": "JPMorgan Chase"} } }

Set these in a.envfile or your system environment:

MCP_TRANSPORT=stdio HOST=0.0.0.0 PORT=8000 LOG_LEVEL=INFO MCP_AUTH_MODE=static # Used when MCP_AUTH_MODE=static MCP_ACCESS_TOKEN=replace_with_strong_secret_for_http # Used when MCP_AUTH_MODE=oauth OAUTH_ISSUER_URL= # Optional additional issuers (space/comma-separated), e.g. sts.windows.net tenant issuer # OAUTH_ISSUER_URLS= # Optional JWKS override (otherwise discovered from issuer metadata) # OAUTH_JWKS_URL= OAUTH_AUDIENCE= OAUTH_REQUIRED_SCOPES=mcp.tools # Optional metadata scopes advertised to clients (use full Entra scope if needed): # OAUTH_SCOPES_SUPPORTED=api://<api-app-id>/mcp.tools MCP_RESOURCE_SERVER_URL= # Optional: built-in OAuth broker for Claude + Entra resource/scope translation # OAUTH_BROKER_ENABLED=false # OAUTH_BROKER_SCOPE=api://<api-app-id>/mcp.tools # OAUTH_BROKER_CLIENT_ID= # OAUTH_BROKER_CLIENT_SECRET= TELEGRAM_BOT_TOKEN=your_bot_token TELEGRAM_USER_ID=your_chat_id SERPAPI_API_KEY=your_serpapi_key # Optional (deploy templates support it; quotes currently use yfinance) # ALPHA_VANTAGE_API_KEY= SUMMARIZER_PROVIDER=ollama OLLAMA_HOST=http://localhost:11434 OLLAMA_MODEL=mistral OPENAI_API_KEY= OPENAI_MODEL=gpt-4o-mini # Optional custom OpenAI-compatible base URL # OPENAI_BASE_URL= # Optional: set true only for local streamable-http tests # ALLOW_UNAUTHENTICATED_HTTP=false # Optional: send Telegram notifications when alerts trigger # ENABLE_TELEGRAM_ALERTS=false # Optional persistent path for portfolio file in cloud # PORTFOLIO_FILE=/data/user_portfolio.json

- static: validates a single bearer token (MCP_ACCESS_TOKEN). LeaveMCP_RESOURCE_SERVER_URLunset so the server does not publish OAuth protected-resource metadata (recommended for Postman and simple Claude bearer setup).
- oauth: validates JWT access tokens from an external OIDC provider usingOAUTH_ISSUER_URL+OAUTH_AUDIENCE(+ optionalOAUTH_JWKS_URL). OptionalOAUTH_ISSUER_URLSallows additional trusted issuers (for examplests.windows.netwhen Entra returns v1 issuer claims). Client ID and client secret belong in theconnector / IdP app, not on this server.
- none: only for local tests withALLOW_UNAUTHENTICATED_HTTP=true.

For Claude OAuth connectors, register an EntraAPI appand a separateclient app, deploy the backend withMCP_AUTH_MODE=oauth, then configure Claude with the client app credentials.

Step-by-step Entra and Claude setup:DEPLOY.md— OAuth (Entra ID).

If Claude keeps failing with EntraAADSTS9010010while Postman works with the same token, enable the built-in broker described inDEPLOY.md— OAuth Broker For Claude + Entra.

Installation & Running from Claude Desktop

- Python 3.7+
-
Claude Desktop(or any MCP-compatible client)
- Telegram bot credentials (for alerting)
- Internet connection (for market/news data)

git clone <this-repo-url> cd Finance_MCP_Server

Create and Activate a Virtual Environment

python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate

- Create a.envfile in the project root with your API keys and tokens:

TELEGRAM_BOT_TOKEN=your_bot_token TELEGRAM_USER_ID=your_chat_id SERPAPI_API_KEY=your_serpapi_key MCP_AUTH_MODE=static MCP_ACCESS_TOKEN=replace_with_strong_secret_for_http SUMMARIZER_PROVIDER=ollama OLLAMA_HOST=http://localhost:11434 OLLAMA_MODEL=mistral OPENAI_API_KEY= OPENAI_MODEL=gpt-4o-mini

- Modifyconfig/alerts_config.jsonandconfig/tech_alerts_config.jsonto set your stocks, sectors, and thresholds.

- Use the MCP CLI to install and register the server for Claude Desktop:

mcp install server.py --name "Financial MCP Server"

- Start the server using the MCP CLI:

mcp run server.py

- In Claude Desktop, add a new custom MCP server connection.
- Set the executable/command tomcp run server.py(or select the registered "Financial MCP Server" from the MCP CLI list).
- Claude Desktop will communicate with the server using the MCP protocol, enabling all the described tools and endpoints.

Example: Claude Desktop MCP Server Configuration

After installing and registering the Financial MCP Server, you can add it to your Claude Desktop configuration. Here is a sampleclaude_desktop_config.jsonsnippet:

{ "mcpServers": { "Financial-MCP-Server": { "command": "uv", "args": [ "run", "--with", "mcp[cli]", "mcp", "run", "server.py" ], "env": { "SERPAPI_API_KEY": "", "TELEGRAM_BOT_TOKEN": "", "TELEGRAM_USER_ID": "", "OPENAI_API_KEY": "" } } } }

- Update theenvsection with your actual API keys and tokens as needed.
- This configuration ensures Claude Desktop can launch and communicate with your Financial MCP Server using the correct environment and command-line arguments.

After installing and connecting your custom Financial MCP Server, all available tools will automatically appear in Claude Desktop's tool menu. You can enable or disable each tool individually, making it easy to access functionalities such as financial context analysis, market summaries, portfolio management, and stock alerts directly from the Claude interface.

Below is a screenshot showing how the tools from your MCP server will be listed and toggled in Claude Desktop:

- Each tool (e.g.,financial_context,market_summary,add_stock, etc.) can be enabled or disabled as needed.
- This seamless integration allows you to interact with your financial analysis server using natural language and tool-based workflows within Claude Desktop.

- Get Live Quotes: Useget_stock_quoteandget_company_overviewfor practical stock checks.
- Track Portfolio: Useadd_stock,remove_stock, andget_portfolioto maintain and value your watchlist.
- Evaluate Alerts: Useset_stock_alertandget_portfolio_alertsfor threshold-based signals.
- Contextual Analysis: Usefinancial_contextto fetch and summarize market context for a query.

- All logs are written tofinancial_mcp.login the project root.
- For debugging, check the log file and ensure your environment variables and configuration files are correct.
- If you encounter issues with Telegram or news fetching, verify your API keys and internet connection.

AI trading memory layer for MT5/forex with 15 MCP tools — store/recall trades, pattern discovery, strategy evolution, and Outcome-Weighted Memory.

EUR settlement for AI agents. USDC/EURC to EUR via SEPA Instant. Trust scoring (KYA 0-100), market data, crypto analytics, AI tools.

Full-lifecycle algorithmic trading: describe strategies in plain English, AI generates code, backtest on real data, deploy live to 10+ brokers. Stocks, options, crypto, futures. Free tier available.

MCP server for cryptocurrency asset prices, exchange rates, and market metadata via Crypto APIs

Free MCP server for real-time cryptocurrency data. 5 tools: get_price, get_market_overview, get_token_info, get_historical_prices, get_trending. 70+ tokens supported via CoinGecko API.

Provides real-time cryptocurrency market data using the CoinGecko API.

Live Stock Market Data, SEC Filings, Stock Screener, and analysis

Crypto research & trading MCP — swaps, earn, perps, Polymarket across major chains.

Financial market intelligence with 12 tools: real-time stock quotes, crypto prices, technical analysis (RSI, MACD, Bollinger Bands), market overview, and portfolio tracking. Zero API keys required.

Institutional-grade orderflow intelligence for AI agents. Detects spoofing, buy-absorption, and liquidity events with a 15-30s lead time over price action. Audited by Manus AI (0.85 confidence)

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.