@letpeoplework/lighthouse-mcp-core 0.4.1 → 0.5.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.
@@ -1,169 +1,237 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
1
20
  // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ createMcpCoreRuntime: () => createMcpCoreRuntime,
24
+ getMcpCorePackageContract: () => getMcpCorePackageContract,
25
+ registerMcpTools: () => registerMcpTools
26
+ });
27
+ module.exports = __toCommonJS(index_exports);
28
+ var import_zod = require("zod");
2
29
  var getMcpCorePackageContract = () => ({
3
30
  name: "@letpeoplework/lighthouse-mcp-core",
4
31
  dependsOn: "@letpeoplework/lighthouse-client",
5
32
  transports: ["stdio", "streamable-http"]
6
33
  });
34
+ var emptyInputSchema = {
35
+ type: "object",
36
+ properties: {},
37
+ additionalProperties: false
38
+ };
39
+ var idInputSchema = {
40
+ type: "object",
41
+ properties: {
42
+ id: {
43
+ type: "integer",
44
+ description: "Unique numeric identifier."
45
+ }
46
+ },
47
+ required: ["id"],
48
+ additionalProperties: false
49
+ };
50
+ var dateRangeProperties = {
51
+ startDate: {
52
+ type: "string",
53
+ description: "Inclusive start date in ISO format (YYYY-MM-DD)."
54
+ },
55
+ endDate: {
56
+ type: "string",
57
+ description: "Inclusive end date in ISO format (YYYY-MM-DD)."
58
+ }
59
+ };
7
60
  var toolDefinitions = [
8
61
  {
9
62
  name: "lighthouse.health.check",
10
- description: "Validate Lighthouse API connectivity.",
11
- inputSchema: {
12
- type: "object",
13
- properties: {},
14
- additionalProperties: false
15
- }
63
+ description: "Check connectivity to Lighthouse and return whether the configured endpoint is reachable.",
64
+ inputSchema: emptyInputSchema
16
65
  },
17
66
  {
18
67
  name: "lighthouse.version.get",
19
- description: "Get Lighthouse version from /api/v1/version/current.",
20
- inputSchema: {
21
- type: "object",
22
- properties: {},
23
- additionalProperties: false
24
- }
68
+ description: "Retrieve the Lighthouse server version from the version endpoint.",
69
+ inputSchema: emptyInputSchema
25
70
  },
26
71
  {
27
72
  name: "lighthouse.worktracking.list",
28
- description: "List work-tracking system connections.",
29
- inputSchema: {
30
- type: "object",
31
- properties: {},
32
- additionalProperties: false
33
- }
73
+ description: "List configured work-tracking system connections in Lighthouse.",
74
+ inputSchema: emptyInputSchema
34
75
  },
35
76
  {
36
77
  name: "lighthouse.worktracking.get",
37
- description: "Get one work-tracking system connection by id.",
38
- inputSchema: {
39
- type: "object",
40
- properties: {},
41
- additionalProperties: false
42
- }
78
+ description: "Get a single work-tracking system connection by ID.",
79
+ inputSchema: idInputSchema
43
80
  },
44
81
  {
45
82
  name: "lighthouse.team.list",
46
- description: "List teams.",
47
- inputSchema: {
48
- type: "object",
49
- properties: {},
50
- additionalProperties: false
51
- }
83
+ description: "List all teams available in Lighthouse.",
84
+ inputSchema: emptyInputSchema
52
85
  },
53
86
  {
54
87
  name: "lighthouse.team.get",
55
- description: "Get one team by id.",
56
- inputSchema: {
57
- type: "object",
58
- properties: {},
59
- additionalProperties: false
60
- }
88
+ description: "Get full details for one team by ID.",
89
+ inputSchema: idInputSchema
61
90
  },
62
91
  {
63
92
  name: "lighthouse.team.refresh",
64
- description: "Trigger a refresh for one team.",
65
- inputSchema: {
66
- type: "object",
67
- properties: {},
68
- additionalProperties: false
69
- }
93
+ description: "Trigger data refresh for a team by ID.",
94
+ inputSchema: idInputSchema
70
95
  },
71
96
  {
72
97
  name: "lighthouse.portfolio.list",
73
- description: "List portfolios.",
74
- inputSchema: {
75
- type: "object",
76
- properties: {},
77
- additionalProperties: false
78
- }
98
+ description: "List all portfolios in Lighthouse.",
99
+ inputSchema: emptyInputSchema
79
100
  },
80
101
  {
81
102
  name: "lighthouse.portfolio.get",
82
- description: "Get one portfolio by id.",
83
- inputSchema: {
84
- type: "object",
85
- properties: {},
86
- additionalProperties: false
87
- }
103
+ description: "Get full details for one portfolio by ID.",
104
+ inputSchema: idInputSchema
88
105
  },
89
106
  {
90
107
  name: "lighthouse.portfolio.refresh",
91
- description: "Trigger a refresh for one portfolio.",
92
- inputSchema: {
93
- type: "object",
94
- properties: {},
95
- additionalProperties: false
96
- }
108
+ description: "Trigger data refresh for a portfolio by ID.",
109
+ inputSchema: idInputSchema
97
110
  },
98
111
  {
99
112
  name: "lighthouse.team.metrics.throughput",
100
- description: "Get throughput run-chart data for a team. Requires id. Optional startDate and endDate (ISO date strings, defaults to last 90 days).",
113
+ description: "Get throughput run-chart data for a team by ID, optionally filtered by start and end dates.",
101
114
  inputSchema: {
102
115
  type: "object",
103
- properties: {},
116
+ properties: {
117
+ ...idInputSchema.properties,
118
+ ...dateRangeProperties
119
+ },
120
+ required: ["id"],
104
121
  additionalProperties: false
105
122
  }
106
123
  },
107
124
  {
108
125
  name: "lighthouse.team.metrics.cycleTimePercentiles",
109
- description: "Get cycle-time percentiles for a team. Requires id. Optional startDate and endDate (ISO date strings, defaults to last 90 days).",
126
+ description: "Get cycle-time percentiles for a team by ID, optionally filtered by start and end dates.",
110
127
  inputSchema: {
111
128
  type: "object",
112
- properties: {},
129
+ properties: {
130
+ ...idInputSchema.properties,
131
+ ...dateRangeProperties
132
+ },
133
+ required: ["id"],
113
134
  additionalProperties: false
114
135
  }
115
136
  },
116
137
  {
117
138
  name: "lighthouse.portfolio.metrics.throughput",
118
- description: "Get throughput run-chart data for a portfolio. Requires id. Optional startDate and endDate (ISO date strings, defaults to last 90 days).",
139
+ description: "Get throughput run-chart data for a portfolio by ID, optionally filtered by start and end dates.",
119
140
  inputSchema: {
120
141
  type: "object",
121
- properties: {},
142
+ properties: {
143
+ ...idInputSchema.properties,
144
+ ...dateRangeProperties
145
+ },
146
+ required: ["id"],
122
147
  additionalProperties: false
123
148
  }
124
149
  },
125
150
  {
126
151
  name: "lighthouse.feature.get",
127
- description: "Get features by ids (provide ids array) or by reference ids (provide refs array).",
152
+ description: "Get feature details by numeric IDs or external reference IDs.",
128
153
  inputSchema: {
129
154
  type: "object",
130
- properties: {},
155
+ properties: {
156
+ ids: {
157
+ type: "array",
158
+ items: {
159
+ type: "integer"
160
+ },
161
+ description: "Feature IDs."
162
+ },
163
+ refs: {
164
+ type: "array",
165
+ items: {
166
+ type: "string"
167
+ },
168
+ description: "Feature reference identifiers."
169
+ }
170
+ },
131
171
  additionalProperties: false
132
172
  }
133
173
  },
134
174
  {
135
175
  name: "lighthouse.feature.workitems",
136
- description: "Get work items for a feature. Requires id.",
137
- inputSchema: {
138
- type: "object",
139
- properties: {},
140
- additionalProperties: false
141
- }
176
+ description: "Get work items linked to a feature by ID.",
177
+ inputSchema: idInputSchema
142
178
  },
143
179
  {
144
180
  name: "lighthouse.delivery.list",
145
- description: "List deliveries for a portfolio. Requires id (portfolio id).",
146
- inputSchema: {
147
- type: "object",
148
- properties: {},
149
- additionalProperties: false
150
- }
181
+ description: "List deliveries for a portfolio by portfolio ID.",
182
+ inputSchema: idInputSchema
151
183
  },
152
184
  {
153
185
  name: "lighthouse.forecast.manual",
154
- description: "Run a manual forecast for a team. Requires id (team id). Optional remainingItems and targetDate.",
186
+ description: "Run a manual forecast for a team by ID with optional remaining items and target date.",
155
187
  inputSchema: {
156
188
  type: "object",
157
- properties: {},
189
+ properties: {
190
+ ...idInputSchema.properties,
191
+ remainingItems: {
192
+ type: "integer",
193
+ description: "Remaining items to forecast."
194
+ },
195
+ targetDate: {
196
+ type: "string",
197
+ description: "Optional target date in ISO format (YYYY-MM-DD)."
198
+ }
199
+ },
200
+ required: ["id"],
158
201
  additionalProperties: false
159
202
  }
160
203
  },
161
204
  {
162
205
  name: "lighthouse.forecast.backtest",
163
- description: "Run a backtest forecast for a team. Requires id, startDate, endDate, historicalStartDate, historicalEndDate.",
206
+ description: "Run a forecast backtest for a team by ID using forecast and historical date ranges.",
164
207
  inputSchema: {
165
208
  type: "object",
166
- properties: {},
209
+ properties: {
210
+ ...idInputSchema.properties,
211
+ startDate: {
212
+ type: "string",
213
+ description: "Forecast start date in ISO format (YYYY-MM-DD)."
214
+ },
215
+ endDate: {
216
+ type: "string",
217
+ description: "Forecast end date in ISO format (YYYY-MM-DD)."
218
+ },
219
+ historicalStartDate: {
220
+ type: "string",
221
+ description: "Historical sample start date in ISO format (YYYY-MM-DD)."
222
+ },
223
+ historicalEndDate: {
224
+ type: "string",
225
+ description: "Historical sample end date in ISO format (YYYY-MM-DD)."
226
+ }
227
+ },
228
+ required: [
229
+ "id",
230
+ "startDate",
231
+ "endDate",
232
+ "historicalStartDate",
233
+ "historicalEndDate"
234
+ ],
167
235
  additionalProperties: false
168
236
  }
169
237
  }
@@ -210,6 +278,53 @@ var getDateRange = (argumentsPayload) => {
210
278
  }
211
279
  return void 0;
212
280
  };
281
+ var isoDateStringSchema = import_zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/u, "Expected ISO date in YYYY-MM-DD format.");
282
+ var toolInputSchemas = {
283
+ "lighthouse.health.check": import_zod.z.object({}),
284
+ "lighthouse.version.get": import_zod.z.object({}),
285
+ "lighthouse.worktracking.list": import_zod.z.object({}),
286
+ "lighthouse.worktracking.get": import_zod.z.object({ id: import_zod.z.number().int() }),
287
+ "lighthouse.team.list": import_zod.z.object({}),
288
+ "lighthouse.team.get": import_zod.z.object({ id: import_zod.z.number().int() }),
289
+ "lighthouse.team.refresh": import_zod.z.object({ id: import_zod.z.number().int() }),
290
+ "lighthouse.portfolio.list": import_zod.z.object({}),
291
+ "lighthouse.portfolio.get": import_zod.z.object({ id: import_zod.z.number().int() }),
292
+ "lighthouse.portfolio.refresh": import_zod.z.object({ id: import_zod.z.number().int() }),
293
+ "lighthouse.team.metrics.throughput": import_zod.z.object({
294
+ id: import_zod.z.number().int(),
295
+ startDate: isoDateStringSchema.optional(),
296
+ endDate: isoDateStringSchema.optional()
297
+ }),
298
+ "lighthouse.team.metrics.cycleTimePercentiles": import_zod.z.object({
299
+ id: import_zod.z.number().int(),
300
+ startDate: isoDateStringSchema.optional(),
301
+ endDate: isoDateStringSchema.optional()
302
+ }),
303
+ "lighthouse.portfolio.metrics.throughput": import_zod.z.object({
304
+ id: import_zod.z.number().int(),
305
+ startDate: isoDateStringSchema.optional(),
306
+ endDate: isoDateStringSchema.optional()
307
+ }),
308
+ "lighthouse.feature.get": import_zod.z.object({
309
+ ids: import_zod.z.array(import_zod.z.number().int()).optional(),
310
+ refs: import_zod.z.array(import_zod.z.string()).optional()
311
+ }),
312
+ "lighthouse.feature.workitems": import_zod.z.object({ id: import_zod.z.number().int() }),
313
+ "lighthouse.delivery.list": import_zod.z.object({ id: import_zod.z.number().int() }),
314
+ "lighthouse.forecast.manual": import_zod.z.object({
315
+ id: import_zod.z.number().int(),
316
+ remainingItems: import_zod.z.number().int().optional(),
317
+ targetDate: isoDateStringSchema.optional()
318
+ }),
319
+ "lighthouse.forecast.backtest": import_zod.z.object({
320
+ id: import_zod.z.number().int(),
321
+ startDate: isoDateStringSchema,
322
+ endDate: isoDateStringSchema,
323
+ historicalStartDate: isoDateStringSchema,
324
+ historicalEndDate: isoDateStringSchema
325
+ })
326
+ };
327
+ var isReadOnlyTool = (toolName) => !toolName.endsWith(".refresh");
213
328
  var createMcpCoreRuntime = (dependencies) => ({
214
329
  listTools: () => toolDefinitions,
215
330
  callTool: async (name, argumentsPayload) => {
@@ -219,8 +334,9 @@ var createMcpCoreRuntime = (dependencies) => ({
219
334
  if (health.category === "success") {
220
335
  return getSuccessToolResult("connectivity: success");
221
336
  }
337
+ const healthReasonSuffix = health.reason === void 0 ? "" : ` (${health.reason})`;
222
338
  return getErrorToolResult(
223
- `connectivity: ${health.category}${health.reason !== void 0 ? ` (${health.reason})` : ""}`
339
+ `connectivity: ${health.category}${healthReasonSuffix}`
224
340
  );
225
341
  }
226
342
  if (name === "lighthouse.version.get") {
@@ -500,7 +616,33 @@ var createMcpCoreRuntime = (dependencies) => ({
500
616
  return getErrorToolResult(`Unknown tool: ${name}`);
501
617
  }
502
618
  });
503
- export {
504
- createMcpCoreRuntime,
505
- getMcpCorePackageContract
619
+ var registerMcpTools = (server, dependencies) => {
620
+ const runtime = createMcpCoreRuntime(dependencies);
621
+ for (const tool of toolDefinitions) {
622
+ server.registerTool(
623
+ tool.name,
624
+ {
625
+ description: tool.description,
626
+ inputSchema: toolInputSchemas[tool.name],
627
+ annotations: {
628
+ readOnlyHint: isReadOnlyTool(tool.name),
629
+ idempotentHint: isReadOnlyTool(tool.name),
630
+ openWorldHint: false
631
+ }
632
+ },
633
+ async (argumentsPayload) => {
634
+ const result = await runtime.callTool(tool.name, argumentsPayload);
635
+ return {
636
+ ...result,
637
+ content: [...result.content]
638
+ };
639
+ }
640
+ );
641
+ }
506
642
  };
643
+ // Annotate the CommonJS export names for ESM import in node:
644
+ 0 && (module.exports = {
645
+ createMcpCoreRuntime,
646
+ getMcpCorePackageContract,
647
+ registerMcpTools
648
+ });
@@ -1,3 +1,5 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+
1
3
  type McpCorePackageContract = {
2
4
  readonly name: "@letpeoplework/lighthouse-mcp-core";
3
5
  readonly dependsOn: "@letpeoplework/lighthouse-client";
@@ -17,7 +19,8 @@ type McpToolDefinition = {
17
19
  readonly description: string;
18
20
  readonly inputSchema: {
19
21
  readonly type: "object";
20
- readonly properties: Record<string, never>;
22
+ readonly properties: Record<string, unknown>;
23
+ readonly required?: readonly string[];
21
24
  readonly additionalProperties: false;
22
25
  };
23
26
  };
@@ -262,5 +265,6 @@ type McpCoreRuntime = {
262
265
  readonly callTool: (name: string, argumentsPayload: unknown) => Promise<McpToolResult>;
263
266
  };
264
267
  declare const createMcpCoreRuntime: (dependencies: McpCoreRuntimeDependencies) => McpCoreRuntime;
268
+ declare const registerMcpTools: (server: Pick<McpServer, "registerTool">, dependencies: McpCoreRuntimeDependencies) => void;
265
269
 
266
- export { type McpCorePackageContract, type McpCoreRuntime, type McpCoreRuntimeDependencies, type McpToolDefinition, type McpToolResult, createMcpCoreRuntime, getMcpCorePackageContract };
270
+ export { type McpCorePackageContract, type McpCoreRuntime, type McpCoreRuntimeDependencies, type McpToolDefinition, type McpToolResult, createMcpCoreRuntime, getMcpCorePackageContract, registerMcpTools };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+
1
3
  type McpCorePackageContract = {
2
4
  readonly name: "@letpeoplework/lighthouse-mcp-core";
3
5
  readonly dependsOn: "@letpeoplework/lighthouse-client";
@@ -17,7 +19,8 @@ type McpToolDefinition = {
17
19
  readonly description: string;
18
20
  readonly inputSchema: {
19
21
  readonly type: "object";
20
- readonly properties: Record<string, never>;
22
+ readonly properties: Record<string, unknown>;
23
+ readonly required?: readonly string[];
21
24
  readonly additionalProperties: false;
22
25
  };
23
26
  };
@@ -262,5 +265,6 @@ type McpCoreRuntime = {
262
265
  readonly callTool: (name: string, argumentsPayload: unknown) => Promise<McpToolResult>;
263
266
  };
264
267
  declare const createMcpCoreRuntime: (dependencies: McpCoreRuntimeDependencies) => McpCoreRuntime;
268
+ declare const registerMcpTools: (server: Pick<McpServer, "registerTool">, dependencies: McpCoreRuntimeDependencies) => void;
265
269
 
266
- export { type McpCorePackageContract, type McpCoreRuntime, type McpCoreRuntimeDependencies, type McpToolDefinition, type McpToolResult, createMcpCoreRuntime, getMcpCorePackageContract };
270
+ export { type McpCorePackageContract, type McpCoreRuntime, type McpCoreRuntimeDependencies, type McpToolDefinition, type McpToolResult, createMcpCoreRuntime, getMcpCorePackageContract, registerMcpTools };
package/dist/index.js CHANGED
@@ -1,194 +1,211 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
1
  // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- createMcpCoreRuntime: () => createMcpCoreRuntime,
24
- getMcpCorePackageContract: () => getMcpCorePackageContract
25
- });
26
- module.exports = __toCommonJS(index_exports);
2
+ import { z } from "zod";
27
3
  var getMcpCorePackageContract = () => ({
28
4
  name: "@letpeoplework/lighthouse-mcp-core",
29
5
  dependsOn: "@letpeoplework/lighthouse-client",
30
6
  transports: ["stdio", "streamable-http"]
31
7
  });
8
+ var emptyInputSchema = {
9
+ type: "object",
10
+ properties: {},
11
+ additionalProperties: false
12
+ };
13
+ var idInputSchema = {
14
+ type: "object",
15
+ properties: {
16
+ id: {
17
+ type: "integer",
18
+ description: "Unique numeric identifier."
19
+ }
20
+ },
21
+ required: ["id"],
22
+ additionalProperties: false
23
+ };
24
+ var dateRangeProperties = {
25
+ startDate: {
26
+ type: "string",
27
+ description: "Inclusive start date in ISO format (YYYY-MM-DD)."
28
+ },
29
+ endDate: {
30
+ type: "string",
31
+ description: "Inclusive end date in ISO format (YYYY-MM-DD)."
32
+ }
33
+ };
32
34
  var toolDefinitions = [
33
35
  {
34
36
  name: "lighthouse.health.check",
35
- description: "Validate Lighthouse API connectivity.",
36
- inputSchema: {
37
- type: "object",
38
- properties: {},
39
- additionalProperties: false
40
- }
37
+ description: "Check connectivity to Lighthouse and return whether the configured endpoint is reachable.",
38
+ inputSchema: emptyInputSchema
41
39
  },
42
40
  {
43
41
  name: "lighthouse.version.get",
44
- description: "Get Lighthouse version from /api/v1/version/current.",
45
- inputSchema: {
46
- type: "object",
47
- properties: {},
48
- additionalProperties: false
49
- }
42
+ description: "Retrieve the Lighthouse server version from the version endpoint.",
43
+ inputSchema: emptyInputSchema
50
44
  },
51
45
  {
52
46
  name: "lighthouse.worktracking.list",
53
- description: "List work-tracking system connections.",
54
- inputSchema: {
55
- type: "object",
56
- properties: {},
57
- additionalProperties: false
58
- }
47
+ description: "List configured work-tracking system connections in Lighthouse.",
48
+ inputSchema: emptyInputSchema
59
49
  },
60
50
  {
61
51
  name: "lighthouse.worktracking.get",
62
- description: "Get one work-tracking system connection by id.",
63
- inputSchema: {
64
- type: "object",
65
- properties: {},
66
- additionalProperties: false
67
- }
52
+ description: "Get a single work-tracking system connection by ID.",
53
+ inputSchema: idInputSchema
68
54
  },
69
55
  {
70
56
  name: "lighthouse.team.list",
71
- description: "List teams.",
72
- inputSchema: {
73
- type: "object",
74
- properties: {},
75
- additionalProperties: false
76
- }
57
+ description: "List all teams available in Lighthouse.",
58
+ inputSchema: emptyInputSchema
77
59
  },
78
60
  {
79
61
  name: "lighthouse.team.get",
80
- description: "Get one team by id.",
81
- inputSchema: {
82
- type: "object",
83
- properties: {},
84
- additionalProperties: false
85
- }
62
+ description: "Get full details for one team by ID.",
63
+ inputSchema: idInputSchema
86
64
  },
87
65
  {
88
66
  name: "lighthouse.team.refresh",
89
- description: "Trigger a refresh for one team.",
90
- inputSchema: {
91
- type: "object",
92
- properties: {},
93
- additionalProperties: false
94
- }
67
+ description: "Trigger data refresh for a team by ID.",
68
+ inputSchema: idInputSchema
95
69
  },
96
70
  {
97
71
  name: "lighthouse.portfolio.list",
98
- description: "List portfolios.",
99
- inputSchema: {
100
- type: "object",
101
- properties: {},
102
- additionalProperties: false
103
- }
72
+ description: "List all portfolios in Lighthouse.",
73
+ inputSchema: emptyInputSchema
104
74
  },
105
75
  {
106
76
  name: "lighthouse.portfolio.get",
107
- description: "Get one portfolio by id.",
108
- inputSchema: {
109
- type: "object",
110
- properties: {},
111
- additionalProperties: false
112
- }
77
+ description: "Get full details for one portfolio by ID.",
78
+ inputSchema: idInputSchema
113
79
  },
114
80
  {
115
81
  name: "lighthouse.portfolio.refresh",
116
- description: "Trigger a refresh for one portfolio.",
117
- inputSchema: {
118
- type: "object",
119
- properties: {},
120
- additionalProperties: false
121
- }
82
+ description: "Trigger data refresh for a portfolio by ID.",
83
+ inputSchema: idInputSchema
122
84
  },
123
85
  {
124
86
  name: "lighthouse.team.metrics.throughput",
125
- description: "Get throughput run-chart data for a team. Requires id. Optional startDate and endDate (ISO date strings, defaults to last 90 days).",
87
+ description: "Get throughput run-chart data for a team by ID, optionally filtered by start and end dates.",
126
88
  inputSchema: {
127
89
  type: "object",
128
- properties: {},
90
+ properties: {
91
+ ...idInputSchema.properties,
92
+ ...dateRangeProperties
93
+ },
94
+ required: ["id"],
129
95
  additionalProperties: false
130
96
  }
131
97
  },
132
98
  {
133
99
  name: "lighthouse.team.metrics.cycleTimePercentiles",
134
- description: "Get cycle-time percentiles for a team. Requires id. Optional startDate and endDate (ISO date strings, defaults to last 90 days).",
100
+ description: "Get cycle-time percentiles for a team by ID, optionally filtered by start and end dates.",
135
101
  inputSchema: {
136
102
  type: "object",
137
- properties: {},
103
+ properties: {
104
+ ...idInputSchema.properties,
105
+ ...dateRangeProperties
106
+ },
107
+ required: ["id"],
138
108
  additionalProperties: false
139
109
  }
140
110
  },
141
111
  {
142
112
  name: "lighthouse.portfolio.metrics.throughput",
143
- description: "Get throughput run-chart data for a portfolio. Requires id. Optional startDate and endDate (ISO date strings, defaults to last 90 days).",
113
+ description: "Get throughput run-chart data for a portfolio by ID, optionally filtered by start and end dates.",
144
114
  inputSchema: {
145
115
  type: "object",
146
- properties: {},
116
+ properties: {
117
+ ...idInputSchema.properties,
118
+ ...dateRangeProperties
119
+ },
120
+ required: ["id"],
147
121
  additionalProperties: false
148
122
  }
149
123
  },
150
124
  {
151
125
  name: "lighthouse.feature.get",
152
- description: "Get features by ids (provide ids array) or by reference ids (provide refs array).",
126
+ description: "Get feature details by numeric IDs or external reference IDs.",
153
127
  inputSchema: {
154
128
  type: "object",
155
- properties: {},
129
+ properties: {
130
+ ids: {
131
+ type: "array",
132
+ items: {
133
+ type: "integer"
134
+ },
135
+ description: "Feature IDs."
136
+ },
137
+ refs: {
138
+ type: "array",
139
+ items: {
140
+ type: "string"
141
+ },
142
+ description: "Feature reference identifiers."
143
+ }
144
+ },
156
145
  additionalProperties: false
157
146
  }
158
147
  },
159
148
  {
160
149
  name: "lighthouse.feature.workitems",
161
- description: "Get work items for a feature. Requires id.",
162
- inputSchema: {
163
- type: "object",
164
- properties: {},
165
- additionalProperties: false
166
- }
150
+ description: "Get work items linked to a feature by ID.",
151
+ inputSchema: idInputSchema
167
152
  },
168
153
  {
169
154
  name: "lighthouse.delivery.list",
170
- description: "List deliveries for a portfolio. Requires id (portfolio id).",
171
- inputSchema: {
172
- type: "object",
173
- properties: {},
174
- additionalProperties: false
175
- }
155
+ description: "List deliveries for a portfolio by portfolio ID.",
156
+ inputSchema: idInputSchema
176
157
  },
177
158
  {
178
159
  name: "lighthouse.forecast.manual",
179
- description: "Run a manual forecast for a team. Requires id (team id). Optional remainingItems and targetDate.",
160
+ description: "Run a manual forecast for a team by ID with optional remaining items and target date.",
180
161
  inputSchema: {
181
162
  type: "object",
182
- properties: {},
163
+ properties: {
164
+ ...idInputSchema.properties,
165
+ remainingItems: {
166
+ type: "integer",
167
+ description: "Remaining items to forecast."
168
+ },
169
+ targetDate: {
170
+ type: "string",
171
+ description: "Optional target date in ISO format (YYYY-MM-DD)."
172
+ }
173
+ },
174
+ required: ["id"],
183
175
  additionalProperties: false
184
176
  }
185
177
  },
186
178
  {
187
179
  name: "lighthouse.forecast.backtest",
188
- description: "Run a backtest forecast for a team. Requires id, startDate, endDate, historicalStartDate, historicalEndDate.",
180
+ description: "Run a forecast backtest for a team by ID using forecast and historical date ranges.",
189
181
  inputSchema: {
190
182
  type: "object",
191
- properties: {},
183
+ properties: {
184
+ ...idInputSchema.properties,
185
+ startDate: {
186
+ type: "string",
187
+ description: "Forecast start date in ISO format (YYYY-MM-DD)."
188
+ },
189
+ endDate: {
190
+ type: "string",
191
+ description: "Forecast end date in ISO format (YYYY-MM-DD)."
192
+ },
193
+ historicalStartDate: {
194
+ type: "string",
195
+ description: "Historical sample start date in ISO format (YYYY-MM-DD)."
196
+ },
197
+ historicalEndDate: {
198
+ type: "string",
199
+ description: "Historical sample end date in ISO format (YYYY-MM-DD)."
200
+ }
201
+ },
202
+ required: [
203
+ "id",
204
+ "startDate",
205
+ "endDate",
206
+ "historicalStartDate",
207
+ "historicalEndDate"
208
+ ],
192
209
  additionalProperties: false
193
210
  }
194
211
  }
@@ -235,6 +252,53 @@ var getDateRange = (argumentsPayload) => {
235
252
  }
236
253
  return void 0;
237
254
  };
255
+ var isoDateStringSchema = z.string().regex(/^\d{4}-\d{2}-\d{2}$/u, "Expected ISO date in YYYY-MM-DD format.");
256
+ var toolInputSchemas = {
257
+ "lighthouse.health.check": z.object({}),
258
+ "lighthouse.version.get": z.object({}),
259
+ "lighthouse.worktracking.list": z.object({}),
260
+ "lighthouse.worktracking.get": z.object({ id: z.number().int() }),
261
+ "lighthouse.team.list": z.object({}),
262
+ "lighthouse.team.get": z.object({ id: z.number().int() }),
263
+ "lighthouse.team.refresh": z.object({ id: z.number().int() }),
264
+ "lighthouse.portfolio.list": z.object({}),
265
+ "lighthouse.portfolio.get": z.object({ id: z.number().int() }),
266
+ "lighthouse.portfolio.refresh": z.object({ id: z.number().int() }),
267
+ "lighthouse.team.metrics.throughput": z.object({
268
+ id: z.number().int(),
269
+ startDate: isoDateStringSchema.optional(),
270
+ endDate: isoDateStringSchema.optional()
271
+ }),
272
+ "lighthouse.team.metrics.cycleTimePercentiles": z.object({
273
+ id: z.number().int(),
274
+ startDate: isoDateStringSchema.optional(),
275
+ endDate: isoDateStringSchema.optional()
276
+ }),
277
+ "lighthouse.portfolio.metrics.throughput": z.object({
278
+ id: z.number().int(),
279
+ startDate: isoDateStringSchema.optional(),
280
+ endDate: isoDateStringSchema.optional()
281
+ }),
282
+ "lighthouse.feature.get": z.object({
283
+ ids: z.array(z.number().int()).optional(),
284
+ refs: z.array(z.string()).optional()
285
+ }),
286
+ "lighthouse.feature.workitems": z.object({ id: z.number().int() }),
287
+ "lighthouse.delivery.list": z.object({ id: z.number().int() }),
288
+ "lighthouse.forecast.manual": z.object({
289
+ id: z.number().int(),
290
+ remainingItems: z.number().int().optional(),
291
+ targetDate: isoDateStringSchema.optional()
292
+ }),
293
+ "lighthouse.forecast.backtest": z.object({
294
+ id: z.number().int(),
295
+ startDate: isoDateStringSchema,
296
+ endDate: isoDateStringSchema,
297
+ historicalStartDate: isoDateStringSchema,
298
+ historicalEndDate: isoDateStringSchema
299
+ })
300
+ };
301
+ var isReadOnlyTool = (toolName) => !toolName.endsWith(".refresh");
238
302
  var createMcpCoreRuntime = (dependencies) => ({
239
303
  listTools: () => toolDefinitions,
240
304
  callTool: async (name, argumentsPayload) => {
@@ -244,8 +308,9 @@ var createMcpCoreRuntime = (dependencies) => ({
244
308
  if (health.category === "success") {
245
309
  return getSuccessToolResult("connectivity: success");
246
310
  }
311
+ const healthReasonSuffix = health.reason === void 0 ? "" : ` (${health.reason})`;
247
312
  return getErrorToolResult(
248
- `connectivity: ${health.category}${health.reason !== void 0 ? ` (${health.reason})` : ""}`
313
+ `connectivity: ${health.category}${healthReasonSuffix}`
249
314
  );
250
315
  }
251
316
  if (name === "lighthouse.version.get") {
@@ -525,8 +590,32 @@ var createMcpCoreRuntime = (dependencies) => ({
525
590
  return getErrorToolResult(`Unknown tool: ${name}`);
526
591
  }
527
592
  });
528
- // Annotate the CommonJS export names for ESM import in node:
529
- 0 && (module.exports = {
593
+ var registerMcpTools = (server, dependencies) => {
594
+ const runtime = createMcpCoreRuntime(dependencies);
595
+ for (const tool of toolDefinitions) {
596
+ server.registerTool(
597
+ tool.name,
598
+ {
599
+ description: tool.description,
600
+ inputSchema: toolInputSchemas[tool.name],
601
+ annotations: {
602
+ readOnlyHint: isReadOnlyTool(tool.name),
603
+ idempotentHint: isReadOnlyTool(tool.name),
604
+ openWorldHint: false
605
+ }
606
+ },
607
+ async (argumentsPayload) => {
608
+ const result = await runtime.callTool(tool.name, argumentsPayload);
609
+ return {
610
+ ...result,
611
+ content: [...result.content]
612
+ };
613
+ }
614
+ );
615
+ }
616
+ };
617
+ export {
530
618
  createMcpCoreRuntime,
531
- getMcpCorePackageContract
532
- });
619
+ getMcpCorePackageContract,
620
+ registerMcpTools
621
+ };
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@letpeoplework/lighthouse-mcp-core",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "Shared MCP semantics for Lighthouse",
5
5
  "repository": "https://github.com/LetPeopleWork/lighthouse-clients",
6
+ "type": "module",
6
7
  "main": "dist/index.cjs",
7
8
  "module": "dist/index.js",
8
9
  "types": "dist/index.d.ts",
@@ -22,7 +23,9 @@
22
23
  "registry": "https://registry.npmjs.org/"
23
24
  },
24
25
  "dependencies": {
25
- "@letpeoplework/lighthouse-client": "0.6.0"
26
+ "@modelcontextprotocol/sdk": "^1.26.0",
27
+ "zod": "^3.24.1",
28
+ "@letpeoplework/lighthouse-client": "0.8.0"
26
29
  },
27
30
  "scripts": {
28
31
  "build": "tsup src/index.ts --format esm,cjs --dts --clean",