Skip to content

Commit 051bdd8

Browse files
author
Polygon
committed
WIP add get-aggs and get-trades
1 parent d1f49dd commit 051bdd8

File tree

7 files changed

+546
-192
lines changed

7 files changed

+546
-192
lines changed

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,21 @@ wheels/
88

99
# Virtual environments
1010
.venv
11+
.env
12+
venv/
13+
env/
14+
ENV/
15+
.python-version
16+
17+
# IDE-specific files
18+
.idea/
19+
.vscode/
20+
*.swp
21+
*.swo
22+
23+
# OS-specific files
24+
.DS_Store
25+
Thumbs.db
26+
27+
# Environment and secrets
28+
.env.local

README.md

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# mcp-polygon MCP server
1+
# mcp_polygon MCP server
22

3-
A MCP server project
3+
A MCP server project that provides access to Polygon.io financial market data through the MCP protocol.
44

55
## Components
66

@@ -19,14 +19,45 @@ The server provides a single prompt:
1919

2020
### Tools
2121

22-
The server implements one tool:
23-
- add-note: Adds a new note to the server
24-
- Takes "name" and "content" as required string arguments
25-
- Updates server state and notifies clients of resource changes
22+
The server implements the following tools:
23+
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
28+
29+
2. Polygon.io Financial Data:
30+
- get-aggs: Gets aggregated stock data for a time period
31+
- Required parameters:
32+
- ticker: Stock ticker symbol (e.g., AAPL)
33+
- from_date: Start date in YYYY-MM-DD format
34+
- to_date: End date in YYYY-MM-DD format
35+
- Optional parameters:
36+
- multiplier: Size of the timespan multiplier (default: 1)
37+
- timespan: Size of the time window (minute, hour, day, week, month, quarter, year) (default: day)
38+
- limit: Number of results to return (default: 10)
39+
40+
- get-trades: Gets historical trade data for a ticker on a specific date
41+
- Required parameters:
42+
- ticker: Stock ticker symbol (e.g., AAPL)
43+
- date: Date for trades in YYYY-MM-DD format
44+
- Optional parameters:
45+
- timestamp: Timestamp in Unix milliseconds format (default: 0)
46+
- limit: Number of results to return (default: 10)
2647

2748
## Configuration
2849

29-
[TODO: Add configuration details specific to your implementation]
50+
### Environment Variables
51+
52+
The following environment variables must be set for the server to function properly:
53+
54+
- `POLYGON_API_KEY`: Your Polygon.io API key
55+
56+
You can set this environment variable before running the server:
57+
58+
```bash
59+
export POLYGON_API_KEY="your_polygon_api_key_here"
60+
```
3061

3162
## Quickstart
3263

@@ -41,13 +72,13 @@ On Windows: `%APPDATA%/Claude/claude_desktop_config.json`
4172
<summary>Development/Unpublished Servers Configuration</summary>
4273
```
4374
"mcpServers": {
44-
"mcp-polygon": {
75+
"mcp_polygon": {
4576
"command": "uv",
4677
"args": [
4778
"--directory",
48-
"/path/to/mcp-polygon",
79+
"/path/to/mcp_polygon",
4980
"run",
50-
"mcp-polygon"
81+
"mcp_polygon"
5182
]
5283
}
5384
}
@@ -58,10 +89,10 @@ On Windows: `%APPDATA%/Claude/claude_desktop_config.json`
5889
<summary>Published Servers Configuration</summary>
5990
```
6091
"mcpServers": {
61-
"mcp-polygon": {
92+
"mcp_polygon": {
6293
"command": "uvx",
6394
"args": [
64-
"mcp-polygon"
95+
"mcp_polygon"
6596
]
6697
}
6798
}
@@ -104,7 +135,7 @@ experience, we strongly recommend using the [MCP Inspector](https://github.com/m
104135
You can launch the MCP Inspector via [`npm`](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) with this command:
105136

106137
```bash
107-
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-polygon run mcp-polygon
138+
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp_polygon run mcp_polygon
108139
```
109140

110141

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[project]
2-
name = "mcp-polygon"
2+
name = "mcp_polygon"
33
version = "0.1.0"
44
description = "A MCP server project"
55
readme = "README.md"
66
requires-python = ">=3.13"
77
dependencies = [
8-
"mcp>=1.4.1",
8+
"mcp[cli]>=1.4.1",
99
"polygon-api-client>=1.14.4",
1010
]
1111
[[project.authors]]
@@ -17,4 +17,4 @@ requires = [ "hatchling",]
1717
build-backend = "hatchling.build"
1818

1919
[project.scripts]
20-
mcp-polygon = "mcp-polygon:main"
20+
mcp_polygon = "mcp_polygon:main"

src/mcp-polygon/server.py

Lines changed: 0 additions & 164 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)