scrumdo-mcp 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,200 @@
1
+ Metadata-Version: 2.4
2
+ Name: scrumdo-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server for ScrumDo boards — connect any AI tool directly to your board
5
+ Project-URL: Homepage, https://www.scrumdo.com
6
+ Project-URL: Documentation, https://github.com/ScrumDoLLC/scrumdo-mcp#readme
7
+ Project-URL: Repository, https://github.com/ScrumDoLLC/scrumdo-mcp
8
+ Project-URL: Bug Tracker, https://github.com/ScrumDoLLC/scrumdo-mcp/issues
9
+ Author-email: ScrumDo LLC <support@scrumdo.com>
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: agile,ai,claude,cursor,kanban,llm,mcp,model-context-protocol,scrum,scrumdo,windsurf
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Office/Business :: Scheduling
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.11
22
+ Requires-Dist: httpx>=0.27.0
23
+ Requires-Dist: mcp[cli]>=1.3.0
24
+ Requires-Dist: pydantic>=2.0.0
25
+ Requires-Dist: python-dotenv>=1.0.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
28
+ Requires-Dist: pytest>=8.0; extra == 'dev'
29
+ Requires-Dist: respx>=0.21; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # scrumdo-mcp
33
+
34
+ Connect any MCP-compatible AI tool (Claude Code, Cursor, Windsurf, and others) directly to your [ScrumDo](https://www.scrumdo.com) boards.
35
+
36
+ Once installed, your AI assistant can read cards, move them, create tasks, post comments, and search across your board — without you copy-pasting anything.
37
+
38
+ ---
39
+
40
+ ## Installation
41
+
42
+ ```bash
43
+ pip install scrumdo-mcp
44
+ ```
45
+
46
+ > **Pre-release / before PyPI publish:** install directly from GitHub:
47
+ > ```bash
48
+ > pip install git+https://github.com/ScrumDoLLC/scrumdo-mcp.git
49
+ > ```
50
+
51
+ ---
52
+
53
+ ## Cursor quick-start
54
+
55
+ **1 — Install**
56
+ ```bash
57
+ # To run the server only:
58
+ pip install git+https://github.com/ScrumDoLLC/scrumdo-mcp.git
59
+
60
+ # To run tests too:
61
+ git clone https://github.com/ScrumDoLLC/scrumdo-mcp.git
62
+ cd scrumdo-mcp
63
+ pip install -e ".[dev]"
64
+ pytest tests/ -v
65
+ ```
66
+
67
+ **2 — Get your token**
68
+
69
+ Log in to ScrumDo → your org → **Settings → API Tokens → Create Token**. Copy it — shown once only.
70
+
71
+ **3 — Add to `~/.cursor/mcp.json`**
72
+
73
+ ```json
74
+ {
75
+ "mcpServers": {
76
+ "scrumdo": {
77
+ "command": "scrumdo-mcp",
78
+ "env": {
79
+ "SCRUMDO_TOKEN": "your-token-here",
80
+ "SCRUMDO_ORG": "your-org-slug",
81
+ "SCRUMDO_PROJECT": "your-default-project-slug"
82
+ }
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ Your org and project slugs are the short names in your board URL:
89
+ `app.scrumdo.com/`**`my-company`**`/`**`engineering`**
90
+
91
+ **4 — Restart Cursor**
92
+
93
+ Done. In any Cursor chat you can now ask:
94
+ - *"What cards are in the current sprint?"*
95
+ - *"Move ENG-42 to In Review"*
96
+ - *"Add a comment to ENG-42: PR is up for review"*
97
+ - *"List all cards assigned to me"*
98
+
99
+ ---
100
+
101
+ ## Setup
102
+
103
+ ### Step 1 — Get your token
104
+
105
+ Log in to ScrumDo → your organization → **Settings → API Tokens → Create Token**.
106
+
107
+ Copy the token — it is only shown once. This is your personal key; keep it private.
108
+
109
+ ### Step 2 — Configure your AI tool
110
+
111
+ Find your tool's MCP config file and add the `scrumdo` server entry:
112
+
113
+ | Tool | Config file |
114
+ |------|-------------|
115
+ | Claude Code | `~/.claude/claude.json` |
116
+ | Cursor | `~/.cursor/mcp.json` |
117
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` |
118
+
119
+ ```json
120
+ {
121
+ "mcpServers": {
122
+ "scrumdo": {
123
+ "command": "scrumdo-mcp",
124
+ "env": {
125
+ "SCRUMDO_TOKEN": "your-token-here",
126
+ "SCRUMDO_ORG": "your-org-slug",
127
+ "SCRUMDO_PROJECT": "your-default-project-slug"
128
+ }
129
+ }
130
+ }
131
+ }
132
+ ```
133
+
134
+ Your org slug and project slug are the short names in your board URL:
135
+ `app.scrumdo.com/`**`my-company`**`/`**`engineering`**
136
+
137
+ ### Step 3 — Restart your AI tool
138
+
139
+ Done. Your AI assistant now has direct access to your board.
140
+
141
+ ---
142
+
143
+ ## What you can do
144
+
145
+ Once connected, just talk to your AI tool naturally:
146
+
147
+ ```
148
+ "What's the status of ENG-42?"
149
+ "Move ENG-42 to In Review and add a comment saying the PR is up"
150
+ "List all cards assigned to me in the current sprint"
151
+ "Create a sub-task on ENG-42: write release notes"
152
+ "Search for cards about the login bug"
153
+ "What did the team work on this week?"
154
+ ```
155
+
156
+ ---
157
+
158
+ ## Available tools (41 total)
159
+
160
+ | Group | Tools |
161
+ |-------|-------|
162
+ | **Boards** | `list_boards`, `get_board`, `get_board_cells`, `list_iterations`, `list_labels`, `list_epics` |
163
+ | **Cards** | `list_cards`, `get_card`, `find_card`, `create_card`, `update_card`, `move_card`, `set_card_field`, `archive_card`, `assign_card`, `add_card_label`, `remove_card_label` |
164
+ | **Tasks** | `list_tasks`, `create_task`, `complete_task`, `reopen_task`, `update_task`, `delete_task` |
165
+ | **Comments** | `list_comments`, `add_comment`, `delete_comment` |
166
+ | **Fields** | `list_custom_fields`, `get_card_field`, `get_all_card_fields` |
167
+ | **Members** | `list_members`, `find_member` |
168
+ | **Search** | `search_cards`, `search_by_field_value` |
169
+ | **Activity** | `log_activity`, `get_activity_log`, `get_workspace_activity` |
170
+ | **Webhooks** | `list_webhooks`, `create_webhook`, `delete_webhook` |
171
+ | **Time** | `list_time_entries`, `log_time` |
172
+
173
+ ---
174
+
175
+ ## Environment variables
176
+
177
+ | Variable | Default | Description |
178
+ |----------|---------|-------------|
179
+ | `SCRUMDO_TOKEN` | — | **Required.** API token from Settings → API Tokens |
180
+ | `SCRUMDO_BASE_URL` | `https://app.spryng.io` | API base URL |
181
+ | `SCRUMDO_ORG` | — | Your organization slug |
182
+ | `SCRUMDO_PROJECT` | — | Default project slug |
183
+
184
+ ---
185
+
186
+ ## Token scope
187
+
188
+ Your API token is restricted to your organization's board data only — cards, tasks, comments, members, iterations. It cannot access billing, account settings, or any other organization's data. Revoke it at any time from Settings → API Tokens.
189
+
190
+ ---
191
+
192
+ ## What is MCP?
193
+
194
+ [Model Context Protocol](https://modelcontextprotocol.io) is an open standard for connecting AI tools to external services. Claude Code, Cursor, Windsurf, and other AI editors support it natively. Install the server once; any MCP-compatible tool can use it.
195
+
196
+ ---
197
+
198
+ ## License
199
+
200
+ MIT
@@ -0,0 +1,20 @@
1
+ spryng_mcp/__init__.py,sha256=-WB8mkIUoSP6l6Q9IejOIcR4HZWXf7Dz0fk66RrwD1E,61
2
+ spryng_mcp/client.py,sha256=LbT1TjLnEegVxLwKGlZKmNcmqL97jDgHMuJL6URgf-M,13284
3
+ spryng_mcp/config.py,sha256=oIZSRrTNHv7MA0-zX3EtDQYe5rRLM_blU41mEUwbUSU,1691
4
+ spryng_mcp/server.py,sha256=ByRilHOe6lcncLHRzKmnvd-m3hXOj3GbQs1eSalCHpU,3244
5
+ spryng_mcp/tools/__init__.py,sha256=udfeBNbdGQGGVNTvl4v1NM4fNX9LvCfIuaKWzWN6BvA,67
6
+ spryng_mcp/tools/activity.py,sha256=LS2PzhDUl2Vujg24VfopkGOeNPnihqX6rlKKKVgJhs0,8633
7
+ spryng_mcp/tools/boards.py,sha256=N1uEf2ObCJ-tRIayRPP4EjYQ4MXu_wmA27hfT6C9stc,2636
8
+ spryng_mcp/tools/cards.py,sha256=bl2ipsrncOBGUVG9g9a6mFVaCo5_wugY_PfH20jMZzs,9208
9
+ spryng_mcp/tools/comments.py,sha256=usJMCcMY2OJiBwE7DQsxlUrDA0LgW_hFnDjVPTp2Gf4,1643
10
+ spryng_mcp/tools/fields.py,sha256=GRrfNt1Dj4SyzYf781KjPfuRQH-bIiUBVTzSNlBxci4,1782
11
+ spryng_mcp/tools/members.py,sha256=p5NsgrG_8NCKBYpeWwrOwcnDPqTVZ_F5VkrIobDyiiw,1341
12
+ spryng_mcp/tools/search.py,sha256=5IQnMKEzl-Nskju0D91c9rT9b73zJWBBBJqPsq4oLBo,1601
13
+ spryng_mcp/tools/tasks.py,sha256=rLW-O2AoLnMe-EjhcBY2SOK17cVuobdmCxTtkq805yA,3417
14
+ spryng_mcp/tools/time_tracking.py,sha256=6gmK5OM5ugFjp9RvRHrkczkVQrZJs9lx44oq9qUBaK8,1482
15
+ spryng_mcp/tools/webhooks.py,sha256=Q7V6vZT4joOOmGDmLbr9XEjkttBn3sTU8h-7nAX37LI,1629
16
+ scrumdo_mcp-0.1.0.dist-info/METADATA,sha256=_mTZnpt4dlws6NFtRGPAHA0F-lxCMWTZJAUO1Tb99U8,6140
17
+ scrumdo_mcp-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
18
+ scrumdo_mcp-0.1.0.dist-info/entry_points.txt,sha256=DAX9wAWRMooYhwt1uPCmmUvwgUFi7QK5Z-0sB0faXPI,55
19
+ scrumdo_mcp-0.1.0.dist-info/licenses/LICENSE,sha256=GJflU7PUHt4423mGA-LqqAXsXZ-yiASRE0LqVreeKiM,1068
20
+ scrumdo_mcp-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ scrumdo-mcp = spryng_mcp.server:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ScrumDo LLC
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.
spryng_mcp/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """spryng_mcp — MCP server for ScrumDo / Spryng boards."""
spryng_mcp/client.py ADDED
@@ -0,0 +1,272 @@
1
+ """Async HTTP client for the ScrumDo / Spryng REST API."""
2
+ from __future__ import annotations
3
+
4
+ from typing import Any
5
+
6
+ import httpx
7
+
8
+ from .config import Config
9
+
10
+
11
+ class SpryngClient:
12
+ """
13
+ Thin async wrapper around the ScrumDo API.
14
+
15
+ All methods raise httpx.HTTPStatusError on 4xx/5xx responses.
16
+ The caller (tool layer) is responsible for presenting errors to the LLM.
17
+ """
18
+
19
+ def __init__(self) -> None:
20
+ self._http = httpx.AsyncClient(
21
+ headers={
22
+ "Authorization": f"Bearer {Config.token}",
23
+ "Content-Type": "application/json",
24
+ "Accept": "application/json",
25
+ },
26
+ timeout=30.0,
27
+ )
28
+ # Cache: human-readable card ref (e.g. "ON-914") → numeric story id
29
+ self._card_id_cache: dict[str, int] = {}
30
+
31
+ async def __aenter__(self) -> "SpryngClient":
32
+ return self
33
+
34
+ async def __aexit__(self, *_: Any) -> None:
35
+ await self._http.aclose()
36
+
37
+ # ── Card-ref resolution ───────────────────────────────────────────────────
38
+
39
+ async def _resolve_card_id(self, card_ref: str) -> int:
40
+ """
41
+ Convert a human-readable card reference like 'ON-914' into the
42
+ numeric database story id required by the /stories/{id}/ endpoints.
43
+
44
+ The API does not expose a reference-based lookup; we resolve by
45
+ scanning the paginated story list and matching on the ``number``
46
+ field (which equals the local_id / project-scoped sequence number).
47
+
48
+ Results are cached on the client instance so each ref is resolved
49
+ only once per session.
50
+ """
51
+ # Fast path: caller already has a numeric id
52
+ if isinstance(card_ref, int) or (
53
+ isinstance(card_ref, str) and card_ref.lstrip("-").isdigit()
54
+ ):
55
+ return int(card_ref)
56
+
57
+ # Cache hit
58
+ if card_ref in self._card_id_cache:
59
+ return self._card_id_cache[card_ref]
60
+
61
+ # Parse the number portion from e.g. "ON-914" → 914
62
+ parts = card_ref.rsplit("-", 1)
63
+ if len(parts) != 2 or not parts[1].isdigit():
64
+ raise ValueError(
65
+ f"Cannot parse card reference {card_ref!r}. "
66
+ "Expected format: PREFIX-NUMBER (e.g. 'ON-914')."
67
+ )
68
+ target_number = int(parts[1])
69
+
70
+ # Scan story list pages (100 items/page, max ~10 pages for most boards)
71
+ page = 1
72
+ while True:
73
+ data = await self.get(
74
+ Config.project_url("stories/"), page=page, page_size=100
75
+ )
76
+ items = data.get("items", []) if isinstance(data, dict) else data
77
+ for story in items:
78
+ if story.get("number") == target_number:
79
+ story_id: int = story["id"]
80
+ self._card_id_cache[card_ref] = story_id
81
+ return story_id
82
+ # Stop when there are no more pages
83
+ has_next = isinstance(data, dict) and bool(data.get("next"))
84
+ if not has_next or not items:
85
+ break
86
+ page += 1
87
+
88
+ raise ValueError(
89
+ f"Card {card_ref!r} (number={target_number}) not found in "
90
+ f"project {Config.project!r}."
91
+ )
92
+
93
+ # ── Generic helpers ───────────────────────────────────────────────────────
94
+
95
+ async def get(self, url: str, **params: Any) -> Any:
96
+ r = await self._http.get(url, params=params or None)
97
+ r.raise_for_status()
98
+ return r.json()
99
+
100
+ async def post(self, url: str, body: dict[str, Any]) -> Any:
101
+ r = await self._http.post(url, json=body)
102
+ r.raise_for_status()
103
+ return r.json()
104
+
105
+ async def patch(self, url: str, body: dict[str, Any]) -> Any:
106
+ r = await self._http.patch(url, json=body)
107
+ r.raise_for_status()
108
+ return r.json()
109
+
110
+ async def put(self, url: str, body: dict[str, Any]) -> Any:
111
+ r = await self._http.put(url, json=body)
112
+ r.raise_for_status()
113
+ return r.json()
114
+
115
+ async def delete(self, url: str) -> int:
116
+ r = await self._http.delete(url)
117
+ r.raise_for_status()
118
+ return r.status_code
119
+
120
+ # ── Boards / Projects ──────────────────────────────────────────────────────
121
+
122
+ async def list_boards(self) -> list[dict]:
123
+ data = await self.get(Config.org_url("projects/"))
124
+ return data if isinstance(data, list) else data.get("projects", data)
125
+
126
+ async def get_board(self, project_slug: str | None = None) -> dict:
127
+ slug = project_slug or Config.project
128
+ return await self.get(Config.org_url(f"projects/{slug}/"))
129
+
130
+ async def get_board_cells(self, project_slug: str | None = None) -> list[dict]:
131
+ slug = project_slug or Config.project
132
+ data = await self.get(Config.project_url("boardcell/") if not project_slug
133
+ else Config.api(f"organizations/{Config.org}/projects/{slug}/boardcell/"))
134
+ return data if isinstance(data, list) else data.get("cells", data)
135
+
136
+ # ── Cards / Stories ────────────────────────────────────────────────────────
137
+
138
+ async def list_cards(self, **filters: Any) -> dict:
139
+ return await self.get(Config.project_url("stories/"), **filters)
140
+
141
+ async def get_card(self, card_ref: str) -> dict:
142
+ """card_ref is the full reference like 'ON-914'."""
143
+ story_id = await self._resolve_card_id(card_ref)
144
+ return await self.get(Config.project_url(f"stories/{story_id}/"))
145
+
146
+ async def create_card(self, body: dict[str, Any]) -> dict:
147
+ return await self.post(Config.project_url("stories/"), body)
148
+
149
+ async def update_card(self, card_ref: str, body: dict[str, Any]) -> dict:
150
+ story_id = await self._resolve_card_id(card_ref)
151
+ return await self.patch(Config.project_url(f"stories/{story_id}/"), body)
152
+
153
+ async def delete_card(self, card_ref: str) -> int:
154
+ story_id = await self._resolve_card_id(card_ref)
155
+ return await self.delete(Config.project_url(f"stories/{story_id}/"))
156
+
157
+ # ── Tasks ──────────────────────────────────────────────────────────────────
158
+
159
+ async def list_tasks(self, card_ref: str) -> list[dict]:
160
+ story_id = await self._resolve_card_id(card_ref)
161
+ data = await self.get(Config.project_url(f"stories/{story_id}/tasks/"))
162
+ return data if isinstance(data, list) else data.get("tasks", data)
163
+
164
+ async def create_task(self, card_ref: str, body: dict[str, Any]) -> dict:
165
+ story_id = await self._resolve_card_id(card_ref)
166
+ return await self.post(Config.project_url(f"stories/{story_id}/tasks/"), body)
167
+
168
+ async def update_task(self, card_ref: str, task_id: int, body: dict[str, Any]) -> dict:
169
+ story_id = await self._resolve_card_id(card_ref)
170
+ return await self.patch(Config.project_url(f"stories/{story_id}/tasks/{task_id}/"), body)
171
+
172
+ async def delete_task(self, card_ref: str, task_id: int) -> int:
173
+ story_id = await self._resolve_card_id(card_ref)
174
+ return await self.delete(Config.project_url(f"stories/{story_id}/tasks/{task_id}/"))
175
+
176
+ # ── Comments ───────────────────────────────────────────────────────────────
177
+
178
+ async def list_comments(self, card_id: int) -> list[dict]:
179
+ data = await self.get(Config.api("comments/story/"), story=card_id)
180
+ return data if isinstance(data, list) else data.get("comments", data)
181
+
182
+ async def add_comment(self, card_id: int, body: str) -> dict:
183
+ return await self.post(Config.api("comments/story/"), {"story": card_id, "comment": body})
184
+
185
+ async def delete_comment(self, comment_id: int) -> int:
186
+ return await self.delete(Config.api(f"comments/story/{comment_id}/"))
187
+
188
+ # ── Custom fields ──────────────────────────────────────────────────────────
189
+
190
+ async def list_custom_fields(self, project_slug: str | None = None) -> list[dict]:
191
+ slug = project_slug or Config.project
192
+ data = await self.get(
193
+ Config.api(f"organizations/{Config.org}/projects/{slug}/customfields/")
194
+ )
195
+ return data if isinstance(data, list) else data.get("customfields", data)
196
+
197
+ async def set_custom_field(self, card_ref: str, field_id: int, value: str) -> dict:
198
+ """
199
+ Sets a single custom field on a card.
200
+ Fetches the card first to preserve existing extra_fields.
201
+ """
202
+ story_id = await self._resolve_card_id(card_ref)
203
+ card = await self.get(Config.project_url(f"stories/{story_id}/"))
204
+ extra = card.get("extra_fields") or {}
205
+ extra[str(field_id)] = value
206
+ return await self.patch(
207
+ Config.project_url(f"stories/{story_id}/"),
208
+ {"extra_fields": extra},
209
+ )
210
+
211
+ # ── Members ────────────────────────────────────────────────────────────────
212
+
213
+ async def list_members(self, project_slug: str | None = None) -> list[dict]:
214
+ slug = project_slug or Config.project
215
+ data = await self.get(
216
+ Config.api(f"organizations/{Config.org}/projects/{slug}/members/")
217
+ )
218
+ return data if isinstance(data, list) else data.get("members", data)
219
+
220
+ # ── Iterations ─────────────────────────────────────────────────────────────
221
+
222
+ async def list_iterations(self) -> list[dict]:
223
+ data = await self.get(Config.project_url("iterations/"))
224
+ return data if isinstance(data, list) else data.get("iterations", data)
225
+
226
+ # ── Epics ──────────────────────────────────────────────────────────────────
227
+
228
+ async def list_epics(self) -> list[dict]:
229
+ data = await self.get(Config.project_url("epics/"))
230
+ return data if isinstance(data, list) else data.get("epics", data)
231
+
232
+ # ── Labels ─────────────────────────────────────────────────────────────────
233
+
234
+ async def list_labels(self) -> list[dict]:
235
+ data = await self.get(Config.project_url("labels/"))
236
+ return data if isinstance(data, list) else data.get("labels", data)
237
+
238
+ # ── Webhooks ───────────────────────────────────────────────────────────────
239
+
240
+ async def list_webhooks(self) -> list[dict]:
241
+ data = await self.get(Config.project_url("webhooks/"))
242
+ return data if isinstance(data, list) else data.get("webhooks", data)
243
+
244
+ async def create_webhook(self, body: dict[str, Any]) -> dict:
245
+ return await self.post(Config.project_url("webhooks/"), body)
246
+
247
+ async def delete_webhook(self, webhook_id: int) -> int:
248
+ return await self.delete(Config.project_url(f"webhooks/{webhook_id}/"))
249
+
250
+ # ── Search ─────────────────────────────────────────────────────────────────
251
+
252
+ async def search(self, query: str) -> list[dict]:
253
+ data = await self.get(Config.org_url("search/"), q=query)
254
+ if isinstance(data, list):
255
+ return data
256
+ # org search endpoint returns paginated {"items": [...], "count": N, ...}
257
+ return data.get("items", data.get("results", []))
258
+
259
+ # ── Time entries ───────────────────────────────────────────────────────────
260
+
261
+ async def list_time_entries(self, card_ref: str | None = None) -> list[dict]:
262
+ if card_ref:
263
+ story_id = await self._resolve_card_id(card_ref)
264
+ url = Config.project_url(f"stories/{story_id}/time_entries/")
265
+ else:
266
+ url = Config.project_url("time_entries/")
267
+ data = await self.get(url)
268
+ return data if isinstance(data, list) else data.get("time_entries", data)
269
+
270
+ async def log_time(self, card_ref: str, body: dict[str, Any]) -> dict:
271
+ story_id = await self._resolve_card_id(card_ref)
272
+ return await self.post(Config.project_url(f"stories/{story_id}/time_entries/"), body)
spryng_mcp/config.py ADDED
@@ -0,0 +1,53 @@
1
+ """Configuration — loaded from environment variables or .env file."""
2
+ from __future__ import annotations
3
+
4
+ import os
5
+ from pathlib import Path
6
+
7
+ from dotenv import load_dotenv
8
+
9
+ # Load .env from the mcp/ directory if present
10
+ load_dotenv(Path(__file__).parent.parent / ".env")
11
+
12
+
13
+ def _env(*keys: str, default: str = "") -> str:
14
+ """Return the first non-empty value from the given env var names."""
15
+ for key in keys:
16
+ val = os.getenv(key, "")
17
+ if val:
18
+ return val
19
+ return default
20
+
21
+
22
+ class Config:
23
+ """Runtime configuration for the ScrumDo MCP server.
24
+
25
+ Accepts both SCRUMDO_* (preferred) and legacy SPRYNG_* env var names.
26
+ """
27
+
28
+ base_url: str = _env("SCRUMDO_BASE_URL", "SPRYNG_BASE_URL",
29
+ default="https://app.spryng.io").rstrip("/")
30
+ token: str = _env("SCRUMDO_TOKEN", "SPRYNG_TOKEN")
31
+ org: str = _env("SCRUMDO_ORG", "SPRYNG_ORG", default="")
32
+ project: str = _env("SCRUMDO_PROJECT", "SPRYNG_PROJECT", default="")
33
+
34
+ @classmethod
35
+ def validate(cls) -> None:
36
+ if not cls.token:
37
+ raise RuntimeError(
38
+ "SCRUMDO_TOKEN is not set. "
39
+ "Set it in your MCP config env block or in a .env file."
40
+ )
41
+
42
+ @classmethod
43
+ def api(cls, path: str) -> str:
44
+ """Build a full API URL. path is relative to /api/scrumdo/."""
45
+ return f"{cls.base_url}/api/scrumdo/{path.lstrip('/')}"
46
+
47
+ @classmethod
48
+ def org_url(cls, path: str = "") -> str:
49
+ return cls.api(f"organizations/{cls.org}/{path.lstrip('/')}")
50
+
51
+ @classmethod
52
+ def project_url(cls, path: str = "") -> str:
53
+ return cls.org_url(f"projects/{cls.project}/{path.lstrip('/')}")
spryng_mcp/server.py ADDED
@@ -0,0 +1,98 @@
1
+ """
2
+ spryng_mcp.server — FastMCP server entrypoint.
3
+
4
+ Registers all tools and starts the MCP server over stdio.
5
+
6
+ Usage:
7
+ # Run directly
8
+ python -m spryng_mcp.server
9
+
10
+ # Or via the installed CLI
11
+ spryng-mcp
12
+
13
+ # Add to Claude Code
14
+ claude mcp add spryng -- python -m spryng_mcp.server
15
+
16
+ Environment variables (set in mcp/.env or export before running):
17
+ SPRYNG_TOKEN Bearer token for the ScrumDo / Spryng API (required)
18
+ SPRYNG_BASE_URL API base URL (default: https://app.spryng.io)
19
+ SPRYNG_ORG Organisation slug (default: spryng-internal)
20
+ SPRYNG_PROJECT Default project slug (default: onboarding)
21
+ """
22
+ from __future__ import annotations
23
+
24
+ from mcp.server.fastmcp import FastMCP
25
+
26
+ from .config import Config
27
+ from .tools import (
28
+ activity,
29
+ boards,
30
+ cards,
31
+ comments,
32
+ fields,
33
+ members,
34
+ search,
35
+ tasks,
36
+ time_tracking,
37
+ webhooks,
38
+ )
39
+
40
+ # ── Server definition ──────────────────────────────────────────────────────────
41
+
42
+ mcp = FastMCP(
43
+ name="spryng",
44
+ instructions=f"""
45
+ You are connected to a ScrumDo / Spryng board.
46
+
47
+ Default context:
48
+ Organisation: {Config.org}
49
+ Project: {Config.project}
50
+ Base URL: {Config.base_url}
51
+
52
+ This MCP server gives you full Monday.com-level access to the board:
53
+ • Read and write cards (stories) with all custom fields
54
+ • Move cards between columns, assign members, manage labels
55
+ • Create, complete, and delete tasks (checklist items)
56
+ • Post and read comments
57
+ • Write and query structured activity log entries (log_activity / get_activity_log)
58
+ • Search cards by text or custom field value
59
+ • Manage webhooks, time tracking, custom fields, members, labels, and iterations
60
+
61
+ Key conventions for this project:
62
+ - Card references are in the format ON-<number>, e.g. ON-914
63
+ - Custom field IDs: 5303=Feature Identity, 5304=Promotion Status,
64
+ 5306=Branch Path, 5307=Human Review, 5422=Intended Promotion Path,
65
+ 5425=Test Contract, 5426=Outcome, 5428=Run Evidence, 5430=Feature Statement,
66
+ 5432=In Scope, 5433=Commit Links, 5436=Behavior Contract,
67
+ 5437=Out of Scope, 5439=Repos Attached
68
+ - Board cells (columns): 18531=Analyze, 20132=Being Developed,
69
+ 20133=Ready for Stage Pull, 16246=Integrated
70
+
71
+ Use log_activity() to record agent actions against cards so the workspace
72
+ activity log stays current and filterable.
73
+ """.strip(),
74
+ )
75
+
76
+ # ── Register all tool groups ───────────────────────────────────────────────────
77
+
78
+ boards.register(mcp)
79
+ cards.register(mcp)
80
+ tasks.register(mcp)
81
+ comments.register(mcp)
82
+ fields.register(mcp)
83
+ members.register(mcp)
84
+ search.register(mcp)
85
+ activity.register(mcp)
86
+ webhooks.register(mcp)
87
+ time_tracking.register(mcp)
88
+
89
+
90
+ # ── Entrypoint ─────────────────────────────────────────────────────────────────
91
+
92
+ def main() -> None:
93
+ Config.validate()
94
+ mcp.run(transport="stdio")
95
+
96
+
97
+ if __name__ == "__main__":
98
+ main()
@@ -0,0 +1 @@
1
+ """Tool modules — each registers tools on the FastMCP server."""