intervals-mcp-server 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 rayonreal
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,151 @@
1
+ # intervals-mcp-server (TypeScript)
2
+
3
+ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for the
4
+ [Intervals.icu](https://intervals.icu) API. Connects Claude, Cursor, ChatGPT and
5
+ any other MCP client to your training data — activities, events, wellness
6
+ metrics, power curves, gear and custom items.
7
+
8
+ Zero-config first run: `npx intervals-mcp-server` walks you through
9
+ authentication in your terminal and saves everything for future runs.
10
+
11
+ > TypeScript rewrite of the original Python server
12
+ > ([mvilanova/intervals-mcp-server](https://github.com/mvilanova/intervals-mcp-server)),
13
+ > with npm packaging and interactive onboarding. Same 20 tools, same tool names.
14
+
15
+ ## Requirements
16
+
17
+ - Node.js ≥ 18.19
18
+ - An [Intervals.icu](https://intervals.icu) account
19
+
20
+ ## Quick start
21
+
22
+ ### 1. Authenticate (once)
23
+
24
+ ```bash
25
+ npx intervals-mcp-server auth
26
+ ```
27
+
28
+ The wizard will:
29
+
30
+ 1. Open <https://intervals.icu/settings> in your browser
31
+ 2. Ask you to copy two values from that page:
32
+ - **API Key** — the "API Key" row, click *Show*
33
+ - **Athlete ID** — shown on the same page (e.g. `123456` or `i12345`)
34
+ 3. Verify them against the live API
35
+ 4. Save them to `~/.config/intervals-mcp-server/config.json` (permissions `0600`)
36
+ 5. Print ready-to-paste snippets for your MCP client
37
+
38
+ ### 2. Add the server to your MCP client
39
+
40
+ **Claude Code**
41
+
42
+ ```bash
43
+ claude mcp add intervals -s user -- npx intervals-mcp-server
44
+ ```
45
+
46
+ **Claude Desktop** — `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
47
+
48
+ ```json
49
+ {
50
+ "mcpServers": {
51
+ "intervals": { "command": "npx", "args": ["intervals-mcp-server"] }
52
+ }
53
+ }
54
+ ```
55
+
56
+ **Cursor** — `~/.cursor/mcp.json`:
57
+
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "intervals": { "command": "npx", "args": ["intervals-mcp-server"] }
62
+ }
63
+ }
64
+ ```
65
+
66
+ Done — the client spawns the server via `npx` and all tools are available.
67
+
68
+ > **Why a config file instead of env vars?** MCP clients spawn servers with a
69
+ > minimal environment, so shell exports like `API_KEY` are not inherited
70
+ > automatically. The wizard-written config file works everywhere. Env vars are
71
+ > still supported and take precedence when declared in the client config.
72
+
73
+ ### Alternative: environment variables
74
+
75
+ If you prefer declaring credentials in your MCP client config:
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "intervals": {
81
+ "command": "npx",
82
+ "args": ["intervals-mcp-server"],
83
+ "env": {
84
+ "API_KEY": "your-api-key",
85
+ "ATHLETE_ID": "your-athlete-id"
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ Resolution order: `API_KEY` / `ATHLETE_ID` env vars → config file.
93
+ `INTERVALS_API_BASE_URL` overrides the API base URL (default `https://intervals.icu/api/v1`).
94
+
95
+ ## Tools (20)
96
+
97
+ | Area | Tools |
98
+ |---|---|
99
+ | Activities | `get_activities`, `get_activity_details`, `get_activity_intervals`, `get_activity_streams`, `get_activity_messages`, `add_activity_message` |
100
+ | Events & calendar | `get_events`, `get_event_by_id`, `add_or_update_event`, `add_or_update_note`, `delete_event`, `delete_events_by_date_range` |
101
+ | Wellness | `get_wellness_data` |
102
+ | Power curves | `get_athlete_power_curves` |
103
+ | Gear | `get_gear_list` |
104
+ | Custom items | `get_custom_items`, `get_custom_item_by_id`, `create_custom_item`, `update_custom_item`, `delete_custom_item` |
105
+
106
+ Tool names and parameters match the original Python server, so existing
107
+ prompts and integrations keep working.
108
+
109
+ ## CLI reference
110
+
111
+ ```
112
+ intervals-mcp-server # onboarding check (first run), then serve over stdio
113
+ intervals-mcp-server auth # (re)run the credential wizard
114
+ intervals-mcp-server serve # start the server without the onboarding check
115
+ --transport stdio|streamable-http # transport (default stdio)
116
+ --host <host> # HTTP host (default 127.0.0.1)
117
+ --port <port> # HTTP port (default 8765)
118
+ ```
119
+
120
+ ### Streamable HTTP transport
121
+
122
+ For remote setups (e.g. behind a tunnel for ChatGPT custom connectors):
123
+
124
+ ```bash
125
+ npx intervals-mcp-server serve --transport streamable-http --port 8765
126
+ # MCP endpoint: http://127.0.0.1:8765/mcp
127
+ ```
128
+
129
+ ## Development
130
+
131
+ ```bash
132
+ pnpm install
133
+ pnpm build # tsup → dist/
134
+ pnpm test # vitest (99 tests)
135
+ pnpm typecheck # tsc --noEmit
136
+ pnpm smoke # end-to-end: spawn server, listTools, live API calls
137
+ # (needs API_KEY / ATHLETE_ID)
138
+ ```
139
+
140
+ ### Publishing
141
+
142
+ ```bash
143
+ npm login
144
+ npm publish # with 2FA enabled: npm publish --otp=123456
145
+ ```
146
+
147
+ `prepublishOnly` runs build + tests automatically.
148
+
149
+ ## License
150
+
151
+ [MIT](./LICENSE)
@@ -0,0 +1,2 @@
1
+
2
+ export { }