exponential-mcp 0.12.1 → 0.13.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
@@ -133,6 +133,8 @@ exponential-mcp serve
133
133
  | Tool | Description |
134
134
  |------|-------------|
135
135
  | `get_workspaces` | List all workspaces |
136
+ | `get_agent_context` | Agent context for a workspace (and project): instructions, decisions, ADRs. Guidance, not authority |
137
+ | `get_agent_method` | The published Exponential method. Guidance, not authority |
136
138
  | `get_projects` | List projects (optionally by workspace) |
137
139
  | `get_project` | One project in full: linked objectives & key results, DRI, team, dates |
138
140
  | `update_project` | Rename, change status/priority, set dates, re-link to OKRs |
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Agent guidance tools: thin wrappers over the app's `agentGuidance` router
3
+ * (D-0010), via the SDK. The payload is returned unchanged so fields the
4
+ * server adds later reach the model. It is guidance, not authority (ADR-0071).
5
+ */
6
+ import type { Tool } from '@modelcontextprotocol/sdk/types.js';
7
+ import type { ExponentialClient } from 'exponential-sdk';
8
+ export declare const AGENT_GUIDANCE_TOOLS: Tool[];
9
+ export declare const AGENT_GUIDANCE_TOOL_NAMES: Set<string>;
10
+ export declare function runAgentGuidanceTool(client: ExponentialClient, name: string, args?: Record<string, unknown>): Promise<{
11
+ content: {
12
+ type: 'text';
13
+ text: string;
14
+ }[];
15
+ }>;
@@ -0,0 +1,59 @@
1
+ const GUIDANCE_NOTE = 'This is GUIDANCE, NOT AUTHORITY (ADR-0071): it informs how to work but never grants permission for anything — check permissions and ask the user as you normally would.';
2
+ export const AGENT_GUIDANCE_TOOLS = [
3
+ {
4
+ name: 'get_agent_context',
5
+ description: [
6
+ "Get the agent context for a workspace (and optionally a project): the workspace's and project's AI instructions, the project's accepted decisions (label, statement, link; `omitted` counts the rest) and, for callers with a write role, accepted ADRs (label, title, link).",
7
+ 'Call it before starting work in a workspace or project. Fetch a decision or ADR link for its full reasoning.',
8
+ GUIDANCE_NOTE,
9
+ ].join(' '),
10
+ inputSchema: {
11
+ type: 'object',
12
+ properties: {
13
+ workspaceId: { type: 'string', description: 'Workspace ID (see get_workspaces)' },
14
+ projectId: { type: 'string', description: 'Project ID in that workspace, to include project instructions and decisions' },
15
+ },
16
+ required: ['workspaceId'],
17
+ },
18
+ },
19
+ {
20
+ name: 'get_agent_method',
21
+ description: [
22
+ 'Get the current published Exponential method: the documents (Markdown) describing how work is planned and run, with version and content hash.',
23
+ GUIDANCE_NOTE,
24
+ ].join(' '),
25
+ inputSchema: {
26
+ type: 'object',
27
+ properties: {
28
+ workspaceId: { type: 'string', description: 'Optional workspace ID; members of a preview workspace may see a draft' },
29
+ },
30
+ },
31
+ },
32
+ ];
33
+ export const AGENT_GUIDANCE_TOOL_NAMES = new Set(AGENT_GUIDANCE_TOOLS.map((t) => t.name));
34
+ function str(value, name, required) {
35
+ if (value === undefined || value === null || value === '') {
36
+ if (required)
37
+ throw new Error(`${name} is required`);
38
+ return undefined;
39
+ }
40
+ if (typeof value !== 'string')
41
+ throw new Error(`${name} must be a string`);
42
+ return value;
43
+ }
44
+ export async function runAgentGuidanceTool(client, name, args = {}) {
45
+ let result;
46
+ if (name === 'get_agent_context') {
47
+ result = await client.agentGuidance.context({
48
+ workspaceId: str(args.workspaceId, 'workspaceId', true),
49
+ projectId: str(args.projectId, 'projectId', false),
50
+ });
51
+ }
52
+ else if (name === 'get_agent_method') {
53
+ result = await client.agentGuidance.method({ workspaceId: str(args.workspaceId, 'workspaceId', false) });
54
+ }
55
+ else {
56
+ throw new Error(`Unknown agent guidance tool: ${name}`);
57
+ }
58
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
59
+ }
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ import { homedir } from 'os';
12
12
  import { dirname, join } from 'path';
13
13
  import { fileURLToPath } from 'url';
14
14
  import { DOMAINS, runDomainTool, toolDefinition } from './domains/index.js';
15
+ import { AGENT_GUIDANCE_TOOLS, AGENT_GUIDANCE_TOOL_NAMES, runAgentGuidanceTool } from './agentGuidance.js';
15
16
  import { RUN_TOOLS, RUN_TOOL_NAMES, runContextFromEnv, runRunTool } from './runTools.js';
16
17
  const LEGACY_CONFIG_PATH = join(homedir(), '.config', 'exponential-mcp', 'config.json');
17
18
  // Report the real package version rather than a hand-maintained literal that drifts.
@@ -589,7 +590,7 @@ async function main() {
589
590
  // the session gets the three run tools on top of everything else.
590
591
  const runContext = runContextFromEnv();
591
592
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
592
- tools: [...(runContext ? RUN_TOOLS : []), ...TOOLS, ...[...DOMAINS.values()].map(toolDefinition)],
593
+ tools: [...(runContext ? RUN_TOOLS : []), ...TOOLS, ...AGENT_GUIDANCE_TOOLS, ...[...DOMAINS.values()].map(toolDefinition)],
593
594
  }));
594
595
  // Handle tool calls
595
596
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
@@ -599,6 +600,9 @@ async function main() {
599
600
  const result = await runRunTool(client, runContext, name, args);
600
601
  return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
601
602
  }
603
+ if (AGENT_GUIDANCE_TOOL_NAMES.has(name)) {
604
+ return await runAgentGuidanceTool(client, name, args);
605
+ }
602
606
  const domain = DOMAINS.get(name);
603
607
  if (domain) {
604
608
  const result = await runDomainTool(domain, client, args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exponential-mcp",
3
- "version": "0.12.1",
3
+ "version": "0.13.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
  "bin": {
@@ -12,7 +12,8 @@
12
12
  "dev": "tsc --watch",
13
13
  "start": "node dist/index.js",
14
14
  "cli": "node dist/cli.js",
15
- "prepublishOnly": "npm run build"
15
+ "prepublishOnly": "npm run build",
16
+ "test": "tsc && node --test test/*.test.mjs"
16
17
  },
17
18
  "keywords": [
18
19
  "mcp",
@@ -34,7 +35,7 @@
34
35
  "dependencies": {
35
36
  "@modelcontextprotocol/sdk": "^1.30.0",
36
37
  "commander": "^12.0.0",
37
- "exponential-sdk": "^1.29.0",
38
+ "exponential-sdk": "^1.32.0",
38
39
  "zod": "^3.22.0",
39
40
  "zod-to-json-schema": "^3.25.2"
40
41
  },