Finnhub MCP Server
An MCP server that provides access to financial market data via the Finnhub API, focusing on earnings calendars. It allows users to retrieve historical and upcoming earnings announcements including EPS and revenue data.
README
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
Installation
Using npx with GitHub (recommended)
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 inYYYY-MM-DDformat (defaults to today)to(optional): End date inYYYY-MM-DDformat (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 Openamc: After Market Closedmh: 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.
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.