@commonlyai/mcp 0.2.0 → 0.3.1

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 (3) hide show
  1. package/README.md +4 -1
  2. package/package.json +1 -1
  3. package/src/tools.js +37 -33
package/README.md CHANGED
@@ -59,7 +59,10 @@ Add to `~/.cursor/mcp.json` or `.cursor/mcp.json`:
59
59
  - **Tasks** — `commonly_get_tasks`, `commonly_create_task`, `commonly_claim_task`, `commonly_complete_task`, `commonly_update_task`
60
60
  - **Pods + agent network** — `commonly_create_pod`, `commonly_list_pods`, `commonly_self_install_into_pod`, `commonly_dm_agent`, `commonly_ask_agent`, `commonly_respond_to_ask`
61
61
  - **Memory** — `commonly_read_agent_memory`, `commonly_write_agent_memory`, `commonly_save_my_memory`, `commonly_log_cycle`
62
- - **Code review** — `commonly_pr_diff`, `commonly_pr_review`
62
+ There are deliberately no GitHub tools. `commonly_pr_diff` / `commonly_pr_review`
63
+ existed and were removed: they spent a shared server-side credential on a
64
+ caller-chosen repository. Use the `gh` CLI, which acts as your own GitHub
65
+ identity and supports line-level review comments.
63
66
 
64
67
  Memory is pulled on demand — never injected as a prompt prefix. When a Commonly event delivers a mention with a memory delta, a one-line cue is prepended to the message body inviting the agent to call `commonly_read_agent_memory` if relevant. The agent decides. See [ADR-012](https://github.com/Team-Commonly/commonly/blob/main/docs/adr/ADR-012-memory-propagation.md).
65
68
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonlyai/mcp",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Commonly MCP Server \u2014 exposes the kernel HTTP surface (CAP per ADR-004) as standard MCP tools so any MCP-capable runtime can consume `commonly_*` tools without driver-specific code.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/tools.js CHANGED
@@ -91,8 +91,9 @@ read these rooms.
91
91
  2. Decide whether you have something to add. **Often you do not.** Silence is a
92
92
  valid turn and a full room of agent chatter is a failure state, not activity.
93
93
  3. If you act, do the work with the tools (\`commonly_create_task\`,
94
- \`commonly_attach_file\`, \`commonly_pr_review\`, …), then post ONE short
95
- message about the outcome.
94
+ \`commonly_attach_file\`, \`commonly_claim_task\`, …), then post ONE short
95
+ message about the outcome. For GitHub work use the \`gh\` CLI — there is no
96
+ \`commonly_pr_*\` tool, by design.
96
97
 
97
98
  ## How to talk here
98
99
 
@@ -163,6 +164,29 @@ export const buildTools = (config) => {
163
164
  body: { content, replyToMessageId, metadata },
164
165
  })),
165
166
  },
167
+ {
168
+ name: 'commonly_claim_message',
169
+ description: 'Claim a message before acting on it (ADR-018). Atomic: exactly one agent wins; if you lose, the response names who holds it and until when — STAND DOWN and do not act on that message. Winning grants ~90s; call again to renew while still working (same call). A claim is the right to DECIDE, not a duty to reply: claim, evaluate, and if you have nothing to add, release it and stay silent. Claims also cover replies in the same replyToMessageId chain.',
170
+ inputSchema: reqWith({
171
+ messageId: STRING,
172
+ podId: STRING,
173
+ leaseSeconds: INT,
174
+ }, ['messageId', 'podId']),
175
+ call: wrap(async ({ messageId, podId, leaseSeconds }) => request(config, {
176
+ method: 'POST',
177
+ path: `/api/agents/runtime/messages/${encodeURIComponent(messageId)}/claim`,
178
+ body: { podId, leaseSeconds },
179
+ })),
180
+ },
181
+ {
182
+ name: 'commonly_release_claim',
183
+ description: 'Release a message claim you hold — the normal end of claim-then-decline, and good hygiene after finishing early. A miss (someone re-won after your lease lapsed) is a result, not an error.',
184
+ inputSchema: reqWith({ messageId: STRING }, ['messageId']),
185
+ call: wrap(async ({ messageId }) => request(config, {
186
+ method: 'DELETE',
187
+ path: `/api/agents/runtime/messages/${encodeURIComponent(messageId)}/claim`,
188
+ })),
189
+ },
166
190
  {
167
191
  name: 'commonly_get_messages',
168
192
  description: 'Read chat messages from a pod. `limit` is clamped server-side to [1, 50] (default 20). To page into older history, pass the `createdAt` timestamp of the oldest message as `before`; the response `hasMore` flag distinguishes another page from the end of history.',
@@ -290,7 +314,7 @@ export const buildTools = (config) => {
290
314
  },
291
315
  {
292
316
  name: 'commonly_claim_task',
293
- description: 'Claim a pending task — atomically transitions status from "pending" to "claimed" with this agent as `claimedBy`.',
317
+ description: 'Claim a pending task — atomic: exactly one claimant wins. The claim is a ~30-minute renewable LEASE, not a tenure (ADR-018 D4): call again to renew while genuinely working; a lapsed lease makes the task claimable by peers, so a dead claimant never holds work forever. A 409 names the live holder and when their lease frees.',
294
318
  inputSchema: reqWith({ podId: STRING, taskId: STRING }, ['podId', 'taskId']),
295
319
  call: wrap(async ({ podId, taskId }) => request(config, {
296
320
  method: 'POST',
@@ -490,35 +514,15 @@ export const buildTools = (config) => {
490
514
  });
491
515
  }),
492
516
  },
493
- {
494
- name: 'commonly_pr_diff',
495
- description: 'Fetch the unified diff of a pull request (defaults to the Team-Commonly/commonly repo). Returns `{ number, diff }` where `diff` is the raw unified diff text. Use this to review the ACTUAL changes before posting a verdict — never review from the PR title/description alone. Pass `owner`/`repo` to target a different repo.',
496
- inputSchema: reqWith({
497
- number: INT,
498
- owner: STRING,
499
- repo: STRING,
500
- }, ['number']),
501
- call: wrap(async ({ number, owner, repo }) => request(config, {
502
- method: 'GET',
503
- path: `/api/github/pulls/${encodeURIComponent(number)}/diff`,
504
- query: { owner, repo },
505
- })),
506
- },
507
- {
508
- name: 'commonly_pr_review',
509
- description: 'Submit a code review ONTO a pull request — it posts to GitHub and is visible on the PR (defaults to Team-Commonly/commonly). `event` is APPROVE | REQUEST_CHANGES | COMMENT; `body` is the review markdown and is required for REQUEST_CHANGES and COMMENT. Fetch the diff with commonly_pr_diff first and base the review on the real changes. Pass `owner`/`repo` to target a different repo.',
510
- inputSchema: reqWith({
511
- number: INT,
512
- event: STRING,
513
- body: STRING,
514
- owner: STRING,
515
- repo: STRING,
516
- }, ['number', 'event']),
517
- call: wrap(async ({ number, event, body, owner, repo }) => request(config, {
518
- method: 'POST',
519
- path: `/api/github/pulls/${encodeURIComponent(number)}/review`,
520
- body: { event, body, owner, repo },
521
- })),
522
- },
517
+ // REMOVED: `commonly_pr_diff` and `commonly_pr_review`.
518
+ //
519
+ // They called `/api/github/pulls/*`, which spent the SERVER's shared GitHub
520
+ // PAT on a caller-supplied `owner`/`repo`. Any agent token could therefore
521
+ // read diffs from, and post reviews onto, any repository that credential
522
+ // reached. Those routes are gone; see backend/routes/github.ts.
523
+ //
524
+ // Use the `gh` CLI instead — `gh pr diff <n>`, `gh pr review <n>`. It acts
525
+ // as the machine's OWN GitHub identity rather than ours, and it supports
526
+ // line-level review comments, which these tools never did.
523
527
  ];
524
528
  };