Skip to main content
Glama
cstamigo-droid

market-data-mcp

market-data-mcp

market-data-mcp MCP server

License: MIT Python MCP

market-data-mcp - quote + verdict demo

Real-time market data: quotes, news, earnings calendar, and a watchlist scanner for AI agents — backed by Finnhub.

Gives any MCP client (Claude Desktop, Claude Code, agents) clean, uniform market data tools that fail gracefully. A missing or premium-gated source returns "no data", never a fabricated value. Markdown output by default, JSON on demand.


Tools

Tool

What it does

Source

Free tier

market_quote

Real-time price, % change, high/low/open/prev-close

Finnhub /quote

Yes

market_news

Top 5 headlines — company-specific or general market

Finnhub /company-news, /news

Yes

market_calendar

Earnings calendar for the next N days (with EPS/revenue estimates)

Finnhub /calendar/earnings

Yes*

market_scan

Watchlist scanner: rank up to 25 tickers by absolute % change

Finnhub /quote x N

Yes

market_analyze

Composite: momentum score + news catalyst + earnings proximity

All of the above

Yes

broker_positions

Read open positions from Alpaca paper account

Alpaca Paper API

Optional**

*Calendar tested live on 2026-06-14: accessible on Finnhub free tier.
**broker_positions requires ALPACA_API_KEY + ALPACA_SECRET_KEY in .env. Degrades gracefully without them.

Every tool returns Markdown (human-readable, default) or JSON (response_format="json") for programmatic use.


Related MCP server: MonteWalk

Live demo output (2026-06-14)

market_quote AAPL:
  AAPL: $291.13  (-1.52%  -$4.50)  prev close $295.63

market_scan AAPL,MSFT,NVDA,TSLA:
  Scanned 4/4 symbols. Top mover: TSLA +1.82%

market_calendar days=7:
  20 earnings events in the next 7 days: ACN, KR, MEI ...

market_analyze AAPL:
  Signal: Lean negative  [......##|........] -30/100  confidence 60%
  AAPL: $291.13  -1.52%  → Lean negative [TRIM]
  Catalyst: Apple's iOS 27 surprise could change the AI narrative

Quick start

git clone <your-repo-url> market-data-mcp
cd market-data-mcp
python -m venv .venv
.venv\Scripts\activate        # Windows
pip install -r requirements.txt

copy .env.example .env        # edit: add FINNHUB_API_KEY
python tests/test_smoke.py    # live test all 6 tools

Get a free Finnhub key at: https://finnhub.io/register


Claude Desktop config

Add this to claude_desktop_config.json (%APPDATA%\Claude\ on Windows, ~/Library/Application Support/Claude/ on macOS), then restart Claude Desktop:

{
  "mcpServers": {
    "market-data-mcp": {
      "command": "python",
      "args": ["-m", "market_data_mcp"],
      "cwd": "C:/path/to/market-data-mcp"
    }
  }
}

Use the system Python path if you are not using a venv:

{
  "mcpServers": {
    "market-data-mcp": {
      "command": "C:/Users/YourName/AppData/Local/Python/pythoncore-3.14-64/python.exe",
      "args": ["-m", "market_data_mcp"],
      "cwd": "C:/path/to/market-data-mcp",
      "env": { "PYTHONUTF8": "1" }
    }
  }
}

Optional: Alpaca broker source

The broker_positions tool reads your Alpaca paper account. To enable it:

  1. Go to https://app.alpaca.markets/ → Paper Trading → API Keys

  2. Add to .env:

    ALPACA_API_KEY=your-key-here
    ALPACA_SECRET_KEY=your-secret-here
  3. Restart the server.

Without these keys, broker_positions returns a graceful "keys not set" message.


Why it's built this way

  • Uniform result contract. Every source returns the same Result shape (source, ok, summary, data, score, confidence, error). An LLM can reason across all tools without parsing N formats.

  • Graceful degradation. A source with no data, a premium-gated endpoint, or a missing key returns Result.failed(...) — never a fabricated value. Zero-price from Finnhub for unknown symbols is treated as "no data", not a quote.

  • Scored analysis. The composite market_analyze tool emits a -100..+100 directional score with confidence, so an agent can triage without reading prose.

  • TTL cache. Per-source in-process cache avoids hammering rate-limited APIs when an agent calls several tools in one turn (e.g. scan + analyze in sequence).


Disclaimer

For research and educational use only. Data comes from Finnhub and Alpaca and may be delayed or incomplete. Never use automated market data for financial decisions without independent verification.

License

MIT

Available Tools

6 tools
broker_positionsA
Read-only

Read open positions from an Alpaca paper trading account.

OPTIONAL — requires ALPACA_API_KEY and ALPACA_SECRET_KEY in .env. If keys are absent, returns a graceful 'no data' message with setup instructions. Read-only: never places orders or moves money.

Args: params: response_format ('markdown'|'json').

Examples: - "What positions do I have open in my paper account?" -> (no ticker needed) - "Show me my paper portfolio" -> (no ticker needed)

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds that it never places orders or moves money, and details behavior when keys are missing (returns graceful message with setup instructions), which goes beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, well-structured with sections for description, instructions, args, and examples. Every sentence adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 param, read-only, has output schema), the description covers all needed context: purpose, prerequisites, behavior, and parameter usage. Output schema exists, so return format doesn't need separate explanation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite schema description coverage being 0% per context, the description explains the single parameter response_format with values 'markdown' or 'json', and provides examples. This compensates well for the lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Read open positions from an Alpaca paper trading account.' It specifies the resource (open positions) and verb (read), and distinguishes from sibling tools like market_analyze, market_calendar, etc., which are about market data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains that the tool is optional, requires API keys, and returns a graceful message if keys are absent. It also states read-only behavior. Examples illustrate typical usage. No explicit exclusions or alternatives, but context makes it clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

market_analyzeA
Read-only

Composite market analysis: momentum score, news catalyst, and earnings proximity.

Combines real-time quote (momentum), latest news headline (catalyst), and earnings calendar (risk flag) into a single scored verdict. Each component degrades gracefully — if news or calendar are unavailable, only quote is used. Score: -100 (strong selling pressure) to +100 (strong upward momentum).

Args: params: symbol (str) and response_format ('markdown'|'json').

Examples: - "Give me a full read on Apple" -> symbol='AAPL' - "What's the momentum on NVIDIA right now?" -> symbol='NVDA' - "Analyze Tesla for me" -> symbol='TSLA'

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate read-only and non-destructive behavior. Description adds value by explaining graceful degradation (if components are unavailable), score range (-100 to +100), and the composite nature, providing useful behavioral context beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is well-structured with an overview, behavioral details, and arguments/examples. It is somewhat lengthy but front-loaded with key information; every sentence serves a purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's composite nature, schema coverage, annotations, and output schema existence, the description adequately covers return values, parameter usage, and graceful degradation. No major gaps identified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema already provides clear descriptions for both parameters (symbol and response_format). Description adds examples and clarifies response_format options ('markdown' vs 'json'), but does not add significant meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it performs composite market analysis combining momentum, news, and earnings. Verb ('analyze') and resource ('market') are specific, and the composite nature distinguishes it from sibling tools like market_quote or market_news.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Description explains it provides a combined score using quote, news, and calendar, implying use when a consolidated verdict is needed. However, it does not explicitly state when not to use it or point to alternatives like individual data tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

market_calendarA
Read-onlyIdempotent

Fetch the earnings calendar for the next N days.

Returns upcoming earnings reports with estimated EPS and revenue where available. NOTE: This endpoint may be premium-gated on the Finnhub free tier. If so, it degrades gracefully with an honest 'no data' message rather than fabricating events.

Args: params: days (int, 1-30, default 7) and response_format.

Examples: - "Which companies report earnings this week?" -> days=7 - "Show me earnings for the next 2 weeks" -> days=14 - "What's reporting tomorrow?" -> days=1

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnlyHint and idempotentHint annotations, the description adds that the endpoint may be premium-gated on the free tier and degrades gracefully, providing useful behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief yet informative, with a clear opening statement, a note on limitations, and concise examples that illustrate usage without unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity and the presence of an output schema, the description covers the key points: what it returns, the premium-gating behavior, and typical use cases, making it fully adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already fully describes both parameters with clear descriptions, so the description adds no new semantic information beyond restating the defaults and examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool fetches an earnings calendar for a specified number of days, distinguishing it from sibling tools like market_news or market_quote which focus on different market data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes example queries that imply when to use the tool (e.g., 'Which companies report earnings this week?'), but it does not explicitly compare with alternatives or state when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

market_newsA
Read-only

Fetch the latest market news — company-specific or general market headlines.

With a symbol: returns top 5 news items for that ticker from the past 7 days. Without a symbol: returns top 5 general market headlines. Backed by Finnhub free tier.

Args: params: symbol (optional ticker) and response_format ('markdown'|'json').

Examples: - "What's the latest news about Microsoft?" -> symbol='MSFT' - "Give me today's market news" -> (no symbol) - "Any news on Amazon this week?" -> symbol='AMZN'

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate read-only and non-destructive. Description adds behavioral details: top 5 results, 7-day lookback, and data source (Finnhub free tier). No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely concise and well-structured: single sentence intro, then behavior bullet, then Args, then examples. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose, behavior, parameter usage, and examples. Output schema exists, so return format further documented. No missing information for an agent to use this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema provides descriptions for both parameters, so the description's Args line adds little new semantic meaning. However, it clarifies usage in context (e.g., symbol optional, response_format enum values). Baseline 3 due to schema already covering parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it fetches market news, distinguishing between company-specific and general headlines. It uses specific verbs and resources, and differs from sibling tools like market_quote which provide stock quotes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly explains behavior with and without a symbol, including limits (top 5, past 7 days) and examples for common queries. Lacks explicit when-not-to-use or alternatives to siblings, but context and examples suffice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

market_quoteA
Read-onlyIdempotent

Get a real-time stock quote: price, % change, day high/low, and previous close.

Backed by Finnhub free tier. Returns 'no data' for unknown/delisted symbols (Finnhub returns zeros for unknowns — we treat that as no data, never fabricate).

Args: params: symbol (str) and response_format ('markdown'|'json').

Examples: - "What is Apple's current stock price?" -> symbol='AAPL' - "How much is NVIDIA up today?" -> symbol='NVDA' - "Get me a quote for Tesla" -> symbol='TSLA'

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint, idempotentHint, openWorldHint, and destructiveHint=false. The description adds value by detailing behavior for unknown symbols: 'Returns 'no data' for unknown/delisted symbols (Finnhub returns zeros for unknowns — we treat that as no data, never fabricate).' This provides concrete error-handling context beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise: a one-sentence summary followed by essential details, an Args section, and examples. It is front-loaded with the core purpose and avoids unnecessary exposition. Every sentence adds value, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has an output schema (not shown but flagged), which likely documents return values. The description provides supplementary information: data fields returned, error handling for unknown symbols, and backing service. For a simple quote tool with good annotations and output schema, the description is complete enough, missing only explicit prerequisites (e.g., API key).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already describes both parameters (symbol and response_format) with decent detail. The description adds an 'Args' section that restates types and adds examples mapping natural language to symbols. Since schema coverage is complete, this adds marginal value, meriting a baseline score of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get a real-time stock quote: price, % change, day high/low, and previous close.' It specifies the verb 'Get', the resource 'real-time stock quote', and the fields returned. This distinguishes it from sibling tools like market_analyze or market_news, which have different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides examples and mentions backing by Finnhub, but does not explicitly guide when to use this tool versus alternatives like market_analyze or market_scan. There is no 'when to use' or 'when not to use' advice. The examples imply use for simple quote requests, but no exclusions or alternatives are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

market_scanA
Read-onlyIdempotent

Scan a watchlist of stocks and rank them by absolute % change (biggest movers first).

Accepts up to 25 symbols. Unknown or delisted tickers are skipped gracefully. Useful for monitoring a portfolio or sector basket for unusual activity.

Args: params: symbols (comma-separated string, max 25) and response_format.

Examples: - "Which of AAPL, MSFT, GOOGL, AMZN, META is moving most today?" -> symbols='AAPL,MSFT,GOOGL,AMZN,META' - "Scan my tech watchlist: NVDA,AMD,INTC,TSM,AVGO" -> symbols='NVDA,AMD,INTC,TSM,AVGO' - "Show biggest movers in AAPL TSLA MSFT today" -> symbols='AAPL,TSLA,MSFT'

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds important behavior: ranking by % change, accepting up to 25 symbols, and gracefully skipping unknown/delisted tickers. Complements annotations (readOnlyHint, idempotentHint) without contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Concise with clear structure: purpose, constraints, then bulleted examples. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity, annotations, and output schema existence, the description fully informs the agent about behavior, constraints, and usage context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description repeats the max 25 symbols constraint already in the schema, but adds helpful examples. Schema coverage is effectively high due to nested parameter descriptions, so the description adds marginal semantic value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool scans a watchlist and ranks by absolute % change, distinguishing it from siblings like market_quote or market_analyze.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly mentions it's useful for monitoring portfolios or sector baskets, and provides multiple examples. However, it does not explicitly state when not to use or list alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 6 tool updatesv0.1.0
    • First observedbroker_positions
    • First observedmarket_analyze
    • First observedmarket_calendar
    • First observedmarket_news
    • First observedmarket_quote
    • First observedmarket_scan

TDQS

A4.2/5.0

Scored across 6 tools

Disambiguation5/5

Each tool targets a distinct aspect of market data: positions, analysis, calendar, news, quote, and scan. No two tools have overlapping purposes, making it easy for an agent to select the correct one.

Naming Consistency4/5

All tools use lowercase and underscores, and five out of six start with 'market_'. The outlier 'broker_positions' breaks the prefix pattern, but the naming style is otherwise consistent.

Tool Count5/5

6 tools is well-scoped for a market data server. Each tool serves a clear purpose without being excessive or insufficient.

Completeness4/5

The server covers core market data needs: quotes, news, earnings, scan, and composite analysis. A minor gap is historical price data, but the surface is sufficient for most real-time queries.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides comprehensive financial market data and news through the Finnhub API. Enables real-time stock quotes, company profiles, financial metrics, analyst recommendations, and market news access.
    1
    MIT
  • A
    license
    C
    quality
    D
    maintenance
    Provides AI agents with institutional-grade quantitative finance tools including real-time market data, paper trading via Alpaca, risk analysis with Monte Carlo simulations, backtesting, and multi-source news sentiment analysis for portfolio management and trading strategy development.
    31
    5
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Provides stock market data and analysis tools using the Finnhub API, including stock prices, financial metrics, news, and historical data.
    6
    7
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Connects AI agents to the Finnhub API for real-time stock quotes, market news, earnings reports, and financial metrics.
    -