Skip to content

Commit 53ab0b9

Browse files
author
Polygon
committed
Update README.md
1 parent a0d8a5d commit 53ab0b9

File tree

1 file changed

+65
-53
lines changed

1 file changed

+65
-53
lines changed

README.md

Lines changed: 65 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,105 @@
1-
# mcp_polygon MCP server
1+
# Polygon.io MCP Server
22

3-
A MCP server project that provides access to Polygon.io financial market data through the MCP protocol.
3+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that provides access to [Polygon.io](https://polygon.io) financial market data API through an LLM-friendly interface.
44

5-
## Components
5+
## Overview
66

7-
### Resources
7+
This server exposes all Polygon.io API endpoints as MCP tools, providing access to comprehensive financial market data including:
88

9-
The server implements a simple note storage system with:
10-
- Custom note:// URI scheme for accessing individual notes
11-
- Each note resource has a name, description and text/plain mimetype
9+
- Stock, options, forex, and crypto aggregates and bars
10+
- Real-time and historical trades and quotes
11+
- Market snapshots
12+
- Ticker details and reference data
13+
- Dividends and splits data
14+
- Financial fundamentals
15+
- Market status and holidays
1216

13-
### Prompts
17+
## Installation
1418

15-
The server provides a single prompt:
16-
- summarize-notes: Creates summaries of all stored notes
17-
- Optional "style" argument to control detail level (brief/detailed)
18-
- Generates prompt combining all current notes with style preference
19+
### Prerequisites
1920

20-
### Tools
21+
- Python 3.8+
22+
- A Polygon.io API key ([Get one here](https://polygon.io))
2123

22-
The server implements the following tools:
24+
### Direct Installation
2325

24-
1. Note Management:
25-
- add-note: Adds a new note to the server
26-
- Takes "name" and "content" as required string arguments
27-
- Updates server state and notifies clients of resource changes
26+
```bash
27+
# Install dependencies
28+
uv sync
2829

29-
2. All of the Polygon API endpoints supported by the python client.
30+
# Run the server
31+
POLYGON_API_KEY=your_api_key_here uv run mcp_polygon
32+
```
3033

31-
## Configuration
34+
### Integration with Claude
3235

33-
### Environment Variables
36+
For Claude users, you can add the Polygon MCP server:
3437

35-
The following environment variables must be set for the server to function properly:
38+
```bash
39+
# Claude CLI
40+
claude mcp add polygon -e POLYGON_API_KEY=your_api_key_here -- uv run /path/to/mcp_polygon/entrypoint.py
41+
```
3642

37-
- `POLYGON_API_KEY`: Your Polygon.io API key
43+
## Usage Examples
3844

39-
You can set this environment variable before running the server:
45+
Once integrated, you can prompt Claude to access Polygon.io data:
4046

41-
```bash
42-
export POLYGON_API_KEY="your_polygon_api_key_here"
4347
```
48+
Get the latest price for AAPL stock
49+
Show me yesterday's trading volume for MSFT
50+
What were the biggest stock market gainers today?
51+
Get me the latest crypto market data for BTC-USD
52+
```
53+
54+
## Available Tools
55+
56+
This MCP server implements all Polygon.io API endpoints as tools, including:
4457

45-
## Quickstart
58+
- `get_aggs` - Stock aggregates (OHLC) data for a specific ticker
59+
- `list_trades` - Historical trade data
60+
- `get_last_trade` - Latest trade for a symbol
61+
- `list_ticker_news` - Recent news articles for tickers
62+
- `get_snapshot_ticker` - Current market snapshot for a ticker
63+
- `get_market_status` - Current market status and trading hours
64+
- `list_stock_financials` - Fundamental financial data
65+
- And many more...
4666

47-
### Install
67+
Each tool follows the Polygon.io SDK parameter structure while converting responses to standard JSON that LLMs can easily process.
4868

49-
#### Claude code
69+
## Configuration
70+
71+
### Environment Variables
5072

51-
`claude mcp add polygon -e POLYGON_API_KEY=$POLY_API_KEY -- uv run /path/to/mcp_polygon/entrypoint.py`
73+
- `POLYGON_API_KEY` (required): Your Polygon.io API key
5274

5375
## Development
5476

5577
### Building and Publishing
5678

57-
To prepare the package for distribution:
58-
59-
1. Sync dependencies and update lockfile:
6079
```bash
80+
# Sync dependencies
6181
uv sync
62-
```
6382

64-
2. Build package distributions:
65-
```bash
83+
# Build package distributions
6684
uv build
6785
```
6886

69-
This will create source and wheel distributions in the `dist/` directory.
70-
71-
3. Publish to PyPI:
72-
```bash
73-
uv publish
74-
```
75-
76-
Note: You'll need to set PyPI credentials via environment variables or command flags:
77-
- Token: `--token` or `UV_PUBLISH_TOKEN`
78-
- Or username/password: `--username`/`UV_PUBLISH_USERNAME` and `--password`/`UV_PUBLISH_PASSWORD`
79-
8087
### Debugging
8188

82-
Since MCP servers run over stdio, debugging can be challenging. For the best debugging
83-
experience, we strongly recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).
84-
85-
86-
You can launch the MCP Inspector via [`npm`](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) with this command:
89+
For debugging and testing, we recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector):
8790

8891
```bash
8992
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp_polygon run mcp_polygon
9093
```
9194

95+
This will launch a browser interface where you can interact with your MCP server directly and see input/output for each tool.
96+
97+
## License
98+
99+
[License information]
100+
101+
## Links
92102

93-
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
103+
- [Polygon.io Documentation](https://polygon.io/docs)
104+
- [Model Context Protocol](https://modelcontextprotocol.io)
105+
- [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk)

0 commit comments

Comments
 (0)