@omnicoreos/planka-mcp 0.2.0 → 0.3.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.
Files changed (195) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.claude-plugin/marketplace.json +26 -0
  3. package/.claude-plugin/plugin.json +45 -0
  4. package/.codex-plugin/mcp.json +16 -0
  5. package/.codex-plugin/plugin.json +27 -0
  6. package/.mcp.json +17 -0
  7. package/CHANGELOG.md +510 -0
  8. package/README.es.md +294 -55
  9. package/README.md +293 -55
  10. package/dist/cli/init.d.ts +101 -0
  11. package/dist/cli/init.d.ts.map +1 -0
  12. package/dist/cli/init.js +481 -0
  13. package/dist/cli/init.js.map +1 -0
  14. package/dist/client.d.ts +32 -4
  15. package/dist/client.d.ts.map +1 -1
  16. package/dist/client.js +106 -32
  17. package/dist/client.js.map +1 -1
  18. package/dist/config/policy.d.ts +82 -0
  19. package/dist/config/policy.d.ts.map +1 -0
  20. package/dist/config/policy.js +226 -0
  21. package/dist/config/policy.js.map +1 -0
  22. package/dist/errors.d.ts +5 -1
  23. package/dist/errors.d.ts.map +1 -1
  24. package/dist/errors.js +62 -5
  25. package/dist/errors.js.map +1 -1
  26. package/dist/identity.generated.d.ts +2 -1
  27. package/dist/identity.generated.d.ts.map +1 -1
  28. package/dist/identity.generated.js +2 -1
  29. package/dist/identity.generated.js.map +1 -1
  30. package/dist/index.js +85 -10
  31. package/dist/index.js.map +1 -1
  32. package/dist/instructions.d.ts +21 -0
  33. package/dist/instructions.d.ts.map +1 -0
  34. package/dist/instructions.js +37 -0
  35. package/dist/instructions.js.map +1 -0
  36. package/dist/operations/actions.d.ts +654 -0
  37. package/dist/operations/actions.d.ts.map +1 -0
  38. package/dist/operations/actions.js +154 -0
  39. package/dist/operations/actions.js.map +1 -0
  40. package/dist/operations/archive.d.ts +28 -0
  41. package/dist/operations/archive.d.ts.map +1 -0
  42. package/dist/operations/archive.js +74 -0
  43. package/dist/operations/archive.js.map +1 -0
  44. package/dist/operations/attachments.d.ts +1 -1
  45. package/dist/operations/attachments.d.ts.map +1 -1
  46. package/dist/operations/attachments.js +3 -1
  47. package/dist/operations/attachments.js.map +1 -1
  48. package/dist/operations/board-id.d.ts +1 -1
  49. package/dist/operations/board-id.d.ts.map +1 -1
  50. package/dist/operations/board-id.js +13 -7
  51. package/dist/operations/board-id.js.map +1 -1
  52. package/dist/operations/boards.d.ts +96 -19
  53. package/dist/operations/boards.d.ts.map +1 -1
  54. package/dist/operations/boards.js +377 -93
  55. package/dist/operations/boards.js.map +1 -1
  56. package/dist/operations/card-brief.d.ts +91 -0
  57. package/dist/operations/card-brief.d.ts.map +1 -0
  58. package/dist/operations/card-brief.js +79 -0
  59. package/dist/operations/card-brief.js.map +1 -0
  60. package/dist/operations/cards.d.ts +34 -9
  61. package/dist/operations/cards.d.ts.map +1 -1
  62. package/dist/operations/cards.js +60 -14
  63. package/dist/operations/cards.js.map +1 -1
  64. package/dist/operations/comments.d.ts +61 -4
  65. package/dist/operations/comments.d.ts.map +1 -1
  66. package/dist/operations/comments.js +91 -8
  67. package/dist/operations/comments.js.map +1 -1
  68. package/dist/operations/duplicate.d.ts +16 -0
  69. package/dist/operations/duplicate.d.ts.map +1 -0
  70. package/dist/operations/duplicate.js +43 -0
  71. package/dist/operations/duplicate.js.map +1 -0
  72. package/dist/operations/labels.d.ts +1 -1
  73. package/dist/operations/labels.d.ts.map +1 -1
  74. package/dist/operations/labels.js +7 -4
  75. package/dist/operations/labels.js.map +1 -1
  76. package/dist/operations/lists.d.ts +63 -1
  77. package/dist/operations/lists.d.ts.map +1 -1
  78. package/dist/operations/lists.js +97 -2
  79. package/dist/operations/lists.js.map +1 -1
  80. package/dist/operations/members.d.ts +39 -0
  81. package/dist/operations/members.d.ts.map +1 -0
  82. package/dist/operations/members.js +107 -0
  83. package/dist/operations/members.js.map +1 -0
  84. package/dist/operations/projects.d.ts +16 -0
  85. package/dist/operations/projects.d.ts.map +1 -1
  86. package/dist/operations/projects.js +54 -9
  87. package/dist/operations/projects.js.map +1 -1
  88. package/dist/operations/tasks.d.ts +1 -1
  89. package/dist/operations/tasks.d.ts.map +1 -1
  90. package/dist/operations/tasks.js +5 -3
  91. package/dist/operations/tasks.js.map +1 -1
  92. package/dist/operations/users.d.ts +123 -0
  93. package/dist/operations/users.d.ts.map +1 -0
  94. package/dist/operations/users.js +180 -0
  95. package/dist/operations/users.js.map +1 -0
  96. package/dist/operations/verify.d.ts +84 -0
  97. package/dist/operations/verify.d.ts.map +1 -0
  98. package/dist/operations/verify.js +124 -0
  99. package/dist/operations/verify.js.map +1 -0
  100. package/dist/prompts.d.ts +48 -0
  101. package/dist/prompts.d.ts.map +1 -0
  102. package/dist/prompts.js +155 -0
  103. package/dist/prompts.js.map +1 -0
  104. package/dist/resources.d.ts +38 -0
  105. package/dist/resources.d.ts.map +1 -0
  106. package/dist/resources.js +127 -0
  107. package/dist/resources.js.map +1 -0
  108. package/dist/schemas/entities.d.ts +115 -24
  109. package/dist/schemas/entities.d.ts.map +1 -1
  110. package/dist/schemas/entities.js +48 -0
  111. package/dist/schemas/entities.js.map +1 -1
  112. package/dist/schemas/requests.d.ts +121 -46
  113. package/dist/schemas/requests.d.ts.map +1 -1
  114. package/dist/schemas/requests.js +57 -12
  115. package/dist/schemas/requests.js.map +1 -1
  116. package/dist/schemas/responses.d.ts +541 -186
  117. package/dist/schemas/responses.d.ts.map +1 -1
  118. package/dist/schemas/responses.js +13 -2
  119. package/dist/schemas/responses.js.map +1 -1
  120. package/dist/tools/activity.d.ts +150 -0
  121. package/dist/tools/activity.d.ts.map +1 -0
  122. package/dist/tools/activity.js +198 -0
  123. package/dist/tools/activity.js.map +1 -0
  124. package/dist/tools/annotations.d.ts +52 -0
  125. package/dist/tools/annotations.d.ts.map +1 -0
  126. package/dist/tools/annotations.js +214 -0
  127. package/dist/tools/annotations.js.map +1 -0
  128. package/dist/tools/attachments.d.ts +28 -4
  129. package/dist/tools/attachments.d.ts.map +1 -1
  130. package/dist/tools/attachments.js +53 -34
  131. package/dist/tools/attachments.js.map +1 -1
  132. package/dist/tools/card-ops.d.ts +232 -0
  133. package/dist/tools/card-ops.d.ts.map +1 -0
  134. package/dist/tools/card-ops.js +333 -0
  135. package/dist/tools/card-ops.js.map +1 -0
  136. package/dist/tools/cards.d.ts +90 -8
  137. package/dist/tools/cards.d.ts.map +1 -1
  138. package/dist/tools/cards.js +411 -128
  139. package/dist/tools/cards.js.map +1 -1
  140. package/dist/tools/comments.d.ts +226 -22
  141. package/dist/tools/comments.d.ts.map +1 -1
  142. package/dist/tools/comments.js +163 -134
  143. package/dist/tools/comments.js.map +1 -1
  144. package/dist/tools/dispatch.d.ts +47 -0
  145. package/dist/tools/dispatch.d.ts.map +1 -0
  146. package/dist/tools/dispatch.js +63 -0
  147. package/dist/tools/dispatch.js.map +1 -0
  148. package/dist/tools/guard.d.ts +9 -0
  149. package/dist/tools/guard.d.ts.map +1 -0
  150. package/dist/tools/guard.js +20 -0
  151. package/dist/tools/guard.js.map +1 -0
  152. package/dist/tools/index.d.ts +748 -450
  153. package/dist/tools/index.d.ts.map +1 -1
  154. package/dist/tools/index.js +136 -17
  155. package/dist/tools/index.js.map +1 -1
  156. package/dist/tools/labels.d.ts +213 -18
  157. package/dist/tools/labels.d.ts.map +1 -1
  158. package/dist/tools/labels.js +218 -203
  159. package/dist/tools/labels.js.map +1 -1
  160. package/dist/tools/lists.d.ts +222 -15
  161. package/dist/tools/lists.d.ts.map +1 -1
  162. package/dist/tools/lists.js +175 -156
  163. package/dist/tools/lists.js.map +1 -1
  164. package/dist/tools/members.d.ts +128 -0
  165. package/dist/tools/members.d.ts.map +1 -0
  166. package/dist/tools/members.js +150 -0
  167. package/dist/tools/members.js.map +1 -0
  168. package/dist/tools/navigation.d.ts +22 -2
  169. package/dist/tools/navigation.d.ts.map +1 -1
  170. package/dist/tools/navigation.js +60 -15
  171. package/dist/tools/navigation.js.map +1 -1
  172. package/dist/tools/queries.d.ts +196 -166
  173. package/dist/tools/queries.d.ts.map +1 -1
  174. package/dist/tools/queries.js +125 -155
  175. package/dist/tools/queries.js.map +1 -1
  176. package/dist/tools/tasks.d.ts +26 -6
  177. package/dist/tools/tasks.d.ts.map +1 -1
  178. package/dist/tools/tasks.js +110 -55
  179. package/dist/tools/tasks.js.map +1 -1
  180. package/dist/tools/users.d.ts +130 -0
  181. package/dist/tools/users.d.ts.map +1 -0
  182. package/dist/tools/users.js +165 -0
  183. package/dist/tools/users.js.map +1 -0
  184. package/docs/planka-2x-gotchas.md +121 -5
  185. package/docs/tools.md +771 -187
  186. package/docs/troubleshooting.md +137 -5
  187. package/hooks/hooks.json +15 -0
  188. package/hooks/preflight.mjs +100 -0
  189. package/package.json +6 -1
  190. package/scripts/setup.sh +8 -26
  191. package/scripts/sync-identity.mjs +55 -1
  192. package/server.json +87 -6
  193. package/tests/smoke/planka-smoke.mjs +512 -72
  194. package/workflow/skills/planka-close-card/SKILL.md +18 -5
  195. package/workflow/skills/planka-orchestrator/SKILL.md +36 -7
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # planka-mcp
2
2
 
3
- Control a Planka 2.x board from Claude Code through 24 MCP tools.
3
+ Control a Planka 2.x board from Claude Code through 41 MCP tools.
4
4
  Writes are re-read and verified, so a reported success matches the board.
5
5
  An optional workflow turns that board into durable memory for agent work.
6
6
 
@@ -30,53 +30,88 @@ Claude Code loads MCP servers when a session starts, so restart it after setup o
30
30
 
31
31
  ## Requirements
32
32
 
33
- - Node.js 18 or newer and `npm`
33
+ - Node.js 18 or newer and `npx`
34
34
  - A reachable Planka 2.x instance
35
35
  - A dedicated Planka user that can see the target project and board
36
- - Claude Code installed and available as `claude`
36
+ - One MCP client: Claude Code, Codex CLI, Cursor or VS Code
37
37
  - A project-manager role only if setup must create a board
38
38
 
39
39
  Linux and macOS are supported. No Bun runtime is required.
40
40
 
41
- ## Install in 5 minutes
41
+ ## Install
42
42
 
43
- Clone the repository and run the guided installer:
43
+ One command per client. All of them run the published package with `npx`, so
44
+ there is nothing to clone and nothing to build.
45
+
46
+ | Client | One-liner |
47
+ |---|---|
48
+ | **Claude Code** (plugin: MCP + skills + preflight) | `/plugin marketplace add omnicoreos/planka-mcp` then `/plugin install planka@planka-mcp` |
49
+ | **Claude Code** (server only) | `claude mcp add --scope user --transport stdio planka --env PLANKA_BASE_URL=https://planka.example.com --env PLANKA_API_KEY=<key> -- npx -y @omnicoreos/planka-mcp` |
50
+ | **Codex CLI** | `codex mcp add planka -- npx -y @omnicoreos/planka-mcp` (then add the `env` block, below) |
51
+ | **Cursor** | [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](cursor://anysphere.cursor-deeplink/mcp/install?name=planka&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBvbW5pY29yZW9zL3BsYW5rYS1tY3AiXSwiZW52Ijp7IlBMQU5LQV9CQVNFX1VSTCI6Imh0dHBzOi8vcGxhbmthLmV4YW1wbGUuY29tIiwiUExBTktBX0FQSV9LRVkiOiI8eW91ci1wbGFua2EtYXBpLWtleT4ifX0=) |
52
+ | **VS Code** | [![Add to VS Code](https://img.shields.io/badge/VS_Code-Add_planka-0098FF)](https://insiders.vscode.dev/redirect/mcp/install?name=planka&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40omnicoreos%2Fplanka-mcp%22%5D%2C%22env%22%3A%7B%22PLANKA_BASE_URL%22%3A%22https%3A%2F%2Fplanka.example.com%22%2C%22PLANKA_API_KEY%22%3A%22%3Cyour-planka-api-key%3E%22%7D%2C%22type%22%3A%22stdio%22%7D) |
53
+ | **Any of them, guided** | `npx @omnicoreos/planka-mcp init --client claude\|codex\|cursor\|vscode\|print` |
54
+
55
+ The Cursor and VS Code links carry a placeholder key, never a real one: a
56
+ deeplink ends up in browser history. Both clients ask for the credential
57
+ themselves — VS Code through a `promptString` input, so the committed
58
+ `.vscode/mcp.json` holds no secret.
59
+
60
+ ### `planka-mcp init`
44
61
 
45
62
  ```bash
46
- git clone https://github.com/omnicoreos/planka-mcp.git
47
- cd planka-mcp
48
- ./scripts/setup.sh
63
+ npx @omnicoreos/planka-mcp init --client claude # claude mcp add, user scope
64
+ npx @omnicoreos/planka-mcp init --client codex # appends to ~/.codex/config.toml
65
+ npx @omnicoreos/planka-mcp init --client cursor # merges ~/.cursor/mcp.json (0600) + prints the deeplink
66
+ npx @omnicoreos/planka-mcp init --client vscode # writes .vscode/mcp.json with a secret prompt
67
+ npx @omnicoreos/planka-mcp init --client print # prints every snippet, writes nothing
49
68
  ```
50
69
 
51
- Setup asks for the Planka URL, agent email or username, and password. It validates
52
- those credentials before writing configuration, lets you select or create a board,
53
- and then runs a real create/label/comment/delete smoke test.
70
+ With a terminal attached it asks for what it needs; `--base-url`, `--api-key`,
71
+ `--board`, `--email` and `--password` make it non-interactive. Before writing
72
+ anything it runs one authenticated `GET /api/users/me`, which is what catches a
73
+ base URL pointing at the SPA instead of the API, or a credential that never
74
+ worked. `--dry-run` prints the exact change and touches nothing.
54
75
 
55
- It offers two Claude Code configurations:
76
+ Every emitter merges: an existing `planka` entry is reported and left alone,
77
+ and the other servers in the same file are preserved. Files written into your
78
+ home directory get mode `0600`.
56
79
 
57
- | Choice | Use it when | Where it lives |
58
- |---|---|---|
59
- | `claude mcp add` | You want the easiest personal setup | Claude Code user configuration |
60
- | Project `.mcp.json` | A team should share the server entry | `<YOUR_PROJECT>/.mcp.json`, safe to commit |
80
+ `./scripts/setup.sh` is an alias for `init --client claude`. The older guided
81
+ installer — the one that also picks or creates a board and runs the full
82
+ create/label/comment/delete smoke test is still `node scripts/setup.mjs`.
61
83
 
62
- In both cases, setup stores credentials outside Git in
63
- `~/.config/planka-mcp/config.json` with mode `0600` and creates the private launcher
64
- `~/.local/bin/planka-mcp`. A generated team configuration contains no password:
84
+ ### The Claude Code plugin
65
85
 
66
- ```json
67
- {
68
- "mcpServers": {
69
- "planka": {
70
- "type": "stdio",
71
- "command": "${HOME}/.local/bin/planka-mcp",
72
- "args": []
73
- }
74
- }
75
- }
86
+ The plugin installs the MCP server, the two workflow skills, and a `SessionStart`
87
+ preflight that catches a missing credential or an `http://` base URL before the
88
+ first tool call:
89
+
90
+ ```text
91
+ /plugin marketplace add omnicoreos/planka-mcp
92
+ /plugin install planka@planka-mcp
76
93
  ```
77
94
 
78
- The installer is safe to rerun. It updates the `planka` entry, reuses existing
79
- workflow lists and labels, and deletes its temporary smoke-test card.
95
+ Claude Code asks for the base URL and the API key when the plugin is enabled and
96
+ stores the key in the OS keychain, not in `settings.json`. Codex reads the same
97
+ repository through `.codex-plugin/plugin.json` and
98
+ `.agents/plugins/marketplace.json`.
99
+
100
+ Plugins cannot ship permission rules, which is the one thing that does not
101
+ travel: use `PLANKA_READ_ONLY` and `PLANKA_DISABLED_TOOLS` (below) instead of a
102
+ client-side deny list — they work in every runtime and cost no context.
103
+
104
+ ### Codex `env` block
105
+
106
+ `codex mcp add` does not take credentials, so add them to
107
+ `~/.codex/config.toml` (or let `init --client codex` do it):
108
+
109
+ ```toml
110
+ [mcp_servers.planka]
111
+ command = "npx"
112
+ args = ["-y", "@omnicoreos/planka-mcp"]
113
+ env = { PLANKA_BASE_URL = "https://planka.example.com", PLANKA_API_KEY = "<key>" }
114
+ ```
80
115
 
81
116
  ## Verify it works
82
117
 
@@ -87,8 +122,11 @@ claude mcp list
87
122
  claude mcp get planka
88
123
  ```
89
124
 
90
- Then fully restart Claude Code. If you chose `.mcp.json`, open Claude Code in that
91
- project and approve the project-scoped server when prompted.
125
+ Then fully restart Claude Code MCP servers are loaded when a session starts. If
126
+ you configured the server in a project's `.mcp.json`, open Claude Code in that
127
+ project and approve the project-scoped server when prompted. If you installed the
128
+ plugin, `/plugin` shows it, and its **Errors** tab shows a server that failed to
129
+ start.
92
130
 
93
131
  Ask Claude Code:
94
132
 
@@ -100,7 +138,144 @@ Show me my Planka projects and boards. In the Pending list, create a card named
100
138
  If Claude cannot see the tools, restart first and then follow
101
139
  [Troubleshooting](docs/troubleshooting.md).
102
140
 
103
- ## The 24 tools
141
+ ## Authentication
142
+
143
+ Two ways to authenticate, and they are mutually exclusive: setting both is a
144
+ configuration error, because Planka reads `Authorization` first and silently
145
+ ignores `x-api-key` when both arrive.
146
+
147
+ | | `PLANKA_API_KEY` (recommended) | `PLANKA_AGENT_EMAIL` + `PLANKA_AGENT_PASSWORD` |
148
+ |---|---|---|
149
+ | Sent as | `X-Api-Key: <prefix>_<secret>` on every request | `POST /api/access-tokens`, then `Authorization: Bearer` |
150
+ | Login round-trip | none | one per session, refreshed every 25 minutes |
151
+ | Sign-in rate limit | not subject to it | 10 logins per identity per 60 s — reached fast when several agents start at once |
152
+ | Password on disk | none | yes, in the client's configuration file |
153
+ | Attachment downloads | works | works |
154
+
155
+ ### Recipe: a scoped agent user with an API key
156
+
157
+ Four steps, run by a Planka **admin**. The result is a user that can only ever
158
+ see the boards you name — enforced by Planka itself, not by this server.
159
+
160
+ 1. **Create the user with the lowest global role.** In the Planka UI:
161
+ *Administration → Users → Add user*, role **`boardUser`**. A `boardUser`
162
+ cannot create projects and cannot grant itself memberships.
163
+
164
+ 2. **Give it membership on the boards it should work on**, and only those:
165
+
166
+ ```bash
167
+ curl -X POST "$PLANKA_URL/api/boards/<BOARD_ID>/board-memberships" \
168
+ -H "Authorization: Bearer $ADMIN_TOKEN" \
169
+ -H "Content-Type: application/json" \
170
+ -d '{"userId":"<USER_ID>","role":"editor"}'
171
+ ```
172
+
173
+ Use `"role":"viewer"` for an agent that should read and comment but never
174
+ create or move cards. `GET /api/projects` then returns only the projects
175
+ derived from these memberships; every other board answers 404.
176
+
177
+ 3. **Issue the API key** (admin-only endpoint). The key is shown **once**, in
178
+ `included.apiKey`; Planka stores only its hash and prefix:
179
+
180
+ ```bash
181
+ curl -X POST "$PLANKA_URL/api/users/<USER_ID>/api-key" \
182
+ -H "Authorization: Bearer $ADMIN_TOKEN"
183
+ ```
184
+
185
+ 4. **Configure the server with the key and nothing else.** Remove
186
+ `PLANKA_AGENT_EMAIL` and `PLANKA_AGENT_PASSWORD`:
187
+
188
+ ```json
189
+ {
190
+ "mcpServers": {
191
+ "planka": {
192
+ "command": "npx",
193
+ "args": ["-y", "@omnicoreos/planka-mcp"],
194
+ "env": {
195
+ "PLANKA_BASE_URL": "https://planka.example.com",
196
+ "PLANKA_API_KEY": "abcd1234_0123456789abcdef0123456789abcdef"
197
+ }
198
+ }
199
+ }
200
+ }
201
+ ```
202
+
203
+ Rotating a key is step 3 again: issuing a new one invalidates the old.
204
+
205
+ ## Scoping the server
206
+
207
+ An API key inherits its user's permissions — it carries no scopes of its own.
208
+ Scoping therefore happens in three layers, and each covers something the others
209
+ cannot.
210
+
211
+ ```
212
+ Layer 1 · PLANKA the only layer an agent cannot talk its way around
213
+ boardUser + board memberships + the API key above
214
+ ⇒ everything outside the allowed boards is 404/403 at the API
215
+
216
+ Layer 2 · THIS SERVER ergonomics, and defence against the agent itself
217
+ the environment variables below; they travel with the package,
218
+ so Claude Code, Codex and Cursor all get the same rules
219
+
220
+ Layer 3 · THE CLIENT survives a downgrade of this package
221
+ .claude/settings.json deny/ask rules, Codex enabled_tools/disabled_tools
222
+ ```
223
+
224
+ Layer 1 has real enforcement but cannot express "do not call `planka_get_board`,
225
+ it costs forty times more context". Layer 2 can, and reaches every runtime.
226
+ Layer 3 stays true even if this package is pinned back to an older version.
227
+
228
+ ### Layer 2: the environment variables
229
+
230
+ | Variable | Value | What it does |
231
+ |---|---|---|
232
+ | `PLANKA_DEFAULT_BOARD_ID` | one board id | `boardId` becomes optional on every tool that takes one, and defaults to this board. Saves the `planka_get_structure` call an agent makes only to recover an id that never changes |
233
+ | `PLANKA_ALLOWED_BOARD_IDS` | comma-separated board ids | Boards outside the list are filtered out of `planka_get_structure`, and any call naming one is refused before the request leaves the process |
234
+ | `PLANKA_ALLOWED_PROJECT_IDS` | comma-separated project ids | Same, one level up |
235
+ | `PLANKA_READ_ONLY` | `true` or `1` | The twenty-seven write tools disappear from `tools/list` and are refused if called anyway |
236
+ | `PLANKA_HIDE_DEPRECATED` | `true` or `1` | Drops the seven deprecated tools (`manage_labels`, `manage_lists`, `manage_comment`, `add_comment`, `get_board`, `list_cards`, `list_lists`) from `tools/list`, saving ~6.8 kB of context. They stay callable, so a cached tool list still works |
237
+ | `PLANKA_DISABLED_TOOLS` | comma-separated tool names | Switches individual tools off. The `planka_` prefix is optional: `get_board` and `planka_get_board` mean the same thing |
238
+ | `PLANKA_PROTECTED_LIST_IDS` | comma-separated list ids | Refuses creating or moving cards **into** those lists, editing or deleting the lists themselves, and moving, archiving or deleting the cards **out of** them |
239
+ | `PLANKA_SUMMARY_DECISION_LISTS` | comma-separated column names or ids | Which columns `planka_board_summary` returns cards from when the call does not say. Unset: it returns no cards, only the shape of the board |
240
+ | `PLANKA_SUMMARY_HIGHLIGHT_LABEL` | one label name | The label that marks a card as unblocked in `planka_board_summary`. Unset: nothing is highlighted |
241
+ | `PLANKA_MCP_PREFLIGHT` | `full` | Read by the plugin's SessionStart hook only: also spawn the server binary and wait for its stdio banner. Off by default, because on a cold cache it costs an `npx` download |
242
+ | `PLANKA_MCP_COMMAND` | a command | Read by the same hook: the command to spawn instead of `npx -y @omnicoreos/planka-mcp` (a local checkout, a pinned binary) |
243
+
244
+ **The server ships with no board vocabulary of its own.** Column names and
245
+ "ready" labels are yours, in your language: the last two variables are how a
246
+ deployment tells the summary what its board looks like. A hint that matches
247
+ nothing comes back in `warnings`, never as an empty answer.
248
+
249
+ ```json
250
+ "PLANKA_SUMMARY_DECISION_LISTS": "decision,probalo,miralo",
251
+ "PLANKA_SUMMARY_HIGHLIGHT_LABEL": "decidido"
252
+ ```
253
+
254
+ **Allowlists are by id, never by name.** Any board editor can rename a board, so
255
+ a name-based allowlist is bypassed with one edit. Planka ids are stable.
256
+
257
+ Two notes on what these are and are not:
258
+
259
+ - `PLANKA_READ_ONLY` hides tools; it does not make the account read-only. Pair it
260
+ with `"role":"viewer"` in step 2 above if that is what you actually need.
261
+ - `PLANKA_PROTECTED_LIST_IDS` is a guard-rail, not a permission: Planka has no
262
+ per-list rights. It is the right tool for "do not move cards to *Merged* on
263
+ your own", and the wrong one for anything security-critical.
264
+
265
+ Example — an agent that reads one board and comments, and nothing else:
266
+
267
+ ```json
268
+ "env": {
269
+ "PLANKA_BASE_URL": "https://planka.example.com",
270
+ "PLANKA_API_KEY": "abcd1234_0123456789abcdef0123456789abcdef",
271
+ "PLANKA_DEFAULT_BOARD_ID": "1234567890123456789",
272
+ "PLANKA_ALLOWED_BOARD_IDS": "1234567890123456789",
273
+ "PLANKA_DISABLED_TOOLS": "get_board",
274
+ "PLANKA_PROTECTED_LIST_IDS": "9876543210987654321"
275
+ }
276
+ ```
277
+
278
+ ## The 41 tools
104
279
 
105
280
  IDs are strings. Start with `planka_get_structure`, then use IDs returned by
106
281
  Planka; do not guess them.
@@ -108,41 +283,104 @@ Planka; do not guess them.
108
283
  | Tool | What it does |
109
284
  |---|---|
110
285
  | `planka_get_structure` | Lists visible projects, boards, and lists |
111
- | `planka_get_board` | Reads one board with its lists, cards, labels, and optional task counts |
112
- | `planka_list_lists` | Lists a board's columns with card counts, and no cards |
113
- | `planka_board_summary` | One-call briefing: columns, labels, and the cards waiting on a decision |
114
- | `planka_list_cards` | Reads one column, paginated, without descriptions by default |
115
- | `planka_find_cards` | Searches a board's cards by label, text, or column |
286
+ | `planka_get_board` | **Deprecated.** Reads one board whole, up to `limit` cards |
287
+ | `planka_board_summary` | One-call briefing: columns with counts, labels with ids, and optionally the cards of named columns |
288
+ | `planka_find_cards` | The one read over cards: one column (`listId`), or a board searched by text, label or member |
289
+ | `planka_list_lists` | **Deprecated.** Alias of `planka_board_summary` with `cardsFrom: []` |
290
+ | `planka_list_cards` | **Deprecated.** Alias of `planka_find_cards` with `listId` |
116
291
  | `planka_create_card` | Creates a card and can attach tasks and labels |
117
- | `planka_get_card` | Reads complete card details |
292
+ | `planka_get_card` | Card digest; `detail: "full"` and `withComments` on demand |
118
293
  | `planka_update_card` | Updates title, description, due date, or completion |
119
294
  | `planka_move_card` | Moves a card to another list or position |
120
295
  | `planka_delete_card` | Permanently deletes a card |
121
296
  | `planka_create_tasks` | Adds checklist tasks to a card |
122
297
  | `planka_update_task` | Renames or completes a task |
123
298
  | `planka_delete_task` | Deletes a task |
124
- | `planka_manage_labels` | Creates, updates, or deletes board labels |
299
+ | `planka_create_label` | Creates a board label |
300
+ | `planka_update_label` | Renames a label or changes its color |
301
+ | `planka_delete_label` | Deletes a label from the board and from every card |
302
+ | `planka_manage_labels` | **Deprecated.** Alias routing `action` to the three above |
125
303
  | `planka_set_card_labels` | Adds or removes labels and verifies the final state |
126
- | `planka_add_comment` | Adds a comment through Planka 2.x's dedicated endpoint |
127
- | `planka_get_comments` | Reads comments through the dedicated endpoint |
128
- | `planka_manage_comment` | Edits or deletes an existing comment |
129
- | `planka_manage_lists` | Creates, updates, or deletes board lists |
304
+ | `planka_create_comment` | Adds a comment through Planka 2.x's dedicated endpoint |
305
+ | `planka_get_comments` | Paginated comments (`limit`, `beforeId`, `all`) |
306
+ | `planka_update_comment` | Rewrites an existing comment |
307
+ | `planka_delete_comment` | Deletes a comment |
308
+ | `planka_add_comment` | **Deprecated.** Alias of `planka_create_comment` |
309
+ | `planka_manage_comment` | **Deprecated.** Alias routing `action` to update/delete |
310
+ | `planka_create_list` | Creates a list (column) on a board |
311
+ | `planka_update_list` | Renames, repositions or reclassifies a column |
312
+ | `planka_delete_list` | Deletes a column **and every card in it** |
313
+ | `planka_manage_lists` | **Deprecated.** Alias routing `action` to the three above |
130
314
  | `planka_add_attachment` | Uploads a local file to a card and verifies it landed |
131
315
  | `planka_get_attachments` | Lists a card's attachments with type, size, and download URL |
132
316
  | `planka_view_attachment` | Returns an attachment's content; images come back viewable |
133
317
  | `planka_delete_attachment` | Deletes an attachment |
134
-
135
- `planka_get_board` returns the entire board, which is often more than the
136
- question needs. The four scoped reads answer narrower questions and return far
137
- less text: measured on a board of 100 cards, `planka_list_lists` returned 39
138
- times less than `planka_get_board`, `planka_board_summary` 16 times less, and
139
- `planka_find_cards` between 18 and 56 times less depending on the filter. They
140
- also report `total`, `returned`, and `hasMore`, so a clipped answer never looks
141
- complete.
318
+ | `planka_card_history` | One card's activity log as human lines: created, moved, assigned, tasks completed |
319
+ | `planka_board_activity` | What moved on a board since a date, grouped by card |
320
+ | `planka_set_card_members` | Assigns or unassigns people and verifies the final membership |
321
+ | `planka_list_users` | The people who can be assigned, with a board-scoped fallback |
322
+ | `planka_whoami` | This server's account, board role, Planka version and access policy |
323
+ | `planka_duplicate_card` | Copies a card with its tasks, labels and members |
324
+ | `planka_archive_card` | Archives a card into the board's hidden archive, or restores it |
325
+ | `planka_move_list_cards` | Moves every card of one column into another, with counts |
326
+
327
+ The reads follow one principle: **a small digest by default, the detail through
328
+ parameters**. `planka_board_summary` opens a session in one call;
329
+ `planka_find_cards` with a `listId` reads a whole column in ONE request through
330
+ `GET /api/lists/:id`, so `total` is the real size of the column and the answer
331
+ carries `truncated: false`; the same tool without a `listId` searches the board.
332
+ Measured on the reference board of 185 cards, the deprecated `planka_get_board`
333
+ went from 56,112 to 17,215 characters and `planka_get_structure`
334
+ (`withLists: false`) from 696 to 203, while a 159-card column went from five
335
+ requests to two. Every read reports `total`, `returned` and `hasMore`, so a
336
+ clipped answer never looks complete, and every board-derived read carries
337
+ `excludesArchived: true` because Planka keeps archive and trash out of the board
338
+ read.
142
339
 
143
340
  Every input field and a complete payload for every tool are in
144
341
  [Tools reference](docs/tools.md).
145
342
 
343
+ ## What the client learns on connect
344
+
345
+ The `initialize` handshake returns a short set of server instructions — how to
346
+ open a session, where IDs come from, why every comment on a card matters, and
347
+ that Planka answers `404` where it means `403`. Claude Code puts them in the
348
+ session system prompt and Codex CLI reads them alongside the tool list, so the
349
+ shared guidance is stated once instead of repeated in 41 tool descriptions.
350
+ Every tool also publishes a display title and all four MCP behavioural hints
351
+ explicitly, rather than inheriting the spec's pessimistic defaults, plus the two
352
+ `_meta` keys Claude Code acts on: a forced confirmation prompt on the tools that
353
+ delete data, and a raised output ceiling on `planka_view_attachment`. Details in
354
+ [Server instructions and annotations](docs/tools.md#server-instructions-and-annotations).
355
+
356
+ ## Resources and prompts
357
+
358
+ Two more surfaces, and both cost nothing until something asks for them, which is
359
+ why the long-form guidance lives here instead of in the instructions everyone
360
+ pays for on every session. Claude Code reads both; Cursor reads both; Codex
361
+ supports neither, so nothing here is load-bearing.
362
+
363
+ **Resources** serve the guides that ship inside the package. In Claude Code they
364
+ are `@`-mentioned, in Cursor they come from the resource picker:
365
+
366
+ | URI | What it is |
367
+ |---|---|
368
+ | `planka://workflow/readme` | The optional board workflow: columns, labels, who moves what |
369
+ | `planka://workflow/board-template` | The columns and labels to create on a fresh board |
370
+ | `planka://workflow/skills/orchestrator` | The director skill, verbatim |
371
+ | `planka://workflow/skills/close-card` | The closing skill, verbatim |
372
+ | `planka://gotchas/planka-2x` | How Planka 2.x actually behaves when a call answers nonsense |
373
+ | `planka://labels/colors` | Every color `planka_create_label` and `planka_update_label` accept, generated from the schema |
374
+
375
+ **Prompts** are three ways to start, surfaced by Claude Code as
376
+ `/mcp__planka__<name>`:
377
+
378
+ | Prompt | Arguments | What it does |
379
+ |---|---|---|
380
+ | `planka-open-session` | `boardId?`, `since?` | Summary, then recent movement, then the columns that matter — in that order |
381
+ | `planka-close-card` | `cardId`, `listId?` | Read the whole thread, write an honest closing comment, move it, check `verified` |
382
+ | `planka-board-triage` | `boardId?`, `lists?` | Walk the columns waiting on a person and turn each card into one question |
383
+
146
384
  ## Optional agent workflow
147
385
 
148
386
  The MCP server works on its own. The optional method solves a different problem:
@@ -187,8 +425,8 @@ npm test
187
425
  ```
188
426
 
189
427
  The real smoke test is opt-in because it mutates a writable board and then cleans
190
- up after itself. It drives all 24 tools over stdio and cross-checks every write
191
- against the raw Planka API — 64 named checks:
428
+ up after itself. It drives all 41 tools over stdio and cross-checks every write
429
+ against the raw Planka API — over 90 named checks:
192
430
 
193
431
  ```bash
194
432
  export PLANKA_BASE_URL="https://planka.example.com"
@@ -0,0 +1,101 @@
1
+ export declare const CLIENTS: readonly ["claude", "codex", "cursor", "vscode", "print"];
2
+ export type Client = (typeof CLIENTS)[number];
3
+ export interface InitOptions {
4
+ client: Client;
5
+ dryRun: boolean;
6
+ baseUrl?: string;
7
+ apiKey?: string;
8
+ email?: string;
9
+ password?: string;
10
+ boardId?: string;
11
+ /** Where the VS Code config goes. Defaults to the current directory. */
12
+ projectDir: string;
13
+ help: boolean;
14
+ }
15
+ export interface ServerSpec {
16
+ command: string;
17
+ args: string[];
18
+ env: Record<string, string>;
19
+ }
20
+ export declare const USAGE = "planka-mcp init \u2014 configure this MCP server in your client\n\nUsage:\n npx @omnicoreos/planka-mcp init [--client <name>] [options]\n\nClients:\n claude Claude Code (claude mcp add, user scope)\n codex Codex CLI (~/.codex/config.toml)\n cursor Cursor (~/.cursor/mcp.json) and an \"Add to Cursor\" deeplink\n vscode VS Code (.vscode/mcp.json, secret asked at startup)\n print print every snippet, write nothing (default without a TTY)\n\nOptions:\n --base-url <url> Planka origin, e.g. https://planka.example.com\n --api-key <key> Planka API key (recommended)\n --email <email> Agent email, only if you have no API key\n --password <pass> Agent password, only if you have no API key\n --board <id> Default board ID (PLANKA_DEFAULT_BOARD_ID)\n --project-dir <dir> Where to write .vscode/mcp.json (default: cwd)\n --dry-run Print what would be written, change nothing\n -h, --help This text\n\nWith no flags and a terminal attached, init asks for what it needs.";
21
+ /** Flags in, options out. Unknown flags are an error, not a silent no-op. */
22
+ export declare function parseInitArgs(argv: string[]): InitOptions;
23
+ /**
24
+ * The server entry every client gets, in MCP's `{command, args, env}` shape.
25
+ * `redacted` swaps the secret for a placeholder — that is the version that goes
26
+ * into anything printed, linked or committed.
27
+ */
28
+ export declare function serverSpec(options: Pick<InitOptions, "baseUrl" | "apiKey" | "email" | "password" | "boardId">, redacted?: boolean): ServerSpec;
29
+ /** `claude mcp add …`, ready to paste. */
30
+ export declare function claudeMcpAddCommand(spec: ServerSpec): string;
31
+ /** The `[mcp_servers.planka]` block for `~/.codex/config.toml`. */
32
+ export declare function codexTomlBlock(spec: ServerSpec): string;
33
+ /**
34
+ * Cursor's install deeplink. The base64 payload is the SERVER OBJECT ONLY —
35
+ * `{command, args, env}` with no name wrapper — and it never carries a real
36
+ * key: a deeplink ends up in browser history and in READMEs.
37
+ */
38
+ export declare function cursorDeeplink(spec: ServerSpec): string;
39
+ /** VS Code badge URL. Same payload, url-encoded instead of base64. */
40
+ export declare function vscodeBadgeUrl(spec: ServerSpec): string;
41
+ /**
42
+ * `.vscode/mcp.json`. The secret is an `inputs` promptString with
43
+ * `password: true`, so VS Code asks for it at startup and the committed file
44
+ * holds no credential.
45
+ */
46
+ export declare function vscodeConfig(options: Pick<InitOptions, "baseUrl" | "boardId">): {
47
+ inputs: {
48
+ id: string;
49
+ type: string;
50
+ description: string;
51
+ password: boolean;
52
+ }[];
53
+ servers: {
54
+ planka: {
55
+ type: string;
56
+ command: string;
57
+ args: string[];
58
+ env: Record<string, string>;
59
+ };
60
+ };
61
+ };
62
+ /**
63
+ * Merge a server entry into an `{mcpServers: …}` document without touching
64
+ * anything else. An existing `planka` entry wins: this command never silently
65
+ * replaces a config the user tuned by hand.
66
+ */
67
+ export declare function mergeMcpJson(document: unknown, spec: ServerSpec, key?: string): {
68
+ document: Record<string, unknown>;
69
+ added: boolean;
70
+ };
71
+ /**
72
+ * Append the Codex block to an existing config.toml. Present already = leave it
73
+ * alone. TOML is edited as text on purpose: no parser here means no chance of
74
+ * rewriting (and reformatting, and losing the comments of) somebody's config.
75
+ */
76
+ export declare function mergeCodexToml(current: string, block: string): {
77
+ text: string;
78
+ added: boolean;
79
+ };
80
+ /**
81
+ * The connection smoke that `scripts/setup.mjs` has always run, reduced to its
82
+ * useful half: one authenticated GET. It proves the base URL is the API origin
83
+ * (not an SPA or a proxy page) and that the credential works, before anything
84
+ * is written. Never fatal — a config that cannot be verified is still worth
85
+ * writing, as long as we say so.
86
+ */
87
+ export declare function checkConnection(options: Pick<InitOptions, "baseUrl" | "apiKey" | "email" | "password">, fetchImpl?: typeof fetch): Promise<{
88
+ ok: boolean;
89
+ detail: string;
90
+ }>;
91
+ type Ask = (question: string, secret?: boolean) => Promise<string>;
92
+ export interface RunInitDeps {
93
+ log?: (line: string) => void;
94
+ ask?: Ask;
95
+ /** Skips the network check. Tests and --dry-run never touch Planka. */
96
+ check?: typeof checkConnection;
97
+ }
98
+ /** Entry point. Returns the process exit code; never throws for user error. */
99
+ export declare function runInit(argv: string[], deps?: RunInitDeps): Promise<number>;
100
+ export {};
101
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":"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"}