Skip to main content
Glama
Equity Screener MCP Server

Equity Screener MCP Server

πŸ“ˆ Equity Screener MCP Server

Give your AI assistant real stock market data β€” from any country, in seconds.

CI Python 3.11+ License: MIT MCP uv

Tired of asking Claude about the stock market and getting hallucinated tickers? This project fixes that.

Getting Started Β· MCP Setup Β· Tools Reference Β· Architecture Β· Contributing


πŸ€” The Problem

When you ask an AI assistant "Which stocks spiked in Brazil today?", it either:

  • ❌ Refuses: "I don't have access to real-time data"

  • ❌ Hallucinates: Makes up tickers with confident-sounding prices

This project solves that. It fetches equity screener data for any region, stores it locally in DuckDB, and exposes it as MCP tools that AI agents can call directly.

You:    "Which stock spiked the most in Argentina today?"
Claude: [calls get_top_movers("argentina", sort_by="change_pct")]
        "NVDA.BA surged 8.3% today, followed by AAPL.BA at +5.1%..."

Real data. No hallucinations. No browser needed.


Related MCP server: Stock MCP

✨ Features

  • πŸš€ Fast β€” HTTP-based scraper (no Selenium, no ChromeDriver). ~10Γ— faster than browser automation.

  • πŸ—„οΈ Persistent β€” DuckDB stores all snapshots locally. Queries are instant.

  • πŸ”„ Stale-while-revalidate β€” AI always gets a response immediately; fresh data loads in background.

  • πŸ€– AI-native β€” 5 MCP tools purpose-built for LLM consumption, with freshness-aware descriptions.

  • 🌍 Any region β€” Argentina, Brazil, Japan, Germany, India, and 60+ more.

  • πŸ“Š Rich data β€” Symbol, name, price, and change_pct (daily % change) for every stock.

  • πŸ”Œ Multi-provider β€” Works with Claude, OpenAI, Perplexity, or fully offline with no API key.


πŸš€ Getting Started

Requirements: Python 3.11+ and uv

# 1. Clone the repo
git clone https://github.com/MatheusFernandesDuarte/equity-screener-mcp-server.git
cd equity-screener-mcp-server

# 2. Install dependencies
uv sync

# 3. Scrape your first region
python run.py Argentina

# 4. Start the MCP server
python mcp_server.py

Output goes to data/outputs/ (CSV) and data/market.duckdb.


πŸ”Œ Connect to Your AI

claude mcp add yahoo-finance -- python /path/to/equity-screener-mcp-server/mcp_server.py

Claude Desktop

Add to ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "yahoo-finance": {
      "command": "python",
      "args": ["/path/to/equity-screener-mcp-server/mcp_server.py"],
      "env": {
        "AI_PROVIDER": "local"
      }
    }
  }
}

With Claude AI (richer summaries)

{
  "mcpServers": {
    "yahoo-finance": {
      "command": "python",
      "args": ["/path/to/equity-screener-mcp-server/mcp_server.py"],
      "env": {
        "AI_PROVIDER": "claude",
        "ANTHROPIC_API_KEY": "sk-ant-..."
      }
    }
  }
}

πŸ’¬ Example Conversations

Once connected, just ask naturally:

"Which stock spiked the most in Argentina today?" β†’ Claude calls get_top_movers("argentina", sort_by="change_pct") and returns ranked results with % change.

"Give me a market summary for Brazil." β†’ Claude calls get_market_summary("brazil") β€” returns AI-generated summary, anomaly detection, and trend analysis.

"Find any ticker with 'petro' in the name." β†’ Claude calls search_symbol("petro") β€” partial match across all scraped regions.

"Are there anomalies in the Japanese market right now?" β†’ Claude scrapes Japan if needed, analyzes Z-scores, flags statistical outliers.

"What are the top 5 most expensive stocks in Germany?" β†’ Claude calls get_top_movers("germany", n=5, sort_by="price").


πŸ› οΈ Available Tools

Tool

Parameters

What it does

get_stocks_by_region

region

Compact snapshot: count + top 10 + freshness status. Auto-triggers refresh if stale.

get_top_movers

region, n=10, sort_by="price"

Top N stocks sorted by price or change_pct (daily % change).

search_symbol

symbol

Case-insensitive partial match across all scraped regions.

get_market_summary

region

AI-generated summary with anomaly detection and trend analysis.

trigger_refresh

region

Queue a background scrape without blocking.

Freshness logic: Claude checks the freshness field (fresh / stale / expired) on every response and decides whether to use cached data or trigger a refresh first.


πŸ€– AI Providers

Provider

Env var

Quality

local (default)

None required

Rule-based: Z-score anomalies, median trends. Works offline.

claude

ANTHROPIC_API_KEY

Best narrative summaries and market context.

openai

OPENAI_API_KEY

GPT-4o-mini by default, configurable.

perplexity

PERPLEXITY_API_KEY

Good for combining live web context.

If the API key is missing, the system automatically falls back to local β€” no crashes.

# Run with Claude AI
AI_PROVIDER=claude ANTHROPIC_API_KEY=sk-ant-... python mcp_server.py

# Run fully offline
python mcp_server.py

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Claude / GPT / any MCP client                       β”‚
β”‚       ↓  MCP tool calls                              β”‚
β”‚  MarketService  ──→  DuckDB  (reads, always fast)    β”‚
β”‚       β”‚                                              β”‚
β”‚       └──→  ScrapeManager.submit()  [non-blocking]   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          ↓ background thread
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  ScraperEngine  ──→  Equity Screener API  (HTTP)     β”‚
β”‚     Auth: GET screener host β†’ cookies β†’ crumb        β”‚
β”‚     Data: POST /v1/finance/screener (JSON)           β”‚
β”‚       ↓                                              β”‚
β”‚  DuckDB  (writes, single lock)                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key design invariants:

  • MCP tools never block on a network call β€” always served from DuckDB

  • Scraping only happens in background workers (no Selenium, no Chrome)

  • Stale-while-revalidate: return cached data instantly, refresh in background

  • AI layer is optional β€” runs fully offline by default


🌍 Supported Regions

Region

Code

Region

Code

Argentina

ar

Japan

jp

Australia

au

Malaysia

my

Austria

at

Mexico

mx

Belgium

be

Netherlands

nl

Brazil

br

New Zealand

nz

Canada

ca

Nigeria

ng

Chile

cl

Norway

no

China

cn

Pakistan

pk

Colombia

co

Peru

pe

Czech Republic

cz

Philippines

ph

Denmark

dk

Poland

pl

Egypt

eg

Portugal

pt

Finland

fi

Qatar

qa

France

fr

Romania

ro

Germany

de

Saudi Arabia

sa

Greece

gr

Singapore

sg

Hong Kong

hk

South Africa

za

Hungary

hu

South Korea

kr

India

in

Spain

es

Indonesia

id

Sweden

se

Ireland

ie

Switzerland

ch

Israel

il

Taiwan

tw

Italy

it

Thailand

th

Jordan

jo

Turkey

tr

Kenya

ke

United Arab Emirates

ae

Kuwait

kw

United Kingdom

gb

Latvia

lv

United States

us

Lithuania

lt

Venezuela

ve

Luxembourg

lu

Vietnam

vn


🐳 Docker

# Default: scrape Argentina
docker compose up

# Custom region
docker compose run equity-screener python run.py Brazil

# MCP server via HTTP (for remote clients)
MCP_TRANSPORT=http MCP_PORT=8000 docker compose up

Data persists to ./data/outputs/ on the host.


βš™οΈ Environment Variables

Variable

Default

Description

AI_PROVIDER

local

local, claude, openai, perplexity

MCP_TRANSPORT

stdio

stdio or http

MCP_PORT

8000

HTTP transport port

ANTHROPIC_API_KEY

β€”

Required for claude provider

OPENAI_API_KEY

β€”

Required for openai provider

PERPLEXITY_API_KEY

β€”

Required for perplexity provider

ANTHROPIC_MODEL

claude-haiku-4-5-20251001

Claude model override

OPENAI_MODEL

gpt-4o-mini

OpenAI model override

DUCKDB_PATH

data/market.duckdb

Custom database path


πŸ§ͺ Development

uv sync
python -m pytest tests/ -v      # 109 tests, no browser, no network
uv run ruff check src/ tests/   # lint

Project structure

src/
  scraper/    ScraperEngine (HTTP) + ScrapeManager (background workers)
  storage/    DuckDB schema + StockRepository
  services/   MarketService (SWR cache, freshness, dynamic TTL)
  ai/         AIProvider abstraction + LocalProvider + cloud providers
  mcp/        Tool handlers + stdio/HTTP transports
  app/        CLI orchestrator + factories
tests/        One test file per module, TDD throughout
mcp_server.py MCP entrypoint
run.py        CLI entrypoint

🀝 Contributing

Contributions are welcome! See CONTRIBUTING.md for setup, rules, and how to add a new AI provider or data source.

# Fork, clone, and get started
git checkout -b feat/your-feature
uv sync
python -m pytest tests/   # must be green before opening a PR

πŸ“„ License

MIT β€” see LICENSE.


Built by Matheus Fernandes

GitHub LinkedIn X

If this project helped you, consider giving it a ⭐

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    • Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.

      https://mcp.ko.io/mcp
    • Your agent needs markets β€” prices and fundamentals for listed companies, the filings behind them, crypto, and what the prediction markets put the odds at. **What you can ask for** β€’ "Pull this company's income statement, cash flow and balance sheet for the last 8 quarters." β€’ "What did insiders buy or sell, and when?" β€’ "Snapshot prices for these 50 tickers, then the OHLC history for the three that moved." β€’ "What are the current odds on this event across Kalshi and Polymarket?" β€’ "Screen for companies matching these financial criteria." **How to use it** Point any MCP client at https://mcp.aisa.one/finance/mcp and sign in with OAuth β€” there is no key to create or paste. 49 tools: prices and snapshots, income statements, balance sheets and cash flows, metrics and ratios, earnings and analyst estimates, filings and line-item search, insider trades, macro interest rates, news, a screener; CoinGecko spot prices, market tables, OHLC, per-venue tickers and trending; Kalshi and Polymarket markets and trades; plus EDINET filings for Japan. **Why this rather than the source** Equities, crypto and event markets behind one account, so a cross-asset question is one conversation. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Read the number here, then ask the same agent what X is saying about the ticker today β€” without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/marketpulse/mcp Β· /crypto-market-data/mcp Β· /prediction-market-data/mcp Β· /stock-pulse/mcp for one slice each.

    • Financial data MCP server for Claude, ChatGPT, Cursor and Codex. Real-time stock quotes, financial statements, options flow, SEC filings, insider trades, 13F holdings, macro data and market news from gloom.sh, the open-source Bloomberg Terminal alternative.

      https://api.gloom.sh/mcp
    • Live stock quotes, a stock screener, crypto prices and FX rates as agent tools.

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      FinImpulse MCP connects Claude, ChatGPT, Cursor and other AI agents to global market data: stocks, ETFs, mutual funds, indices and forex with price history back to 1970, financial statements, analyst estimates, insider transactions, ETF holdings and SEC filings. Use the hosted endpoint with OAuth or run it locally with npx. Free plan: 500 requests per month, no credit card.
      2
      39
      612 npm
      11
      ISC
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents and backend workflows to access standardized multi-market financial data, technical indicators, fundamentals, news, filings, money flow, and CSV/JSON exports through MCP tools and HTTP endpoints.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to access and analyze financial data, stock information, company fundamentals, and market insights through 250+ tools covering equities, ETFs, crypto, forex, commodities, economics, and more. Supports dynamic or static toolsets over HTTP/SSE for integration with MCP clients.
      356 npm
      Apache 2.0
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents and HTTP clients to query market data, technical indicators, fundamentals, news, filings, money flow, and code exports across A-shares, US equities, ETFs, indices, and cryptocurrencies. It exposes these capabilities as MCP tools and REST endpoints for agent and backend workflows.
      -