Finnhub MCP server

Integrates with Finnhub's financial API to provide streamlined access to market news, stock quotes, financials, and recommendation trends.
Back to servers
Setup instructions
Provider
Catherine Parnell
Release date
Jan 11, 2025
Language
Python

The Finnhub MCP Server provides an interface to access financial market data through the Finnhub API. It allows you to fetch market news, stock quotes, financial information, and recommendation trends directly within Claude Desktop.

Available Tools

  • list_news: Retrieves the latest market news from Finnhub
  • get_market_data: Obtains current market data for a specific stock
  • get_basic_financials: Retrieves basic financial information for a particular stock
  • get_recommendation_trends: Fetches analyst recommendation trends for a specific stock

Installation

Prerequisites

  1. You'll need a Finnhub API key (obtain one from Finnhub)
  2. Install uv package manager by following the instructions at docs.astral.sh/uv/

Setup Steps

  1. Install dependencies using uv:

    uv sync
    source .venv/bin/activate
    
  2. Create a .env file with your Finnhub API key:

    FINNUB_API_KEY=<FINNHUB_API_KEY>
    
  3. Install the MCP server:

    fastmcp install server.py
    
  4. Configure Claude Desktop to use the server by editing the configuration file located at:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%/Claude/claude_desktop_config.json
  5. In the configuration file, locate the uv command entry and replace it with the absolute path to your uv executable.

  6. Restart Claude Desktop to apply the changes.

Usage

Once installed, you can use the following tools in your Claude Desktop conversations:

Retrieving Market News

Use the list_news tool to get the latest market news:

@list_news

Getting Stock Data

Fetch current market data for a specific stock:

@get_market_data symbol=AAPL

Retrieving Financial Information

Get basic financial information for a company:

@get_basic_financials symbol=TSLA

Viewing Recommendation Trends

Check analyst recommendations for a stock:

@get_recommendation_trends symbol=MSFT

For each tool, replace the example ticker symbols (AAPL, TSLA, MSFT) with the stock symbol you're interested in analyzing.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "finnhub" '{"command":"python","args":["-m","server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "finnhub": {
            "command": "python",
            "args": [
                "-m",
                "server"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "finnhub": {
            "command": "python",
            "args": [
                "-m",
                "server"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later