exponential-mcp 0.18.0 → 0.20.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.
package/README.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/exponential-mcp.svg)](https://www.npmjs.com/package/exponential-mcp)
4
4
 
5
- Connect Claude to your [Exponential](https://exponential.im) workspace. Manage projects, actions, and OKRs directly from Claude.
5
+ Connect Claude to your [Exponential](https://www.exponential.im) workspace. Manage projects, actions, and OKRs directly from Claude.
6
+
7
+ Setup guides: **[Claude](https://www.exponential.im/features/integrations/claude)** · **[Cursor](https://www.exponential.im/features/integrations/cursor)** · **[Codex](https://www.exponential.im/features/integrations/codex)** · **[MCP & SDK docs](https://www.exponential.im/docs/developers/mcp-and-sdk)**
8
+
9
+ Built on the [Exponential SDK](https://github.com/exponential-im/exponential-sdk); the [Exponential CLI](https://github.com/exponential-im/exponential-cli) covers the same workspace from a terminal.
6
10
 
7
11
  ## Quick Start
8
12
 
@@ -224,13 +228,28 @@ Invalid params come back as an error that includes the expected schema.
224
228
  ```
225
229
 
226
230
  `comments` covers comments on actions, features, pages, goals and tickets — pass
227
- `target` to choose which.
231
+ `target` to choose which. On a page, `add` with `quotedText` anchors the comment
232
+ to that span of the body (the server mints the thread and highlights the span);
233
+ copy the text as it reads on the page, and add `quotePrefix`/`quoteSuffix` when
234
+ it appears more than once. A quote that doesn't resolve is refused, not posted
235
+ unanchored. `reply`, `resolve` and `unresolve` work on features and pages.
228
236
 
229
237
  `positions` is a workspace's roles & responsibilities — the Positions on the
230
238
  settings page: list, create, update, set_holders, delete, and import_many
231
239
  (upsert by title, with a dry run). Writes need your own API key, not an agent
232
240
  key, and owner/admin, except that a holder may edit their own Position's remit.
233
241
 
242
+ `labels` also manages ticket label rules. A rule adds a label to each ticket
243
+ whose repo, epic, type or product matches. Rules only add labels.
244
+
245
+ - `list_rules`: any member.
246
+ - `create_rule`, `delete_rule`: owners and admins only.
247
+ - `apply_rules`: makes the rules match a list. It adds the missing rules and
248
+ keeps the rest, so you can run it again. It deletes rules only with `prune`.
249
+ `dryRun` writes nothing.
250
+
251
+ Other accounts get "Only workspace owners and admins can change label rules."
252
+
234
253
  `databases` is the typed write path for tables inside pages (ADR-0078): a
235
254
  database is a block in a page body and each row is a page. **Values are typed
236
255
  per property** — a select takes an option name, a date an ISO string, a person
@@ -20,15 +20,17 @@ function goalIdOf(value) {
20
20
  }
21
21
  return n;
22
22
  }
23
- /** Feature-only / goal-only add fields, rejected loudly on other targets rather than silently dropped. */
23
+ /** Target-specific add fields, rejected loudly on other targets rather than silently dropped. */
24
24
  function assertOnly(t, allowed, fields) {
25
- if (t === allowed)
25
+ const targets = Array.isArray(allowed) ? allowed : [allowed];
26
+ if (targets.includes(t))
26
27
  return;
27
28
  const present = Object.entries(fields)
28
29
  .filter(([, v]) => v !== undefined)
29
30
  .map(([k]) => k);
30
31
  if (present.length) {
31
- throw new Error(`${present.join(', ')} can only be used with target "${allowed}", not "${t}".`);
32
+ const names = targets.map((a) => `"${a}"`).join(' or ');
33
+ throw new Error(`${present.join(', ')} can only be used with target ${names}, not "${t}".`);
32
34
  }
33
35
  }
34
36
  async function listTicketComments(client, ticketId) {
@@ -38,7 +40,7 @@ async function listTicketComments(client, ticketId) {
38
40
  }
39
41
  export const comments = {
40
42
  name: 'comments',
41
- description: 'Comments on actions, features (PRDs), knowledge pages, goals (objectives) and tickets — pick the entity with `target`. Threaded replies and anchored-thread resolve/unresolve exist only on features. Editing and deleting are author-only.',
43
+ description: 'Comments on actions, features (PRDs), knowledge pages, goals (objectives) and tickets — pick the entity with `target`. Anchored threads (a comment on a span of the body), threaded replies and resolve/unresolve exist on features and pages. Editing and deleting are author-only.',
42
44
  operations: {
43
45
  list: op({
44
46
  effect: 'read',
@@ -61,26 +63,51 @@ export const comments = {
61
63
  }),
62
64
  add: op({
63
65
  effect: 'write',
64
- summary: 'Add a top-level comment. All targets; scopeId/threadId/quotedText are feature-only, parentUpdateId is goal-only.',
66
+ summary: 'Add a top-level comment. All targets. On a page, pass quotedText to anchor the comment to that span of the body: the server mints the threadId, highlights the span, and refuses the comment if the text matches no span or several (add quotePrefix/quoteSuffix to pick one). scopeId/threadId are feature-only, parentUpdateId is goal-only.',
65
67
  params: z.object({
66
68
  target,
67
69
  targetId,
68
70
  body,
69
71
  scopeId: z.string().optional().describe('Feature only: post to this scope’s activity feed instead of the feature’s'),
70
72
  threadId: z.string().optional().describe('Feature only: anchor to a span of the PRD body; omit for a doc-level comment'),
71
- quotedText: z.string().optional().describe('Feature only: the anchored text being quoted'),
73
+ quotedText: z
74
+ .string()
75
+ .optional()
76
+ .describe('Feature or page: the anchored text being quoted. On a page this alone anchors the comment; copy the text exactly as it reads on the page, without markdown syntax'),
77
+ quotePrefix: z
78
+ .string()
79
+ .max(200)
80
+ .optional()
81
+ .describe('Page only, with quotedText: the text just before the quote, to pick one of several matches'),
82
+ quoteSuffix: z
83
+ .string()
84
+ .max(200)
85
+ .optional()
86
+ .describe('Page only, with quotedText: the text just after the quote, to pick one of several matches'),
72
87
  parentUpdateId: z.string().optional().describe('Goal only: thread under this goal update instead of the goal itself'),
73
88
  }),
74
- run: (client, { target: t, targetId: tid, body, scopeId, threadId, quotedText, parentUpdateId }) => {
75
- assertOnly(t, 'feature', { scopeId, threadId, quotedText });
89
+ run: (client, { target: t, targetId: tid, body, scopeId, threadId, quotedText, quotePrefix, quoteSuffix, parentUpdateId }) => {
90
+ assertOnly(t, 'feature', { scopeId, threadId });
91
+ assertOnly(t, ['feature', 'page'], { quotedText });
92
+ assertOnly(t, 'page', { quotePrefix, quoteSuffix });
76
93
  assertOnly(t, 'goal', { parentUpdateId });
94
+ if ((quotePrefix !== undefined || quoteSuffix !== undefined) && quotedText === undefined) {
95
+ throw new Error('quotePrefix/quoteSuffix need quotedText.');
96
+ }
77
97
  switch (t) {
78
98
  case 'action':
79
99
  return client.actionComments.add({ actionId: String(tid), content: body });
80
100
  case 'feature':
81
101
  return client.featureComments.create({ featureId: String(tid), body, scopeId, threadId, quotedText });
82
102
  case 'page':
83
- return client.pageComments.create({ pageId: String(tid), body });
103
+ return client.pageComments.create({
104
+ pageId: String(tid),
105
+ body,
106
+ ...(quotedText !== undefined ? { quotedText } : {}),
107
+ ...(quotePrefix !== undefined || quoteSuffix !== undefined
108
+ ? { quoteContext: { prefix: quotePrefix, suffix: quoteSuffix } }
109
+ : {}),
110
+ });
84
111
  case 'goal':
85
112
  return client.goalComments.add({ goalId: goalIdOf(tid), content: body, parentUpdateId });
86
113
  case 'ticket':
@@ -128,43 +155,49 @@ export const comments = {
128
155
  }),
129
156
  reply: op({
130
157
  effect: 'write',
131
- summary: 'Reply to a comment. Feature target only. Replies to replies still hang off the root comment.',
158
+ summary: 'Reply to a comment. Feature and page targets. Replies to replies still hang off the root comment.',
132
159
  params: z.object({
133
160
  target,
134
161
  commentId: z.string().describe('ID of the comment being replied to'),
135
162
  body,
136
163
  }),
137
164
  run: (client, { target: t, commentId, body }) => {
165
+ if (t === 'page')
166
+ return client.pageComments.reply({ parentId: commentId, body });
138
167
  if (t !== 'feature')
139
- unsupported('reply', t, 'feature');
168
+ unsupported('reply', t, 'feature, page');
140
169
  return client.featureComments.reply({ parentId: commentId, body });
141
170
  },
142
171
  }),
143
172
  resolve: op({
144
173
  effect: 'write',
145
- summary: 'Mark an anchored comment thread resolved. Feature target only; only anchored threads have a threadId.',
174
+ summary: 'Mark an anchored comment thread resolved. Feature and page targets; only anchored threads have a threadId.',
146
175
  params: z.object({
147
176
  target,
148
177
  targetId,
149
178
  threadId: z.string().describe('The anchored thread’s threadId (from the comment), not a comment ID'),
150
179
  }),
151
180
  run: (client, { target: t, targetId: tid, threadId }) => {
181
+ if (t === 'page')
182
+ return client.pageComments.resolve({ pageId: String(tid), threadId });
152
183
  if (t !== 'feature')
153
- unsupported('resolve', t, 'feature');
184
+ unsupported('resolve', t, 'feature, page');
154
185
  return client.featureComments.resolve({ featureId: String(tid), threadId });
155
186
  },
156
187
  }),
157
188
  unresolve: op({
158
189
  effect: 'write',
159
- summary: 'Reopen a resolved anchored comment thread. Feature target only.',
190
+ summary: 'Reopen a resolved anchored comment thread. Feature and page targets.',
160
191
  params: z.object({
161
192
  target,
162
193
  targetId,
163
194
  threadId: z.string().describe('The anchored thread’s threadId (from the comment), not a comment ID'),
164
195
  }),
165
196
  run: (client, { target: t, targetId: tid, threadId }) => {
197
+ if (t === 'page')
198
+ return client.pageComments.unresolve({ pageId: String(tid), threadId });
166
199
  if (t !== 'feature')
167
- unsupported('unresolve', t, 'feature');
200
+ unsupported('unresolve', t, 'feature, page');
168
201
  return client.featureComments.unresolve({ featureId: String(tid), threadId });
169
202
  },
170
203
  }),
@@ -1,6 +1,32 @@
1
+ import { type ExponentialClient } from 'exponential-sdk';
1
2
  import { type Domain } from './framework.js';
3
+ declare const RULE_KINDS: readonly ["REPO", "EPIC", "TYPE", "PRODUCT"];
4
+ export declare const FORBIDDEN_RULES_MESSAGE = "Only workspace owners and admins can change label rules.";
5
+ type WantedRule = {
6
+ kind: (typeof RULE_KINDS)[number];
7
+ match: string;
8
+ tagId: string;
9
+ };
10
+ /**
11
+ * Make a workspace's rules match `rules`: add the missing ones, keep the
12
+ * rest, and delete rules not in the list only when `prune` is set.
13
+ */
14
+ export declare function applyLabelRules(client: ExponentialClient, params: {
15
+ workspaceId: string;
16
+ rules: WantedRule[];
17
+ dryRun?: boolean;
18
+ prune?: boolean;
19
+ }): Promise<{
20
+ dryRun: boolean;
21
+ prune: boolean;
22
+ added: unknown[];
23
+ kept: import("exponential-sdk").TicketLabelRule[];
24
+ deleted: unknown[];
25
+ notInList: import("exponential-sdk").TicketLabelRule[];
26
+ }>;
2
27
  /** The server's tagEntityTypeSchema, in its order. */
3
28
  export declare const ENTITY_TYPES: readonly ["action", "ticket", "feature", "epic", "project", "goal", "resource", "recurringTask", "decision"];
4
29
  /** Entity types that take Pillars only; the server rejects a plain label on them. */
5
30
  export declare const PILLAR_ONLY_ENTITY_TYPES: readonly ["project", "goal", "resource", "recurringTask"];
6
31
  export declare const labels: Domain;
32
+ export {};
@@ -1,5 +1,79 @@
1
1
  import { z } from 'zod';
2
+ import { normaliseLabelRuleMatch } from 'exponential-sdk';
2
3
  import { id, op, workspaceId } from './framework.js';
4
+ const RULE_KINDS = ['REPO', 'EPIC', 'TYPE', 'PRODUCT'];
5
+ export const FORBIDDEN_RULES_MESSAGE = 'Only workspace owners and admins can change label rules.';
6
+ const ruleKind = z
7
+ .enum(RULE_KINDS)
8
+ .describe("What the rule compares: the ticket's linked PR repo, epic, type or product");
9
+ const ruleMatch = z
10
+ .string()
11
+ .min(1)
12
+ .max(300)
13
+ .describe('REPO: owner/name or a GitHub URL. TYPE: a ticket type, any case (BUG). EPIC: an epic ID. PRODUCT: a product ID.');
14
+ const ruleTagId = id('Label (tag) to add; from list. Global or from this workspace');
15
+ /** A FORBIDDEN from the server becomes the one message an admin needs. */
16
+ async function asAdmin(call) {
17
+ try {
18
+ return await call();
19
+ }
20
+ catch (error) {
21
+ const code = error?.data?.code;
22
+ if (code === 'FORBIDDEN')
23
+ throw new Error(FORBIDDEN_RULES_MESSAGE);
24
+ throw error;
25
+ }
26
+ }
27
+ /**
28
+ * Make a workspace's rules match `rules`: add the missing ones, keep the
29
+ * rest, and delete rules not in the list only when `prune` is set.
30
+ */
31
+ export async function applyLabelRules(client, params) {
32
+ const key = (kind, match, tagId) => `${kind}\u0000${match}\u0000${tagId}`;
33
+ const wanted = new Map();
34
+ for (const [index, rule] of params.rules.entries()) {
35
+ const match = normaliseLabelRuleMatch(rule.kind, rule.match);
36
+ if (!match)
37
+ throw new Error(`Rule ${index + 1}: "${rule.match}" is not a valid ${rule.kind} match.`);
38
+ wanted.set(key(rule.kind, match, rule.tagId), { ...rule, match });
39
+ }
40
+ const existing = await client.labels.listRules(params.workspaceId);
41
+ // The server stores matches normalised; normalise again so an older or
42
+ // hand-entered row still compares equal.
43
+ const existingKey = (r) => key(r.kind, normaliseLabelRuleMatch(r.kind, r.match) ?? r.match, r.tag.id);
44
+ const existingKeys = new Set(existing.map(existingKey));
45
+ const toAdd = [...wanted.entries()].filter(([k]) => !existingKeys.has(k)).map(([, r]) => r);
46
+ const kept = existing.filter((r) => wanted.has(existingKey(r)));
47
+ const extra = existing.filter((r) => !wanted.has(existingKey(r)));
48
+ const added = [];
49
+ const deleted = [];
50
+ if (params.dryRun) {
51
+ added.push(...toAdd);
52
+ if (params.prune)
53
+ deleted.push(...extra);
54
+ }
55
+ else {
56
+ await asAdmin(async () => {
57
+ for (const rule of toAdd) {
58
+ added.push(await client.labels.createRule({ workspaceId: params.workspaceId, ...rule }));
59
+ }
60
+ if (params.prune) {
61
+ for (const rule of extra) {
62
+ await client.labels.deleteRule(rule.id);
63
+ deleted.push(rule);
64
+ }
65
+ }
66
+ });
67
+ }
68
+ return {
69
+ dryRun: params.dryRun === true,
70
+ prune: params.prune === true,
71
+ added,
72
+ kept,
73
+ deleted,
74
+ notInList: params.prune ? [] : extra,
75
+ };
76
+ }
3
77
  /** The server's tagEntityTypeSchema, in its order. */
4
78
  export const ENTITY_TYPES = [
5
79
  'action',
@@ -52,7 +126,7 @@ const category = z
52
126
  .describe('Tag category; null means a plain label');
53
127
  export const labels = {
54
128
  name: 'labels',
55
- description: 'Labels and Pillars (both are tags). A tag whose category is "pillar" is a Pillar (a standing area of the workspace); any other tag is a label. Actions, tickets, features, epics and decisions (`decisions`) take Pillars and labels; projects, goals, resources and recurring tasks take Pillars only. There are global system tags and per-workspace tags. Creating or promoting a Pillar needs a workspace admin, in the app.',
129
+ description: 'Labels and Pillars (both are tags). A tag whose category is "pillar" is a Pillar (a standing area of the workspace); any other tag is a label. Actions, tickets, features, epics and decisions (`decisions`) take Pillars and labels; projects, goals, resources and recurring tasks take Pillars only. There are global system tags and per-workspace tags. Creating or promoting a Pillar needs a workspace admin, in the app. Ticket label rules (list_rules, create_rule, delete_rule, apply_rules) add a label to tickets automatically; only owners and admins change them.',
56
130
  operations: {
57
131
  list: op({
58
132
  effect: 'read',
@@ -94,5 +168,37 @@ export const labels = {
94
168
  }),
95
169
  run: (client, params) => client.labels.listForEntity(params),
96
170
  }),
171
+ list_rules: op({
172
+ effect: 'read',
173
+ summary: "List a workspace's ticket label rules. A rule adds its label to each ticket whose repo, epic, type or product matches, on create and when that field changes. Rules only add labels. Each rule has matchLabel: the epic or product name. Any member can read.",
174
+ params: z.object({ workspaceId }),
175
+ run: (client, params) => client.labels.listRules(params.workspaceId),
176
+ }),
177
+ create_rule: op({
178
+ effect: 'write',
179
+ summary: 'Add a ticket label rule. Owners and admins only. Adding a rule that exists returns the existing one. New rules do not relabel existing tickets.',
180
+ params: z.object({ workspaceId, kind: ruleKind, match: ruleMatch, tagId: ruleTagId }),
181
+ run: (client, params) => asAdmin(() => client.labels.createRule(params)),
182
+ }),
183
+ delete_rule: op({
184
+ effect: 'delete',
185
+ summary: 'Delete a ticket label rule. Owners and admins only. Tickets keep the labels it added.',
186
+ params: z.object({ id: id('Rule (from list_rules)') }),
187
+ run: (client, params) => asAdmin(() => client.labels.deleteRule(params.id)),
188
+ }),
189
+ apply_rules: op({
190
+ effect: 'delete',
191
+ summary: "Make a workspace's ticket label rules match a list. Adds the missing rules and keeps the rest; safe to repeat. Deletes rules not in the list only with prune. dryRun writes nothing. Returns { added, kept, deleted, notInList }. Owners and admins only.",
192
+ params: z.object({
193
+ workspaceId,
194
+ rules: z
195
+ .array(z.object({ kind: ruleKind, match: ruleMatch, tagId: ruleTagId }))
196
+ .max(500)
197
+ .describe('The whole rule set you want'),
198
+ dryRun: z.boolean().optional().describe('Show the changes and write nothing'),
199
+ prune: z.boolean().optional().describe('Also delete rules that are not in the list'),
200
+ }),
201
+ run: (client, params) => applyLabelRules(client, params),
202
+ }),
97
203
  },
98
204
  };
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "exponential-mcp",
3
- "version": "0.18.0",
4
- "description": "MCP server for Exponential - connect Claude to your projects, actions, goals, CRM, tickets and more",
3
+ "version": "0.20.0",
4
+ "mcpName": "io.github.exponential-im/exponential-mcp",
5
+ "description": "MCP server for Exponential: give Claude, Cursor, Codex or any MCP client tools over your projects, actions, OKRs, meetings, tickets and CRM",
5
6
  "main": "dist/index.js",
6
7
  "types": "dist/index.d.ts",
7
8
  "exports": {
@@ -32,7 +33,15 @@
32
33
  "claude",
33
34
  "exponential",
34
35
  "productivity",
35
- "anthropic"
36
+ "anthropic",
37
+ "mcp-server",
38
+ "model-context-protocol",
39
+ "cursor",
40
+ "codex",
41
+ "project-management",
42
+ "okr",
43
+ "tasks",
44
+ "ai-agents"
36
45
  ],
37
46
  "author": "Exponential",
38
47
  "license": "AGPL-3.0-or-later",
@@ -40,14 +49,14 @@
40
49
  "type": "git",
41
50
  "url": "git+https://github.com/exponential-im/exponential-mcp.git"
42
51
  },
43
- "homepage": "https://github.com/exponential-im/exponential-mcp#readme",
52
+ "homepage": "https://www.exponential.im/features/integrations",
44
53
  "bugs": {
45
54
  "url": "https://github.com/exponential-im/exponential-mcp/issues"
46
55
  },
47
56
  "dependencies": {
48
57
  "@modelcontextprotocol/sdk": "^1.30.0",
49
58
  "commander": "^12.0.0",
50
- "exponential-sdk": "^1.39.0",
59
+ "exponential-sdk": "^1.42.0",
51
60
  "zod": "^3.22.0",
52
61
  "zod-to-json-schema": "^3.25.2"
53
62
  },