Skip to main content
Polygon.io logo

Polygon.io MCP Server

GitHub release

A Model Context Protocol (MCP) server that provides access to Polygon.io financial market data API through an LLM-friendly interface.

Overview

This server exposes all Polygon.io API endpoints as MCP tools, providing access to comprehensive financial market data including:

  • Stock, options, forex, and crypto aggregates and bars
  • Real-time and historical trades and quotes
  • Market snapshots
  • Ticker details and reference data
  • Dividends and splits data
  • Financial fundamentals
  • Market status and holidays

Installation

Prerequisites

  • Python 3.10+
  • A Polygon.io API key
    Button
  • Astral UV
    • For existing installs, check that you have a version that supports the uvx command.

Claude Code

First, install Claude Code

npm install -g @anthropic-ai/claude-code

Use the following command to add the Polygon MCP server to your local environment. This assumes uvx is in your $PATH; if not, then you need to provide the full path to uvx.

# Claude CLI
claude mcp add polygon -e POLYGON_API_KEY=your_api_key_here -- uvx --from git+https://github.com/polygon-io/mcp_polygon@v0.5.1 mcp_polygon

This command will install the MCP server in your current project. If you want to install it globally, you can run the command with -s <scope> flag. See claude mcp add --help for more options.

To start Claude Code, run claude in your terminal.

  • If this is your first time using, follow the setup prompts to authenticate

You can also run claude mcp add-from-claude-desktop if the MCP server is installed already for Claude Desktop.

Claude Desktop

  1. Follow the Claude Desktop MCP installation instructions to complete the initial installation and find your configuration file.
  2. Use the following example as reference to add Polygon's MCP server. Make sure you complete the various fields.
    1. Path find your path to uvx, run which uvx in your terminal.
    2. Replace <your_api_key_here> with your actual Polygon.io API key.
    3. Replace <your_home_directory> with your home directory path, e.g., /home/username (Mac/Linux) or C:\Users\username (Windows).
claude_desktop_config.json
{
    "mcpServers": {
        "polygon": {
            "command": "<path_to_your_uvx_install>/uvx",
            "args": [
                "--from",
                "git+https://github.com/polygon-io/mcp_polygon@v0.5.1",
                "mcp_polygon"
            ],
            "env": {
                "POLYGON_API_KEY": "<your_api_key_here>",
                "HOME": "<your_home_directory>"
            }
        }
    }
}

Transport Configuration

By default, STDIO transport is used.

To configure SSE or Streamable HTTP, set the MCP_TRANSPORT environment variable.

Example:

MCP_TRANSPORT=streamable-http \
POLYGON_API_KEY=<your_api_key_here> \
uv run entrypoint.py

Usage Examples

Once integrated, you can prompt Claude to access Polygon.io data:

Get the latest price for AAPL stock
Show me yesterday's trading volume for MSFT
What were the biggest stock market gainers today?
Get me the latest crypto market data for BTC-USD

Available Tools

This MCP server implements all Polygon.io API endpoints as tools, including:

  • get_aggs - Stock aggregates (OHLC) data for a specific ticker
  • list_trades - Historical trade data
  • get_last_trade - Latest trade for a symbol
  • list_ticker_news - Recent news articles for tickers
  • get_snapshot_ticker - Current market snapshot for a ticker
  • get_market_status - Current market status and trading hours
  • list_stock_financials - Fundamental financial data
  • And many more...

Each tool follows the Polygon.io SDK parameter structure while converting responses to standard JSON that LLMs can easily process.

Development

Running Locally

Check to ensure you have the Prerequisites installed.

# Sync dependencies
uv sync

# Run the server
POLYGON_API_KEY=your_api_key_here uv run mcp_polygon
Local Dev Config for claude_desktop_config.json
  "mcpServers": {
    "polygon": {
      "command": "/your/path/.cargo/bin/uv",
      "args": [
        "run",
        "--with",
        "/your/path/mcp_polygon",
        "mcp_polygon"
      ],
      "env": {
        "POLYGON_API_KEY": "your_api_key_here",
        "HOME": "/Users/danny"
      }
    }
  }

Debugging

For debugging and testing, we recommend using the MCP Inspector:

npx @modelcontextprotocol/inspector uv --directory /path/to/mcp_polygon run mcp_polygon

This will launch a browser interface where you can interact with your MCP server directly and see input/output for each tool.

Code Linting

This project uses just for common development tasks. To lint your code before submitting a PR:

just lint

This will run ruff format and ruff check --fix to automatically format your code and fix linting issues.

Privacy Policy

This MCP server interacts with Polygon.io's API to fetch market data. All data requests are subject to Polygon.io's privacy policy and terms of service.

  • Polygon.io Privacy Policy: https://polygon.io/legal/privacy
  • Data Handling: This server does not store or cache any user data. All requests are proxied directly to Polygon.io's API.
  • API Key: Your Polygon.io API key is used only for authenticating requests to their API.

Contributing

If you found a bug or have an idea for a new feature, please first discuss it with us by submitting a new issue. We will respond to issues within at most 3 weeks. We're also open to volunteers if you want to submit a PR for any open issues but please discuss it with us beforehand. PRs that aren't linked to an existing issue or discussed with us ahead of time will generally be declined.

Metadata

Release files for iflow-mcp_mcp_polygon 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_mcp_polygon 0.5.1
File Size Uploaded
iflow_mcp_mcp_polygon-0.5.1.tar.gz 88.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_mcp_polygon 0.5.1
File Interpreter ABI Platform
iflow_mcp_mcp_polygon-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 101.2 kB

Release files / iflow_mcp_mcp_polygon-0.5.1.tar.gz

Download URL iflow_mcp_mcp_polygon-0.5.1.tar.gz
Size 88.9 kB
Tags Source
SHA-256 checksum
How to use checksums
29fd823c80aa637236fc099d01cda715f0d731d973eb27b0e9f7955e7c5c8b86
BLAKE2b-256 checksum
How to use checksums
068ba8ae83639e4edc6ae7767499730126ab7398f1d4ba600aceaab3b6fac731
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release files / iflow_mcp_mcp_polygon-0.5.1-py3-none-any.whl

Download URL iflow_mcp_mcp_polygon-0.5.1-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23a9c9aca0f1f985ab3fe0bde51f195cabef009e8bfebb3471bd57ecdb2d949f
BLAKE2b-256 checksum
How to use checksums
9d87f8ea4d6153ca5c90ff9df11e5325ec5b10c4e3c2636c306a3513f03d340f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page