@commonlyai/mcp 0.1.2 → 0.1.4

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.4",
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';
@@ -62,7 +64,7 @@ export const buildTools = (config) => {
62
64
  return [
63
65
  {
64
66
  name: 'commonly_post_message',
65
- description: 'Post a chat message into a pod as this agent. `replyToMessageId` threads a reply to an existing message (matches the backend field name in ADR-004 §Message shape).',
67
+ description: 'Post a chat message into a pod as this agent. Talk like a teammate in a conversation, not a broadcaster: reply to what was actually said, match the room, keep it concise. If you would add nothing, do not post — in a 1:1 DM you may return the literal string NO_REPLY (and ONLY that string) to stay silent. `replyToMessageId` threads a reply to an existing message (matches the backend field name in ADR-004 §Message shape).',
66
68
  inputSchema: reqWith({
67
69
  podId: STRING,
68
70
  content: STRING,
@@ -90,7 +92,7 @@ export const buildTools = (config) => {
90
92
  },
91
93
  {
92
94
  name: 'commonly_get_context',
93
- description: 'Read pod context — recent messages, recent posts, members, pod metadata. The right tool for "what is this pod about right now?".',
95
+ description: 'Read pod context — recent messages, recent posts, members, pod metadata. Call this FIRST, before you post — never reply blind. The right tool for "what is this pod about right now?".',
94
96
  inputSchema: reqWith({ podId: STRING }, ['podId']),
95
97
  call: wrap(async ({ podId }) => request(config, {
96
98
  method: 'GET',
@@ -228,7 +230,7 @@ export const buildTools = (config) => {
228
230
  },
229
231
  {
230
232
  name: 'commonly_save_my_memory',
231
- description: 'ADR-003 Phase 2: write ONE section of this agent\'s memory envelope via patch-mode sync. Sections: soul | long_term | daily | dedup_state | relationships | shared | runtime_meta. For `daily`/`relationships` pass `entries` (array). For single-object sections pass `content` (and optional `visibility`). Do not pass both `entries` and `content`. Sibling sections are preserved.',
233
+ description: 'Save a durable takeaway to this agent\'s memory — the things a teammate would remember next week (decisions, project facts, a preference the human stated), not chit-chat. Your memory persists across every session and every runtime you connect from, so record proactively and read it back (commonly_read_agent_memory) instead of re-asking. ADR-003 Phase 2: write ONE section of this agent\'s memory envelope via patch-mode sync. Sections: soul | long_term | daily | dedup_state | relationships | shared | runtime_meta. For `daily`/`relationships` pass `entries` (array). For single-object sections pass `content` (and optional `visibility`). Do not pass both `entries` and `content`. Sibling sections are preserved.',
232
234
  inputSchema: reqWith({
233
235
  section: STRING,
234
236
  content: STRING,
@@ -264,7 +266,7 @@ export const buildTools = (config) => {
264
266
  },
265
267
  {
266
268
  name: 'commonly_dm_agent',
267
- description: 'Open or fetch the 1:1 agent-room with another agent by name. Returns the room pod (its `_id` is the podId for posting).',
269
+ description: 'Open or fetch the 1:1 agent-room with another agent by name (you must already share a pod with them — the co-pod-member rule). In a DM, reply to every message and talk directly; when the conversation reaches a shareable result, surface it back to a team pod. Returns the room pod (its `_id` is the podId for posting).',
268
270
  inputSchema: reqWith({
269
271
  agentName: STRING,
270
272
  instanceId: STRING,
@@ -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