Skip to main content
Glama
Rohit-shopasky

Finnhub MCP Server

πŸ“ˆ Finnhub MCP Server

Node.js TypeScript MCP SDK License

A Model Context Protocol (MCP) server that gives AI assistants (Claude, Cursor, etc.) real-time access to financial market data via the Finnhub API.

Ask Claude things like:

  • "What is Apple's current stock price?"

  • "Show me Tesla's earnings history"

  • "Get the latest crypto news"

  • "What are EUR/USD rates right now?"


πŸ›  Available Tools (11 total)

Category

Tool

What it does

πŸ“ˆ Stocks

get_stock_quote

Real-time price, change %, high/low

get_stock_candles

Historical OHLCV candles (1min β†’ monthly)

get_company_profile

Name, exchange, industry, market cap

get_basic_financials

P/E, EPS, beta, ROE, dividend yield

get_earnings

Historical EPS vs estimate + surprise %

πŸ“° News

get_company_news

Recent articles for a stock in a date range

get_market_news

Market news by category (general/forex/crypto/merger)

πŸ” Search

search_symbols

Look up ticker symbols by name or keyword

πŸ’± Forex

get_forex_rates

Live exchange rates from a base currency

get_forex_candles

Historical OHLCV for forex pairs

πŸͺ™ Crypto

get_crypto_candles

Historical OHLCV for crypto pairs

Free Tier Note: The Finnhub free plan supports US stocks (NYSE/NASDAQ), forex, and crypto. Indian (NSE/BSE) and other international exchanges require a paid plan at finnhub.io/pricing.


Related MCP server: MCP Finnhub Server

⚑ Prerequisites


πŸš€ Option 1 β€” Local (Claude Desktop / Cursor)

Step 1: Clone & install

git clone <your-repo-url> finnhub-mcp
cd finnhub-mcp
npm install

Step 2: Add your API key

cp .env.example .env
# Open .env and set:
# FINNHUB_API_KEY=your_key_here

Step 3: Build

npm run build

Step 4: Connect to Claude Desktop

Open (or create) the Claude Desktop config file:

OS

Path

macOS

~/Library/Application Support/Claude/claude_desktop_config.json

Windows

%APPDATA%\Claude\claude_desktop_config.json

Add the mcpServers block (merge with existing content if the file already exists):

{
  "mcpServers": {
    "finnhub": {
      "command": "node",
      "args": ["/absolute/path/to/finnhub-mcp/dist/index.js"],
      "env": {
        "FINNHUB_API_KEY": "your_api_key_here"
      }
    }
  }
}

Important: Replace /absolute/path/to/finnhub-mcp with the actual path where you cloned the repo.

Step 5: Restart Claude Desktop

Fully quit Claude (don't just close the window) and relaunch it.

Verify: Open a new chat and look for the πŸ”¨ hammer icon at the bottom of the input box. Click it to see all 11 Finnhub tools listed.


Connect to Cursor (Local)

Go to Cursor Settings β†’ MCP β†’ Add Server and add:

{
  "finnhub": {
    "command": "node",
    "args": ["/absolute/path/to/finnhub-mcp/dist/index.js"],
    "env": {
      "FINNHUB_API_KEY": "your_api_key_here"
    }
  }
}

Test with MCP Inspector (optional)

npm run inspector
# Opens http://localhost:5173 β€” interactive tool tester

☁️ Option 2 β€” AWS Lambda (Remote / Shared)

Deploy the server as a public HTTPS endpoint that any MCP client can connect to.

Architecture

AI Agent (Claude / Cursor)
        β”‚  HTTPS POST /mcp
        β–Ό
AWS Lambda Function URL
  (Response Streaming)
        β”‚
        β–Ό
Express + StreamableHTTP (stateless)
        β”‚
        β–Ό
Finnhub REST API β†’ finnhub.io

Step 1: Configure AWS CLI

aws configure
# Enter: Access Key ID, Secret Access Key, Region (e.g. us-east-1), Output: json

Verify it works:

aws sts get-caller-identity

Step 2: One-time Lambda setup

bash deploy/lambda-setup.sh

This will:

  1. βœ… Create an IAM execution role

  2. βœ… Build & package the server into a zip

  3. βœ… Create the Lambda function (finnhub-mcp-server)

  4. βœ… Create a public Function URL with response streaming

At the end you'll see:

════════════════════════════════════════════════
  βœ… Setup complete!

  MCP Endpoint : https://xxxx.lambda-url.us-east-1.on.aws/mcp
  Health Check : https://xxxx.lambda-url.us-east-1.on.aws/health
════════════════════════════════════════════════

Step 3: Test your Lambda

# Health check
curl https://xxxx.lambda-url.us-east-1.on.aws/health

# Call a tool
curl -X POST https://xxxx.lambda-url.us-east-1.on.aws/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "get_stock_quote",
      "arguments": { "symbol": "AAPL" }
    }
  }'

Step 4: Connect Claude Desktop to Lambda

Claude Desktop uses mcp-remote as a local bridge to reach the remote Lambda server. No code runs on your machine β€” mcp-remote just proxies requests over HTTPS.

Open your Claude Desktop config file:

OS

Path

macOS

~/Library/Application Support/Claude/claude_desktop_config.json

Windows

%APPDATA%\Claude\claude_desktop_config.json

Add the following (replace the URL with the one printed by lambda-setup.sh):

{
  "mcpServers": {
    "finnhub": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@latest",
        "https://xxxx.execute-api.us-east-1.amazonaws.com/mcp"
      ]
    }
  }
}

Note: npx will download mcp-remote automatically on first launch β€” no manual install needed.

Fully quit Claude Desktop and relaunch it. On first connection, mcp-remote will perform the MCP handshake with your Lambda and load all 11 tools.

Verify: Click the πŸ”¨ hammer icon in the chat input β€” you should see all Finnhub tools listed.

Step 5: Connect Cursor to Lambda

Go to Cursor Settings β†’ MCP β†’ Add Server:

{
  "finnhub": {
    "url": "https://xxxx.execute-api.us-east-1.amazonaws.com/mcp"
  }
}

Cursor supports remote HTTP MCP URLs natively β€” no mcp-remote bridge needed.

Redeploy after code changes

npm run deploy
# or: bash deploy/deploy.sh

πŸ“ Project Structure

finnhub-mcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts          ← Stdio entry point (Claude Desktop / local)
β”‚   β”œβ”€β”€ http.ts           ← HTTP entry point (Lambda / remote)
β”‚   β”œβ”€β”€ server.ts         ← Shared MCP server factory
β”‚   β”œβ”€β”€ finnhub.ts        ← Typed Finnhub HTTP client
β”‚   └── tools/
β”‚       β”œβ”€β”€ stocks.ts     ← 5 stock tools
β”‚       β”œβ”€β”€ news.ts       ← 2 news tools
β”‚       β”œβ”€β”€ search.ts     ← 1 search tool
β”‚       β”œβ”€β”€ forex.ts      ← 2 forex tools
β”‚       └── crypto.ts     ← 1 crypto tool
β”œβ”€β”€ deploy/
β”‚   β”œβ”€β”€ lambda-setup.sh   ← One-time AWS setup
β”‚   └── deploy.sh         ← Redeploy script
β”œβ”€β”€ dist/                 ← Compiled output (after npm run build)
β”œβ”€β”€ .env                  ← Your API key (never commit this!)
β”œβ”€β”€ .env.example          ← Template
β”œβ”€β”€ package.json
└── tsconfig.json

πŸ”§ Environment Variables

Variable

Required

Description

FINNHUB_API_KEY

βœ… Yes

Your Finnhub API key from finnhub.io/register

PORT

No

HTTP server port (default: 8080)

AWS_REGION

No

AWS region for deployment (default: us-east-1)


πŸ’¬ Example Prompts

Once connected, try these in Claude:

What is Apple's current stock price and how has it changed today?
Show me Microsoft's company profile and key financial metrics
Get me 5 recent news articles about Tesla
Search for symbols related to "artificial intelligence"
What are the current EUR/USD, GBP/USD, and JPY/USD exchange rates?
Show Bitcoin's daily candles on Binance for the past 30 days

❓ Troubleshooting

Problem

Cause

Fix

FINNHUB_API_KEY is not set

Missing env var

Add key to .env or Claude config's env block

Error fetching quote: 403

Symbol not on free plan

Use US stocks (AAPL, TSLA) or upgrade at finnhub.io/pricing

Error fetching quote: 401

Invalid API key

Verify key at finnhub.io/dashboard

Error fetching quote: 429

Rate limit hit

Free tier = 30 req/sec. Wait and retry

Hammer icon missing in Claude

Server not connecting

Fully quit Claude (not just close) and relaunch

Lambda returns timeout

Cold start too slow

Increase Lambda timeout in AWS console (currently 30s)


πŸ“ License

MIT β€” free to use, modify, and deploy.

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

UpdatingMaintainers
UpdatingResponse time
–Release cycle
0Releases (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

  • A
    license
    C
    quality
    A
    maintenance
    Enables AI assistants to access and analyze financial data including stock information, company fundamentals, and market insights through the Financial Modeling Prep API.
    100
    375
    142
    TypeScript
    Apache 2.0
  • 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
    Not graded
    quality
    C
    maintenance
    Provides real-time stock quotes, historical data, and stock search via Yahoo Finance, enabling AI assistants to access and analyze financial market data.
    25
    19
    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

View all related MCP servers

Related MCP Connectors

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/Rohit-shopasky/finhub-mcp-server'

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