# Finnhub MCP Server

A Model Context Protocol (MCP) server that provides real-time financial data through the Finnhub API.

## Installation

```bash
npm install -g finnhub-mcp
```

Or run directly with npx:

```bash
npx finnhub-mcp
```

## Usage

### Prerequisites

You'll need a Finnhub API key. Get one free at [https://finnhub.io](https://finnhub.io).

### Environment Variables

Set your Finnhub API key:

```bash
export FINNHUB_API_KEY=your_api_key
```

### Running the Server

```bash
finnhub-mcp
```

Or with npx:

```bash
FINNHUB_API_KEY=your_api_key npx finnhub-mcp
```

### VS Code Integration

Add this to your MCP configuration in VS Code:

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "finnhub-key",
      "description": "Finnhub API Key",
      "password": true
    }
  ],
  "servers": {
    "Finnhub": {
      "type": "stdio",
      "command": "npx",
      "args": ["finnhub-mcp", "--stdio", "--urls", "http://localhost:3000"],
      "env": {
        "FINNHUB_API_KEY": "${input:finnhub-key}"
      }
    }
  }
}
```

### Claude Integration

Add this to `claude_desktop_config.json file` in Claude desktop:

```json
{
  "mcpServers": {
    "finnhub-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["finnhub-mcp", "--stdio", "--urls", "http://localhost:3000"],
      "env": {
        "FINNHUB_API_KEY": "your_api_key"
      }
    }
  }
}
```

## Tools

- Real-time financial data streaming
- Server-Sent Events (SSE) support
- Standard input/output (STDIO) transport
- Integration with Finnhub API

## License

MIT

## Repository

[https://github.com/salzaki/finnhub-mcp](https://github.com/salzaki/finnhub-mcp)
