powerplan-mcp 0.6.0__tar.gz

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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CynaCons
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.
@@ -0,0 +1,243 @@
1
+ Metadata-Version: 2.4
2
+ Name: powerplan-mcp
3
+ Version: 0.6.0
4
+ Summary: MCP server that makes PLAN.md the operational backbone of agentic development
5
+ Author: CynaCons
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/CynaCons/powerplan
8
+ Project-URL: Repository, https://github.com/CynaCons/powerplan
9
+ Project-URL: Documentation, https://cynacons.github.io/powerplan/
10
+ Project-URL: Issues, https://github.com/CynaCons/powerplan/issues
11
+ Project-URL: Changelog, https://github.com/CynaCons/powerplan/blob/main/CHANGELOG.md
12
+ Keywords: mcp,mcp-server,plan,agents,PLAN.md,orchestration
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Software Development
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: mcp<2,>=1.0.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=8.0; extra == "dev"
30
+ Dynamic: license-file
31
+
32
+ <!-- mcp-name: io.github.cynacons/powerplan -->
33
+
34
+ # powerplan
35
+
36
+ **PLAN.md as the operational backbone of agentic development.**
37
+
38
+ `powerplan` is an [MCP](https://modelcontextprotocol.io) server that gives
39
+ coordinators and worker agents a human-language API over your project’s
40
+ `PLAN.md`: show progress, create iterations, complete tasks, keep the header
41
+ truthful — without freeform file thrash.
42
+
43
+ mcp-name: io.github.cynacons/powerplan
44
+
45
+ | | |
46
+ |---|---|
47
+ | **MCP server name** | `powerplan` |
48
+ | **PyPI** | [`powerplan-mcp`](https://pypi.org/project/powerplan-mcp/) (`powerplan` is a different, unrelated package) |
49
+ | **Registry** | `io.github.cynacons/powerplan` |
50
+ | **Status** | v0.6.0 — public package + registry listing ([PLAN.md](PLAN.md)) |
51
+ | **Site** | [GitHub Pages](https://cynacons.github.io/powerplan/) |
52
+ | **Pairs with** | [PowerSpawn](https://github.com/CynaCons/PowerSpawn) (optional) |
53
+
54
+ ---
55
+
56
+ ## Install
57
+
58
+ You need [uv](https://docs.astral.sh/uv/) (provides `uvx`) or Python 3.10+.
59
+
60
+ ```bash
61
+ uvx powerplan-mcp
62
+ ```
63
+
64
+ That is the stdio MCP server. Point your client at it:
65
+
66
+ ### Claude Code / Cursor / `.mcp.json`
67
+
68
+ ```json
69
+ {
70
+ "mcpServers": {
71
+ "powerplan": {
72
+ "command": "uvx",
73
+ "args": ["powerplan-mcp"],
74
+ "env": {
75
+ "PYTHONIOENCODING": "utf-8",
76
+ "PYTHONUNBUFFERED": "1"
77
+ }
78
+ }
79
+ }
80
+ }
81
+ ```
82
+
83
+ ### Claude Desktop
84
+
85
+ Same block in `claude_desktop_config.json` (`mcpServers`).
86
+
87
+ ### Grok (`~/.grok/config.toml` or project config)
88
+
89
+ ```toml
90
+ [mcp_servers.powerplan]
91
+ command = "uvx"
92
+ args = ["powerplan-mcp"]
93
+ env = { PYTHONUNBUFFERED = "1", PYTHONIOENCODING = "utf-8" }
94
+ enabled = true
95
+ ```
96
+
97
+ ### pip (no uv)
98
+
99
+ ```bash
100
+ pip install powerplan-mcp
101
+ ```
102
+
103
+ ```json
104
+ {
105
+ "mcpServers": {
106
+ "powerplan": {
107
+ "command": "python",
108
+ "args": ["-m", "powerplan"],
109
+ "env": {
110
+ "PYTHONIOENCODING": "utf-8",
111
+ "PYTHONUNBUFFERED": "1"
112
+ }
113
+ }
114
+ }
115
+ }
116
+ ```
117
+
118
+ ---
119
+
120
+ ## Agent guide
121
+
122
+ Prefer scoped tools. Do **not** read all of `PLAN.md` to figure out what to do.
123
+
124
+ 1. If tools fail with “no PLAN.md” → `create_plan` first.
125
+ 2. `get_current_iteration` — what to work on now (JSON).
126
+ 3. `get_iteration(version)` — one iteration’s tasks and progress.
127
+ 4. Mutate with `add_task` / `complete_task` / `start_iteration` / `close_iteration`.
128
+ 5. `show_plan` is a human skim, not a dump.
129
+
130
+ Every tool accepts optional `plan_path` (relative or absolute). Default: walk up
131
+ from cwd to the nearest `PLAN.md`.
132
+
133
+ Optional `agent` on mutations writes a trailing `[agent: id]` tag on the touched line.
134
+
135
+ ---
136
+
137
+ ## Why
138
+
139
+ Agents often edit `PLAN.md` by hand. Headers drift, “COMPLETE” gets stamped
140
+ without proof, and multi-agent swarms step on each other. powerplan is the
141
+ **single writer**: tolerant reader, surgical writer, optional `[agent: …]` tags.
142
+
143
+ ---
144
+
145
+ ## Tools
146
+
147
+ | Tool | Behavior |
148
+ |------|----------|
149
+ | `create_plan` | Bootstrap `./PLAN.md` (or `plan_path`) when missing; `force` to overwrite |
150
+ | `get_current_iteration` | **Preferred for agents** — scoped JSON for current work |
151
+ | `get_iteration` | JSON for one version (tasks, progress) |
152
+ | `list_iterations` / `find_task` / `get_backlog` | Navigate without full-file reads |
153
+ | `create_major` / `create_iteration` / `add_task` / … | Surgical mutations |
154
+ | `complete_task` / `reopen_task` | Checkbox updates; optional `[agent: id]` |
155
+ | `start_iteration` / `close_iteration` | ACTIVE/current vs COMPLETE lifecycle |
156
+ | `check_plan` | Structure lint |
157
+ | `show_plan` / `show_current_iteration` | Compact human skim (not a full dump) |
158
+
159
+ ---
160
+
161
+ ## Managed plan format
162
+
163
+ | Construct | Pattern |
164
+ |-----------|---------|
165
+ | Major | `## vX.Y — Title` |
166
+ | Iteration | `### vX.Y.Z — Title` |
167
+ | Goal | `**Goal:** …` |
168
+ | Tasks | `- [ ]` / `- [x]` |
169
+ | Backlog | `## Backlog` |
170
+
171
+ Phase-like headers and other prose are **preserved as opaque blocks**.
172
+
173
+ ---
174
+
175
+ ## From source
176
+
177
+ Clone, editable install, or PowerSpawn submodule — for contributors.
178
+
179
+ ```bash
180
+ git clone https://github.com/CynaCons/powerplan.git
181
+ cd powerplan
182
+ pip install -e ".[dev]"
183
+ python -m powerplan # same stdio server
184
+ # or: powerplan-mcp
185
+ ```
186
+
187
+ PowerSpawn can vendor this repo as a git submodule. Register **both** MCP
188
+ servers — they do not merge:
189
+
190
+ ```json
191
+ {
192
+ "mcpServers": {
193
+ "powerplan": {
194
+ "command": "uvx",
195
+ "args": ["powerplan-mcp"]
196
+ },
197
+ "powerspawn": {
198
+ "command": "python",
199
+ "args": ["-m", "powerspawn.mcp_server"]
200
+ }
201
+ }
202
+ }
203
+ ```
204
+
205
+ Path-only (no install): `python /path/to/powerplan/powerplan_server.py`
206
+
207
+ Landing page: `cd site && npm ci && npm run dev`
208
+
209
+ ---
210
+
211
+ ## Releasing (maintainers)
212
+
213
+ Versions live in `pyproject.toml`, `powerplan/__init__.py`, and `server.json`.
214
+ Keep them equal.
215
+
216
+ **PyPI** uses GitHub Actions trusted publishing (no API token in the repo).
217
+
218
+ 1. One-time: on [PyPI publishing](https://pypi.org/manage/account/publishing/)
219
+ add a **pending publisher**:
220
+ - Project name: `powerplan-mcp`
221
+ - Owner: `CynaCons`
222
+ - Repository: `powerplan`
223
+ - Workflow name: `publish.yml`
224
+ - Environment: *(leave empty)*
225
+ 2. Tag and push: `git tag v0.6.1 && git push origin v0.6.1`
226
+ 3. `.github/workflows/publish.yml` builds, uploads to PyPI, then publishes
227
+ `server.json` to the official MCP Registry via `mcp-publisher login github-oidc`.
228
+
229
+ Manual registry publish (after the wheel is on PyPI):
230
+
231
+ ```bash
232
+ mcp-publisher login github
233
+ mcp-publisher publish
234
+ ```
235
+
236
+ `mcp-publisher` verifies `mcp-name: io.github.cynacons/powerplan` in the PyPI
237
+ README, so that string must stay in this file.
238
+
239
+ ---
240
+
241
+ ## License
242
+
243
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,212 @@
1
+ <!-- mcp-name: io.github.cynacons/powerplan -->
2
+
3
+ # powerplan
4
+
5
+ **PLAN.md as the operational backbone of agentic development.**
6
+
7
+ `powerplan` is an [MCP](https://modelcontextprotocol.io) server that gives
8
+ coordinators and worker agents a human-language API over your project’s
9
+ `PLAN.md`: show progress, create iterations, complete tasks, keep the header
10
+ truthful — without freeform file thrash.
11
+
12
+ mcp-name: io.github.cynacons/powerplan
13
+
14
+ | | |
15
+ |---|---|
16
+ | **MCP server name** | `powerplan` |
17
+ | **PyPI** | [`powerplan-mcp`](https://pypi.org/project/powerplan-mcp/) (`powerplan` is a different, unrelated package) |
18
+ | **Registry** | `io.github.cynacons/powerplan` |
19
+ | **Status** | v0.6.0 — public package + registry listing ([PLAN.md](PLAN.md)) |
20
+ | **Site** | [GitHub Pages](https://cynacons.github.io/powerplan/) |
21
+ | **Pairs with** | [PowerSpawn](https://github.com/CynaCons/PowerSpawn) (optional) |
22
+
23
+ ---
24
+
25
+ ## Install
26
+
27
+ You need [uv](https://docs.astral.sh/uv/) (provides `uvx`) or Python 3.10+.
28
+
29
+ ```bash
30
+ uvx powerplan-mcp
31
+ ```
32
+
33
+ That is the stdio MCP server. Point your client at it:
34
+
35
+ ### Claude Code / Cursor / `.mcp.json`
36
+
37
+ ```json
38
+ {
39
+ "mcpServers": {
40
+ "powerplan": {
41
+ "command": "uvx",
42
+ "args": ["powerplan-mcp"],
43
+ "env": {
44
+ "PYTHONIOENCODING": "utf-8",
45
+ "PYTHONUNBUFFERED": "1"
46
+ }
47
+ }
48
+ }
49
+ }
50
+ ```
51
+
52
+ ### Claude Desktop
53
+
54
+ Same block in `claude_desktop_config.json` (`mcpServers`).
55
+
56
+ ### Grok (`~/.grok/config.toml` or project config)
57
+
58
+ ```toml
59
+ [mcp_servers.powerplan]
60
+ command = "uvx"
61
+ args = ["powerplan-mcp"]
62
+ env = { PYTHONUNBUFFERED = "1", PYTHONIOENCODING = "utf-8" }
63
+ enabled = true
64
+ ```
65
+
66
+ ### pip (no uv)
67
+
68
+ ```bash
69
+ pip install powerplan-mcp
70
+ ```
71
+
72
+ ```json
73
+ {
74
+ "mcpServers": {
75
+ "powerplan": {
76
+ "command": "python",
77
+ "args": ["-m", "powerplan"],
78
+ "env": {
79
+ "PYTHONIOENCODING": "utf-8",
80
+ "PYTHONUNBUFFERED": "1"
81
+ }
82
+ }
83
+ }
84
+ }
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Agent guide
90
+
91
+ Prefer scoped tools. Do **not** read all of `PLAN.md` to figure out what to do.
92
+
93
+ 1. If tools fail with “no PLAN.md” → `create_plan` first.
94
+ 2. `get_current_iteration` — what to work on now (JSON).
95
+ 3. `get_iteration(version)` — one iteration’s tasks and progress.
96
+ 4. Mutate with `add_task` / `complete_task` / `start_iteration` / `close_iteration`.
97
+ 5. `show_plan` is a human skim, not a dump.
98
+
99
+ Every tool accepts optional `plan_path` (relative or absolute). Default: walk up
100
+ from cwd to the nearest `PLAN.md`.
101
+
102
+ Optional `agent` on mutations writes a trailing `[agent: id]` tag on the touched line.
103
+
104
+ ---
105
+
106
+ ## Why
107
+
108
+ Agents often edit `PLAN.md` by hand. Headers drift, “COMPLETE” gets stamped
109
+ without proof, and multi-agent swarms step on each other. powerplan is the
110
+ **single writer**: tolerant reader, surgical writer, optional `[agent: …]` tags.
111
+
112
+ ---
113
+
114
+ ## Tools
115
+
116
+ | Tool | Behavior |
117
+ |------|----------|
118
+ | `create_plan` | Bootstrap `./PLAN.md` (or `plan_path`) when missing; `force` to overwrite |
119
+ | `get_current_iteration` | **Preferred for agents** — scoped JSON for current work |
120
+ | `get_iteration` | JSON for one version (tasks, progress) |
121
+ | `list_iterations` / `find_task` / `get_backlog` | Navigate without full-file reads |
122
+ | `create_major` / `create_iteration` / `add_task` / … | Surgical mutations |
123
+ | `complete_task` / `reopen_task` | Checkbox updates; optional `[agent: id]` |
124
+ | `start_iteration` / `close_iteration` | ACTIVE/current vs COMPLETE lifecycle |
125
+ | `check_plan` | Structure lint |
126
+ | `show_plan` / `show_current_iteration` | Compact human skim (not a full dump) |
127
+
128
+ ---
129
+
130
+ ## Managed plan format
131
+
132
+ | Construct | Pattern |
133
+ |-----------|---------|
134
+ | Major | `## vX.Y — Title` |
135
+ | Iteration | `### vX.Y.Z — Title` |
136
+ | Goal | `**Goal:** …` |
137
+ | Tasks | `- [ ]` / `- [x]` |
138
+ | Backlog | `## Backlog` |
139
+
140
+ Phase-like headers and other prose are **preserved as opaque blocks**.
141
+
142
+ ---
143
+
144
+ ## From source
145
+
146
+ Clone, editable install, or PowerSpawn submodule — for contributors.
147
+
148
+ ```bash
149
+ git clone https://github.com/CynaCons/powerplan.git
150
+ cd powerplan
151
+ pip install -e ".[dev]"
152
+ python -m powerplan # same stdio server
153
+ # or: powerplan-mcp
154
+ ```
155
+
156
+ PowerSpawn can vendor this repo as a git submodule. Register **both** MCP
157
+ servers — they do not merge:
158
+
159
+ ```json
160
+ {
161
+ "mcpServers": {
162
+ "powerplan": {
163
+ "command": "uvx",
164
+ "args": ["powerplan-mcp"]
165
+ },
166
+ "powerspawn": {
167
+ "command": "python",
168
+ "args": ["-m", "powerspawn.mcp_server"]
169
+ }
170
+ }
171
+ }
172
+ ```
173
+
174
+ Path-only (no install): `python /path/to/powerplan/powerplan_server.py`
175
+
176
+ Landing page: `cd site && npm ci && npm run dev`
177
+
178
+ ---
179
+
180
+ ## Releasing (maintainers)
181
+
182
+ Versions live in `pyproject.toml`, `powerplan/__init__.py`, and `server.json`.
183
+ Keep them equal.
184
+
185
+ **PyPI** uses GitHub Actions trusted publishing (no API token in the repo).
186
+
187
+ 1. One-time: on [PyPI publishing](https://pypi.org/manage/account/publishing/)
188
+ add a **pending publisher**:
189
+ - Project name: `powerplan-mcp`
190
+ - Owner: `CynaCons`
191
+ - Repository: `powerplan`
192
+ - Workflow name: `publish.yml`
193
+ - Environment: *(leave empty)*
194
+ 2. Tag and push: `git tag v0.6.1 && git push origin v0.6.1`
195
+ 3. `.github/workflows/publish.yml` builds, uploads to PyPI, then publishes
196
+ `server.json` to the official MCP Registry via `mcp-publisher login github-oidc`.
197
+
198
+ Manual registry publish (after the wheel is on PyPI):
199
+
200
+ ```bash
201
+ mcp-publisher login github
202
+ mcp-publisher publish
203
+ ```
204
+
205
+ `mcp-publisher` verifies `mcp-name: io.github.cynacons/powerplan` in the PyPI
206
+ README, so that string must stay in this file.
207
+
208
+ ---
209
+
210
+ ## License
211
+
212
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,37 @@
1
+ """
2
+ powerplan — PLAN.md as the operational backbone of agentic development.
3
+
4
+ This package provides a tolerant parser, byte-preserving writer, discovery,
5
+ and (via powerplan_server.py) an MCP server named ``powerplan``.
6
+ """
7
+
8
+ from .plan_model import (
9
+ BacklogItem,
10
+ BacklogSection,
11
+ Iteration,
12
+ MajorSection,
13
+ Plan,
14
+ ProseBlock,
15
+ Task,
16
+ )
17
+ from .plan_parser import parse_plan, parse_plan_file
18
+ from .plan_writer import write_plan, write_plan_file
19
+ from .discovery import find_plan_md, load_plan
20
+
21
+ __version__ = "0.6.0"
22
+ __all__ = [
23
+ "BacklogItem",
24
+ "BacklogSection",
25
+ "Iteration",
26
+ "MajorSection",
27
+ "Plan",
28
+ "ProseBlock",
29
+ "Task",
30
+ "parse_plan",
31
+ "parse_plan_file",
32
+ "write_plan",
33
+ "write_plan_file",
34
+ "find_plan_md",
35
+ "load_plan",
36
+ "__version__",
37
+ ]
@@ -0,0 +1,7 @@
1
+ """python -m powerplan — run the powerplan MCP server on stdio."""
2
+
3
+ from powerplan.server import main
4
+ import asyncio
5
+
6
+ if __name__ == "__main__":
7
+ asyncio.run(main())
@@ -0,0 +1,77 @@
1
+ """PLAN.md discovery: walk up from cwd (or start) to the nearest PLAN.md."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pathlib import Path
6
+ from typing import Optional, Union
7
+
8
+ from .plan_parser import parse_plan_file
9
+ from .plan_model import Plan
10
+
11
+
12
+ def resolve_plan_path(
13
+ plan_path: Optional[Union[str, Path]] = None,
14
+ *,
15
+ start: Optional[Union[str, Path]] = None,
16
+ must_exist: bool = True,
17
+ default_name: str = "PLAN.md",
18
+ ) -> Path:
19
+ """
20
+ Resolve which PLAN.md path a tool should use.
21
+
22
+ - If ``plan_path`` is set: expand/resolve relative to cwd (or absolute).
23
+ When ``must_exist`` is True, the file must already exist.
24
+ When False, parent directory must exist (file may be created).
25
+ - If omitted: walk up from ``start`` (default cwd) for nearest ``PLAN.md``.
26
+ If none found and ``must_exist`` is False, return ``cwd / default_name``.
27
+ """
28
+ if plan_path is not None and str(plan_path).strip() != "":
29
+ p = Path(plan_path).expanduser()
30
+ if not p.is_absolute():
31
+ p = (Path.cwd() / p).resolve()
32
+ else:
33
+ p = p.resolve()
34
+ if must_exist:
35
+ if not p.is_file():
36
+ raise FileNotFoundError(
37
+ f"plan_path does not exist: {p}. "
38
+ "Use create_plan(plan_path=...) to bootstrap a new plan."
39
+ )
40
+ return p
41
+ # Creating: parent must exist
42
+ if not p.parent.is_dir():
43
+ raise FileNotFoundError(f"Parent directory does not exist: {p.parent}")
44
+ return p
45
+
46
+ cur = Path(start).expanduser().resolve() if start is not None else Path.cwd().resolve()
47
+ if cur.is_file():
48
+ cur = cur.parent
49
+
50
+ for directory in [cur, *cur.parents]:
51
+ candidate = directory / default_name
52
+ if candidate.is_file():
53
+ return candidate
54
+
55
+ if must_exist:
56
+ raise FileNotFoundError(
57
+ f"No PLAN.md found walking up from {cur}. "
58
+ "Pass plan_path= to override, or call create_plan first."
59
+ )
60
+ return cur / default_name
61
+
62
+
63
+ def find_plan_md(
64
+ start: Optional[Union[str, Path]] = None,
65
+ plan_path: Optional[Union[str, Path]] = None,
66
+ ) -> Path:
67
+ """Resolve an existing PLAN.md (must exist)."""
68
+ return resolve_plan_path(plan_path, start=start, must_exist=True)
69
+
70
+
71
+ def load_plan(
72
+ start: Optional[Union[str, Path]] = None,
73
+ plan_path: Optional[Union[str, Path]] = None,
74
+ ) -> Plan:
75
+ """Discover PLAN.md and parse it into a Plan model."""
76
+ path = find_plan_md(start=start, plan_path=plan_path)
77
+ return parse_plan_file(path)