Skip to main content
Glama
ach968

Finnhub MCP Server

by ach968

Finnhub MCP Server

A Model Context Protocol (MCP) server wrapping the Finnhub API for financial market data.

Features

  • Earnings Calendar: Get upcoming and historical earnings announcements with EPS estimates, actuals, and revenue data

  • API Key Authentication: Simple API key-based authentication via CLI or environment variables

  • Type-safe: Full TypeScript support with Zod validation

  • Bun-native: Optimized for Bun runtime

Related MCP server: market-data-mcp

Installation

Run directly from GitHub without cloning or installing:

npx github:ach968/finnhub-mcp --api-key YOUR_FINNHUB_API_KEY

Local Development

# Clone the repository
git clone https://github.com/ach968/finnhub-mcp.git
cd finnhub-mcp

# Install dependencies
bun install

# Run in development mode
bun run dev -- --api-key YOUR_FINNHUB_API_KEY

OpenCode Configuration

Add to your OpenCode config (~/.config/opencode/opencode.json):

Using npx with GitHub

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "finnhub": {
      "type": "local",
      "command": [
        "npx",
        "github:ach968/finnhub-mcp",
        "--api-key",
        "YOUR_FINNHUB_API_KEY"
      ],
      "enabled": true
    }
  }
}

Using Environment Variables

{
  "mcp": {
    "finnhub": {
      "type": "local",
      "command": [
        "npx",
        "github:ach968/finnhub-mcp"
      ],
      "environment": {
        "FINNHUB_API_KEY": "YOUR_API_KEY"
      },
      "enabled": true
    }
  }
}

Available Tools

finnhub.calendar.earnings

Get earnings calendar for a date range.

Parameters:

  • from (optional): Start date in YYYY-MM-DD format (defaults to today)

  • to (optional): End date in YYYY-MM-DD format (defaults to 7 days from start)

  • symbol (optional): Filter by stock symbol (e.g., "AAPL")

Example Response:

{
  "data": [
    {
      "date": "2024-01-25",
      "symbol": "AAPL",
      "quarter": "Q1",
      "fiscalYear": 2024,
      "time": "amc",
      "eps": {
        "estimate": 2.11,
        "actual": 2.18,
        "surprise": 0.07,
        "surprisePercent": 3.32
      },
      "revenue": {
        "estimate": 117900000000,
        "actual": 119580000000,
        "surprise": 1680000000,
        "surprisePercent": 1.42
      }
    }
  ],
  "count": 1,
  "dateRange": {
    "from": "2024-01-25",
    "to": "2024-01-25"
  }
}

Time Values:

  • bmo: Before Market Open

  • amc: After Market Close

  • dmh: During Market Hours

CLI Arguments

Argument

Environment Variable

Description

--api-key

FINNHUB_API_KEY

Finnhub API key (required)

CLI arguments take priority over environment variables.

Development

Scripts

# Development with hot reload
bun run dev

# Build for production
bun run build

# Type checking
bun run typecheck

# Run the built version
bun run start -- --api-key YOUR_KEY

Project Structure

src/
├── index.ts           # Main MCP server entry point
├── finnhub-client.ts  # Finnhub API client
└── types.ts           # TypeScript types and Zod schemas

API Key

Get your free API key from Finnhub.

License

MIT

Disclaimer

This project uses the Finnhub API but is not affiliated with, endorsed by, or connected to Finnhub in any way. Use this software at your own risk.

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    A specialized MCP server that provides institutional-grade financial data and market research via the Finnhub API. It enables AI agents to function as equity researchers, generating professional market reports and high-fidelity analysis for stock tickers.
    Last updated
  • -
    license
    -
    quality
    -
    maintenance
    Real-time financial market data MCP server. Stocks, crypto, technicals, sentiment, FDA calendar. No API keys required.
    Last updated
  • A
    license
    B
    quality
    F
    maintenance
    An MCP server that provides comprehensive access to real-time stock quotes, financial statements, analyst estimates, and technical indicators via the Financial Modeling Prep API. It enables users to conduct in-depth financial analysis and track market performance through specialized tools, resources, and prompt templates.
    Last updated
    26
    25
    1
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    MCP server providing comprehensive access to Finnhub financial market data API for AI assistants like Claude Desktop.
    Last updated
    10
    MIT

View all related MCP servers

Related MCP Connectors

  • Alpha Vantage MCP — Stock market data, fundamentals, and earnings

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

  • Financial Modeling Prep MCP (/stable API; v3 deprecated 2025-08-31).

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ach968/finnhub-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server