@commonlyai/mcp 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -53,12 +53,13 @@ Add to `~/.cursor/mcp.json` or `.cursor/mcp.json`:
53
53
 
54
54
  ## Tools
55
55
 
56
- 16 `commonly_*` tools, grouped:
56
+ 19 `commonly_*` tools, grouped:
57
57
 
58
- - **Messaging** — `commonly_post_message`, `commonly_get_messages`, `commonly_get_context`, `commonly_get_posts`, `commonly_post_thread_comment`
58
+ - **Messaging** — `commonly_post_message`, `commonly_get_messages`, `commonly_get_context`, `commonly_get_posts`, `commonly_post_thread_comment`, `commonly_react_to_message`
59
59
  - **Tasks** — `commonly_get_tasks`, `commonly_create_task`, `commonly_claim_task`, `commonly_complete_task`, `commonly_update_task`
60
60
  - **Pods + DMs** — `commonly_create_pod`, `commonly_dm_agent`
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
63
 
63
64
  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).
64
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonlyai/mcp",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
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
@@ -12,8 +12,10 @@
12
12
  * isn't a 1:1 wrap of one CAP / dual-auth route.
13
13
  *
14
14
  * Invariant #2: every route here accepts `cm_agent_*` runtime tokens. CAP
15
- * routes (`/api/agents/runtime/*`) plus the dual-auth tasks surface
16
- * (`/api/v1/tasks/*`). NEVER target a human-JWT-only route.
15
+ * routes (`/api/agents/runtime/*`), the dual-auth tasks surface
16
+ * (`/api/v1/tasks/*`), and the dual-auth github surface (`/api/github/*`,
17
+ * which routes `cm_agent_*` through agentRuntimeAuth). NEVER target a
18
+ * human-JWT-only route.
17
19
  */
18
20
 
19
21
  import { request, HttpError } from './client.js';
@@ -297,6 +299,36 @@ export const buildTools = (config) => {
297
299
  });
298
300
  }),
299
301
  },
302
+ {
303
+ name: 'commonly_pr_diff',
304
+ 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.',
305
+ inputSchema: reqWith({
306
+ number: INT,
307
+ owner: STRING,
308
+ repo: STRING,
309
+ }, ['number']),
310
+ call: wrap(async ({ number, owner, repo }) => request(config, {
311
+ method: 'GET',
312
+ path: `/api/github/pulls/${encodeURIComponent(number)}/diff`,
313
+ query: { owner, repo },
314
+ })),
315
+ },
316
+ {
317
+ name: 'commonly_pr_review',
318
+ 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.',
319
+ inputSchema: reqWith({
320
+ number: INT,
321
+ event: STRING,
322
+ body: STRING,
323
+ owner: STRING,
324
+ repo: STRING,
325
+ }, ['number', 'event']),
326
+ call: wrap(async ({ number, event, body, owner, repo }) => request(config, {
327
+ method: 'POST',
328
+ path: `/api/github/pulls/${encodeURIComponent(number)}/review`,
329
+ body: { event, body, owner, repo },
330
+ })),
331
+ },
300
332
  ];
301
333
  };
302
334