finwatch-mcp

finwatch-mcp

Enables natural language portfolio monitoring, risk analysis, and compliance checking with tools for real-time portfolio status, risk metrics, anomaly detection, SEC filings search, market KPIs, and compliance validation.

Category
Visit Server

README

πŸ“Š finwatch-mcp

A custom MCP Server for financial portfolio monitoring, risk analysis, and compliance β€” powered by LangGraph + Claude.

Turn natural language into actionable financial intelligence. Ask your portfolio questions like "What's my risk exposure to tech stocks?" or "Flag any anomalous movements in the last 24h" and get data-driven answers in seconds.

Python 3.11+ MCP Protocol LangGraph License: MIT


Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   CLIENT LAYER                          β”‚
β”‚   Claude Desktop  β”‚  Gradio UI  β”‚  CLI  β”‚  Telegram     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ MCP Protocol (JSON-RPC)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              LANGGRAPH AGENT (Orchestrator)              β”‚
β”‚  Multi-step reasoning Β· Report generation Β· Triage      β”‚
β”‚  Claude API Β· StateGraph Β· Human-in-the-loop            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ MCP Tool Calls
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              FINWATCH MCP SERVER                        β”‚
β”‚                                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ get_portfolio β”‚ β”‚ analyze_risk β”‚ β”‚ detect_anomaly β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚search_filingsβ”‚ β”‚get_market_kpiβ”‚ β”‚compliance_checkβ”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    DATA LAYER                            β”‚
β”‚  SQLite (prices, KPIs)  β”‚  ChromaDB (SEC filings, RAG)  β”‚
β”‚  Alpha Vantage Β· Finnhub Β· FRED Β· SEC EDGAR             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Features

MCP Server Tools

Tool Description
get_portfolio Real-time portfolio status: holdings, P&L, sector allocation
analyze_risk Risk metrics: VaR, Sharpe ratio, Beta, max drawdown
detect_anomaly Flag unusual price movements, volume spikes, correlation breaks
search_filings RAG-powered semantic search over SEC filings and earnings reports
get_market_kpi Macro indicators: interest rates, inflation, sector performance
compliance_check Validate portfolio against exposure limits and concentration rules

LangGraph Agent

  • Multi-step reasoning: chains tool calls to answer complex questions
  • Report generation: automated daily/weekly portfolio summaries
  • Anomaly triage: investigates detected anomalies with root cause analysis
  • Human-in-the-loop: asks for confirmation before high-impact actions

Quick Start

Prerequisites

  • Python 3.11+
  • uv (recommended) or pip
  • API keys: Alpha Vantage (free), Finnhub (free), Anthropic (for agent)

Installation

# Clone the repo
git clone https://github.com/geraldo96/finwatch-mcp.git
cd finwatch-mcp

# Install with uv (recommended)
uv sync

# Or with pip
pip install -e ".[dev]"

# Copy environment template
cp .env.example .env
# Edit .env with your API keys

Run the MCP Server

# Start the MCP server (Streamable HTTP)
uv run python -m src.mcp_server.server

# The server runs on http://localhost:8080/mcp

Connect to Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "finwatch": {
      "type": "http",
      "url": "http://localhost:8080/mcp"
    }
  }
}

Run the LangGraph Agent (standalone)

# Interactive CLI mode
uv run python -m src.agent.cli

# Example queries:
# > What's my current portfolio allocation?
# > Is my tech exposure within compliance limits?
# > Show me anomalies from the last week and explain them

Run with Docker

docker compose up
# MCP server: http://localhost:8080/mcp
# Gradio UI:  http://localhost:7860

Data Sources

Source Data API Key Rate Limit (free)
Alpha Vantage Stock prices, fundamentals Free 25 req/day
Finnhub Real-time quotes, news, sentiment Free 60 req/min
FRED Macro indicators, interest rates Free 120 req/min
SEC EDGAR 10-K, 10-Q filings None 10 req/sec
Yahoo Finance Historical prices (backup) None Unofficial

Project Structure

finwatch-mcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ mcp_server/
β”‚   β”‚   β”œβ”€β”€ server.py          # MCP server entrypoint (Streamable HTTP)
β”‚   β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   β”‚   β”œβ”€β”€ portfolio.py   # get_portfolio tool
β”‚   β”‚   β”‚   β”œβ”€β”€ risk.py        # analyze_risk tool
β”‚   β”‚   β”‚   β”œβ”€β”€ anomaly.py     # detect_anomaly tool
β”‚   β”‚   β”‚   β”œβ”€β”€ filings.py     # search_filings tool (RAG)
β”‚   β”‚   β”‚   β”œβ”€β”€ market_kpi.py  # get_market_kpi tool
β”‚   β”‚   β”‚   └── compliance.py  # compliance_check tool
β”‚   β”‚   └── config.py          # Server configuration
β”‚   β”œβ”€β”€ agent/
β”‚   β”‚   β”œβ”€β”€ graph.py           # LangGraph StateGraph definition
β”‚   β”‚   β”œβ”€β”€ nodes.py           # Agent nodes (reason, act, report)
β”‚   β”‚   β”œβ”€β”€ state.py           # Agent state schema
β”‚   β”‚   └── cli.py             # Interactive CLI client
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   β”œβ”€β”€ ingester.py        # Data fetching & sync logic
β”‚   β”‚   β”œβ”€β”€ models.py          # SQLAlchemy / Pydantic models
β”‚   β”‚   └── db.py              # Database connection & queries
β”‚   └── rag/
β”‚       β”œβ”€β”€ embeddings.py      # BAAI embedding pipeline
β”‚       β”œβ”€β”€ indexer.py         # SEC filing indexer
β”‚       └── retriever.py       # ChromaDB retrieval
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ test_tools.py          # Unit tests for MCP tools
β”‚   β”œβ”€β”€ test_agent.py          # Agent integration tests
β”‚   └── test_data.py           # Data layer tests
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ seed_data.py           # Seed DB with sample portfolio
β”‚   β”œβ”€β”€ ingest_filings.py      # Download & index SEC filings
β”‚   └── demo.py                # Full demo walkthrough
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ ARCHITECTURE.md        # Detailed architecture docs
β”‚   └── TOOLS.md               # MCP tool specifications
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ .env.example
└── README.md

Development Roadmap

Week 1 β€” Foundation

  • [x] Project scaffold & CI setup
  • [ ] MCP server with get_portfolio and analyze_risk tools
  • [ ] SQLite data layer + Alpha Vantage / yfinance ingestion
  • [ ] Sample portfolio seeding script

Week 2 β€” RAG & Anomaly Detection

  • [ ] ChromaDB setup + SEC EDGAR filing indexer
  • [ ] search_filings tool with BAAI embeddings
  • [ ] detect_anomaly tool (z-score + rolling stats)
  • [ ] get_market_kpi tool (FRED integration)

Week 3 β€” Agent & Orchestration

  • [ ] LangGraph StateGraph with Claude API
  • [ ] Multi-step reasoning chains
  • [ ] compliance_check tool
  • [ ] Interactive CLI client

Week 4 β€” Polish & Deploy

  • [ ] Docker Compose (server + agent + Gradio UI)
  • [ ] Comprehensive tests
  • [ ] Demo video / GIF
  • [ ] Hugging Face Space (optional)

Tech Stack

Layer Technology
MCP Server Python mcp SDK, Streamable HTTP
Agent LangGraph, Claude API (Anthropic SDK)
Structured Data SQLite + SQLAlchemy
Vector Store ChromaDB + BAAI/bge-small-en-v1.5
Data Sources Alpha Vantage, Finnhub, FRED, SEC EDGAR, yfinance
UI Gradio (demo), Claude Desktop (production)
Deploy Docker Compose
Testing pytest, pytest-asyncio

Contributing

Contributions are welcome! Please read the contributing guidelines first.

License

MIT License β€” see LICENSE for details.


Built by Geraldo Margjini as a portfolio project demonstrating MCP Server development, LangGraph agent orchestration, and financial data engineering.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured