exponential-mcp 0.17.2 → 0.19.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 +12 -0
- package/dist/domains/labels.d.ts +26 -0
- package/dist/domains/labels.js +107 -1
- package/dist/domains/projects.js +22 -0
- package/dist/tools.js +57 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -183,6 +183,7 @@ exponential-mcp serve
|
|
|
183
183
|
| `get_agent_method` | The published Exponential method. Guidance, not authority |
|
|
184
184
|
| `get_projects` | List projects (optionally by workspace) |
|
|
185
185
|
| `get_project` | One project in full: linked objectives & key results, DRI, team, dates |
|
|
186
|
+
| `create_project` | Create a project (personal, or in a workspace) |
|
|
186
187
|
| `update_project` | Rename, change status/priority, set dates, re-link to OKRs |
|
|
187
188
|
| `get_actions` | List actions/tasks (filter by project or status; no date filtering) |
|
|
188
189
|
| `get_todays_actions` | **What's on your plate now** — overdue / today / inbox, across all workspaces |
|
|
@@ -230,6 +231,17 @@ settings page: list, create, update, set_holders, delete, and import_many
|
|
|
230
231
|
(upsert by title, with a dry run). Writes need your own API key, not an agent
|
|
231
232
|
key, and owner/admin, except that a holder may edit their own Position's remit.
|
|
232
233
|
|
|
234
|
+
`labels` also manages ticket label rules. A rule adds a label to each ticket
|
|
235
|
+
whose repo, epic, type or product matches. Rules only add labels.
|
|
236
|
+
|
|
237
|
+
- `list_rules`: any member.
|
|
238
|
+
- `create_rule`, `delete_rule`: owners and admins only.
|
|
239
|
+
- `apply_rules`: makes the rules match a list. It adds the missing rules and
|
|
240
|
+
keeps the rest, so you can run it again. It deletes rules only with `prune`.
|
|
241
|
+
`dryRun` writes nothing.
|
|
242
|
+
|
|
243
|
+
Other accounts get "Only workspace owners and admins can change label rules."
|
|
244
|
+
|
|
233
245
|
`databases` is the typed write path for tables inside pages (ADR-0078): a
|
|
234
246
|
database is a block in a page body and each row is a page. **Values are typed
|
|
235
247
|
per property** — a select takes an option name, a date an ISO string, a person
|
package/dist/domains/labels.d.ts
CHANGED
|
@@ -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 {};
|
package/dist/domains/labels.js
CHANGED
|
@@ -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/dist/domains/projects.js
CHANGED
|
@@ -25,6 +25,28 @@ export const projects = {
|
|
|
25
25
|
}),
|
|
26
26
|
run: (client, { id }) => client.projects.get(id),
|
|
27
27
|
}),
|
|
28
|
+
create: op({
|
|
29
|
+
effect: 'write',
|
|
30
|
+
summary: 'Create a project. Only name is required; status defaults to ACTIVE, priority to NONE. Omit workspaceId for a personal project. Returns the new project with its id.',
|
|
31
|
+
params: z.object({
|
|
32
|
+
name: z.string().min(1),
|
|
33
|
+
description: z.string().optional(),
|
|
34
|
+
workspaceId: z.string().optional().describe('Workspace ID (see the `workspaces` tool); omit for a personal project'),
|
|
35
|
+
status: z.enum(['ACTIVE', 'ON_HOLD', 'COMPLETED', 'CANCELLED']).optional(),
|
|
36
|
+
priority: z.enum(['HIGH', 'MEDIUM', 'LOW', 'NONE']).optional(),
|
|
37
|
+
productId: z.string().optional().describe('Product ID — must be in the same workspace'),
|
|
38
|
+
driId: z.string().optional().describe('User ID of the directly responsible individual'),
|
|
39
|
+
teamId: z.string().optional(),
|
|
40
|
+
goalIds: z.array(z.string()).optional().describe('Objective links; integer goal ids as strings'),
|
|
41
|
+
keyResultIds: z.array(z.string()).optional(),
|
|
42
|
+
lifeDomainIds: z.array(z.number().int()).optional(),
|
|
43
|
+
reviewDate: date('Review date').optional(),
|
|
44
|
+
nextActionDate: date('Next action date').optional(),
|
|
45
|
+
startDate: date('Start date').optional(),
|
|
46
|
+
endDate: date('End date').optional(),
|
|
47
|
+
}),
|
|
48
|
+
run: (client, params) => client.projects.create(params),
|
|
49
|
+
}),
|
|
28
50
|
update: op({
|
|
29
51
|
effect: 'write',
|
|
30
52
|
summary: 'Update a project. Only the fields you pass change (omitted name/status/priority cost one extra read).',
|
package/dist/tools.js
CHANGED
|
@@ -100,6 +100,40 @@ const TOOLS = [
|
|
|
100
100
|
required: ['id']
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
|
+
{
|
|
104
|
+
name: 'create_project',
|
|
105
|
+
annotations: writes('Create project'),
|
|
106
|
+
description: 'Create a new project. Only name is required; status defaults to ACTIVE and priority to NONE. Pass workspaceId (from get_workspaces) to file it in a workspace, or omit it for a personal project. Returns the new project ID.',
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: 'object',
|
|
109
|
+
properties: {
|
|
110
|
+
name: { type: 'string', description: 'Project name' },
|
|
111
|
+
description: { type: 'string', description: 'Project description' },
|
|
112
|
+
workspaceId: { type: 'string', description: 'Workspace ID; omit for a personal project' },
|
|
113
|
+
status: {
|
|
114
|
+
type: 'string',
|
|
115
|
+
enum: ['ACTIVE', 'ON_HOLD', 'COMPLETED', 'CANCELLED'],
|
|
116
|
+
description: 'Lifecycle status (default ACTIVE)'
|
|
117
|
+
},
|
|
118
|
+
priority: {
|
|
119
|
+
type: 'string',
|
|
120
|
+
enum: ['HIGH', 'MEDIUM', 'LOW', 'NONE'],
|
|
121
|
+
description: 'Priority (default NONE)'
|
|
122
|
+
},
|
|
123
|
+
productId: { type: 'string', description: 'Product ID (same workspace)' },
|
|
124
|
+
driId: { type: 'string', description: 'User ID of the directly responsible individual' },
|
|
125
|
+
goalIds: {
|
|
126
|
+
type: 'array',
|
|
127
|
+
items: { type: 'string' },
|
|
128
|
+
description: 'Objective IDs (integers, passed as strings) to link'
|
|
129
|
+
},
|
|
130
|
+
keyResultIds: { type: 'array', items: { type: 'string' }, description: 'Key result IDs to link' },
|
|
131
|
+
startDate: { type: 'string', description: 'ISO datetime' },
|
|
132
|
+
endDate: { type: 'string', description: 'ISO datetime' }
|
|
133
|
+
},
|
|
134
|
+
required: ['name']
|
|
135
|
+
}
|
|
136
|
+
},
|
|
103
137
|
{
|
|
104
138
|
name: 'update_project',
|
|
105
139
|
annotations: writes('Update project'),
|
|
@@ -563,6 +597,29 @@ export async function callTool(client, name, args, options = {}) {
|
|
|
563
597
|
],
|
|
564
598
|
};
|
|
565
599
|
}
|
|
600
|
+
case 'create_project': {
|
|
601
|
+
const project = await client.projects.create({
|
|
602
|
+
name: args?.name,
|
|
603
|
+
description: args?.description,
|
|
604
|
+
workspaceId: args?.workspaceId,
|
|
605
|
+
status: args?.status,
|
|
606
|
+
priority: args?.priority,
|
|
607
|
+
productId: args?.productId,
|
|
608
|
+
driId: args?.driId,
|
|
609
|
+
goalIds: args?.goalIds,
|
|
610
|
+
keyResultIds: args?.keyResultIds,
|
|
611
|
+
startDate: parseDateArg(args?.startDate) ?? undefined,
|
|
612
|
+
endDate: parseDateArg(args?.endDate) ?? undefined,
|
|
613
|
+
});
|
|
614
|
+
return {
|
|
615
|
+
content: [
|
|
616
|
+
{
|
|
617
|
+
type: 'text',
|
|
618
|
+
text: `Created project: ${project.name} (ID: ${project.id})`,
|
|
619
|
+
},
|
|
620
|
+
],
|
|
621
|
+
};
|
|
622
|
+
}
|
|
566
623
|
case 'update_project': {
|
|
567
624
|
// `null` clears driId; the string "null" is the JSON-as-text form the
|
|
568
625
|
// model sometimes emits, same as parseDateArg handles for dates.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "exponential-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "MCP server for Exponential - connect Claude to your projects, actions, goals, CRM, tickets and more",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
49
49
|
"commander": "^12.0.0",
|
|
50
|
-
"exponential-sdk": "^1.
|
|
50
|
+
"exponential-sdk": "^1.40.0",
|
|
51
51
|
"zod": "^3.22.0",
|
|
52
52
|
"zod-to-json-schema": "^3.25.2"
|
|
53
53
|
},
|