@hasna/microservices 0.0.9 → 0.0.11
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/bin/index.js +236 -36
- package/bin/mcp.js +153 -4
- package/dist/index.js +120 -3
- package/microservices/microservice-analytics/package.json +27 -0
- package/microservices/microservice-analytics/src/cli/index.ts +373 -0
- package/microservices/microservice-analytics/src/db/analytics.ts +564 -0
- package/microservices/microservice-analytics/src/db/database.ts +93 -0
- package/microservices/microservice-analytics/src/db/migrations.ts +50 -0
- package/microservices/microservice-analytics/src/index.ts +37 -0
- package/microservices/microservice-analytics/src/mcp/index.ts +334 -0
- package/microservices/microservice-assets/package.json +27 -0
- package/microservices/microservice-assets/src/cli/index.ts +375 -0
- package/microservices/microservice-assets/src/db/assets.ts +370 -0
- package/microservices/microservice-assets/src/db/database.ts +93 -0
- package/microservices/microservice-assets/src/db/migrations.ts +51 -0
- package/microservices/microservice-assets/src/index.ts +32 -0
- package/microservices/microservice-assets/src/mcp/index.ts +346 -0
- package/microservices/microservice-compliance/package.json +27 -0
- package/microservices/microservice-compliance/src/cli/index.ts +467 -0
- package/microservices/microservice-compliance/src/db/compliance.ts +633 -0
- package/microservices/microservice-compliance/src/db/database.ts +93 -0
- package/microservices/microservice-compliance/src/db/migrations.ts +63 -0
- package/microservices/microservice-compliance/src/index.ts +46 -0
- package/microservices/microservice-compliance/src/mcp/index.ts +438 -0
- package/microservices/microservice-habits/package.json +27 -0
- package/microservices/microservice-habits/src/cli/index.ts +315 -0
- package/microservices/microservice-habits/src/db/database.ts +93 -0
- package/microservices/microservice-habits/src/db/habits.ts +451 -0
- package/microservices/microservice-habits/src/db/migrations.ts +46 -0
- package/microservices/microservice-habits/src/index.ts +31 -0
- package/microservices/microservice-habits/src/mcp/index.ts +313 -0
- package/microservices/microservice-health/package.json +27 -0
- package/microservices/microservice-health/src/cli/index.ts +484 -0
- package/microservices/microservice-health/src/db/database.ts +93 -0
- package/microservices/microservice-health/src/db/health.ts +708 -0
- package/microservices/microservice-health/src/db/migrations.ts +70 -0
- package/microservices/microservice-health/src/index.ts +63 -0
- package/microservices/microservice-health/src/mcp/index.ts +437 -0
- package/microservices/microservice-leads/package.json +27 -0
- package/microservices/microservice-leads/src/cli/index.ts +596 -0
- package/microservices/microservice-leads/src/db/database.ts +93 -0
- package/microservices/microservice-leads/src/db/leads.ts +520 -0
- package/microservices/microservice-leads/src/db/lists.ts +151 -0
- package/microservices/microservice-leads/src/db/migrations.ts +93 -0
- package/microservices/microservice-leads/src/index.ts +65 -0
- package/microservices/microservice-leads/src/lib/enrichment.ts +202 -0
- package/microservices/microservice-leads/src/lib/scoring.ts +134 -0
- package/microservices/microservice-leads/src/mcp/index.ts +533 -0
- package/microservices/microservice-notifications/package.json +27 -0
- package/microservices/microservice-notifications/src/cli/index.ts +349 -0
- package/microservices/microservice-notifications/src/db/database.ts +93 -0
- package/microservices/microservice-notifications/src/db/migrations.ts +62 -0
- package/microservices/microservice-notifications/src/db/notifications.ts +509 -0
- package/microservices/microservice-notifications/src/index.ts +41 -0
- package/microservices/microservice-notifications/src/mcp/index.ts +422 -0
- package/microservices/microservice-products/package.json +27 -0
- package/microservices/microservice-products/src/cli/index.ts +416 -0
- package/microservices/microservice-products/src/db/categories.ts +154 -0
- package/microservices/microservice-products/src/db/database.ts +93 -0
- package/microservices/microservice-products/src/db/migrations.ts +58 -0
- package/microservices/microservice-products/src/db/pricing-tiers.ts +66 -0
- package/microservices/microservice-products/src/db/products.ts +452 -0
- package/microservices/microservice-products/src/index.ts +53 -0
- package/microservices/microservice-products/src/mcp/index.ts +453 -0
- package/microservices/microservice-projects/package.json +27 -0
- package/microservices/microservice-projects/src/cli/index.ts +480 -0
- package/microservices/microservice-projects/src/db/database.ts +93 -0
- package/microservices/microservice-projects/src/db/migrations.ts +65 -0
- package/microservices/microservice-projects/src/db/projects.ts +715 -0
- package/microservices/microservice-projects/src/index.ts +57 -0
- package/microservices/microservice-projects/src/mcp/index.ts +501 -0
- package/microservices/microservice-proposals/package.json +27 -0
- package/microservices/microservice-proposals/src/cli/index.ts +400 -0
- package/microservices/microservice-proposals/src/db/database.ts +93 -0
- package/microservices/microservice-proposals/src/db/migrations.ts +52 -0
- package/microservices/microservice-proposals/src/db/proposals.ts +532 -0
- package/microservices/microservice-proposals/src/index.ts +37 -0
- package/microservices/microservice-proposals/src/mcp/index.ts +375 -0
- package/microservices/microservice-reading/package.json +27 -0
- package/microservices/microservice-reading/src/cli/index.ts +464 -0
- package/microservices/microservice-reading/src/db/database.ts +93 -0
- package/microservices/microservice-reading/src/db/migrations.ts +59 -0
- package/microservices/microservice-reading/src/db/reading.ts +524 -0
- package/microservices/microservice-reading/src/index.ts +51 -0
- package/microservices/microservice-reading/src/mcp/index.ts +368 -0
- package/microservices/microservice-travel/package.json +27 -0
- package/microservices/microservice-travel/src/cli/index.ts +505 -0
- package/microservices/microservice-travel/src/db/database.ts +93 -0
- package/microservices/microservice-travel/src/db/migrations.ts +77 -0
- package/microservices/microservice-travel/src/db/travel.ts +802 -0
- package/microservices/microservice-travel/src/index.ts +60 -0
- package/microservices/microservice-travel/src/mcp/index.ts +495 -0
- package/microservices/microservice-wiki/package.json +27 -0
- package/microservices/microservice-wiki/src/cli/index.ts +345 -0
- package/microservices/microservice-wiki/src/db/database.ts +93 -0
- package/microservices/microservice-wiki/src/db/migrations.ts +55 -0
- package/microservices/microservice-wiki/src/db/wiki.ts +395 -0
- package/microservices/microservice-wiki/src/index.ts +32 -0
- package/microservices/microservice-wiki/src/mcp/index.ts +344 -0
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* microservice-projects — Project management microservice
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
createProject,
|
|
7
|
+
getProject,
|
|
8
|
+
listProjects,
|
|
9
|
+
updateProject,
|
|
10
|
+
deleteProject,
|
|
11
|
+
searchProjects,
|
|
12
|
+
type Project,
|
|
13
|
+
type CreateProjectInput,
|
|
14
|
+
type UpdateProjectInput,
|
|
15
|
+
type ListProjectsOptions,
|
|
16
|
+
} from "./db/projects.js";
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
createMilestone,
|
|
20
|
+
getMilestone,
|
|
21
|
+
listMilestones,
|
|
22
|
+
updateMilestone,
|
|
23
|
+
completeMilestone,
|
|
24
|
+
deleteMilestone,
|
|
25
|
+
type Milestone,
|
|
26
|
+
type CreateMilestoneInput,
|
|
27
|
+
type UpdateMilestoneInput,
|
|
28
|
+
type ListMilestonesOptions,
|
|
29
|
+
} from "./db/projects.js";
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
createDeliverable,
|
|
33
|
+
getDeliverable,
|
|
34
|
+
listDeliverables,
|
|
35
|
+
updateDeliverable,
|
|
36
|
+
completeDeliverable,
|
|
37
|
+
deleteDeliverable,
|
|
38
|
+
type Deliverable,
|
|
39
|
+
type CreateDeliverableInput,
|
|
40
|
+
type UpdateDeliverableInput,
|
|
41
|
+
type ListDeliverablesOptions,
|
|
42
|
+
} from "./db/projects.js";
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
getProjectTimeline,
|
|
46
|
+
getBudgetVsActual,
|
|
47
|
+
getOverdueProjects,
|
|
48
|
+
getOverdueMilestones,
|
|
49
|
+
getProjectStats,
|
|
50
|
+
getMilestoneProgress,
|
|
51
|
+
type TimelineEntry,
|
|
52
|
+
type BudgetReport,
|
|
53
|
+
type ProjectStats,
|
|
54
|
+
type MilestoneProgress,
|
|
55
|
+
} from "./db/projects.js";
|
|
56
|
+
|
|
57
|
+
export { getDatabase, closeDatabase } from "./db/database.js";
|
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import {
|
|
7
|
+
createProject,
|
|
8
|
+
getProject,
|
|
9
|
+
listProjects,
|
|
10
|
+
updateProject,
|
|
11
|
+
deleteProject,
|
|
12
|
+
searchProjects,
|
|
13
|
+
getProjectTimeline,
|
|
14
|
+
getBudgetVsActual,
|
|
15
|
+
getOverdueProjects,
|
|
16
|
+
getOverdueMilestones,
|
|
17
|
+
getProjectStats,
|
|
18
|
+
getMilestoneProgress,
|
|
19
|
+
} from "../db/projects.js";
|
|
20
|
+
import {
|
|
21
|
+
createMilestone,
|
|
22
|
+
getMilestone,
|
|
23
|
+
listMilestones,
|
|
24
|
+
updateMilestone,
|
|
25
|
+
completeMilestone,
|
|
26
|
+
deleteMilestone,
|
|
27
|
+
} from "../db/projects.js";
|
|
28
|
+
import {
|
|
29
|
+
createDeliverable,
|
|
30
|
+
getDeliverable,
|
|
31
|
+
listDeliverables,
|
|
32
|
+
updateDeliverable,
|
|
33
|
+
completeDeliverable,
|
|
34
|
+
deleteDeliverable,
|
|
35
|
+
} from "../db/projects.js";
|
|
36
|
+
|
|
37
|
+
const server = new McpServer({
|
|
38
|
+
name: "microservice-projects",
|
|
39
|
+
version: "0.0.1",
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// --- Projects ---
|
|
43
|
+
|
|
44
|
+
server.registerTool(
|
|
45
|
+
"create_project",
|
|
46
|
+
{
|
|
47
|
+
title: "Create Project",
|
|
48
|
+
description: "Create a new project.",
|
|
49
|
+
inputSchema: {
|
|
50
|
+
name: z.string(),
|
|
51
|
+
description: z.string().optional(),
|
|
52
|
+
client: z.string().optional(),
|
|
53
|
+
status: z.enum(["planning", "active", "on_hold", "completed", "cancelled"]).optional(),
|
|
54
|
+
budget: z.number().optional(),
|
|
55
|
+
currency: z.string().optional(),
|
|
56
|
+
start_date: z.string().optional(),
|
|
57
|
+
end_date: z.string().optional(),
|
|
58
|
+
owner: z.string().optional(),
|
|
59
|
+
tags: z.array(z.string()).optional(),
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
async (params) => {
|
|
63
|
+
const project = createProject(params);
|
|
64
|
+
return { content: [{ type: "text", text: JSON.stringify(project, null, 2) }] };
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
server.registerTool(
|
|
69
|
+
"get_project",
|
|
70
|
+
{
|
|
71
|
+
title: "Get Project",
|
|
72
|
+
description: "Get a project by ID.",
|
|
73
|
+
inputSchema: { id: z.string() },
|
|
74
|
+
},
|
|
75
|
+
async ({ id }) => {
|
|
76
|
+
const project = getProject(id);
|
|
77
|
+
if (!project) {
|
|
78
|
+
return { content: [{ type: "text", text: `Project '${id}' not found.` }], isError: true };
|
|
79
|
+
}
|
|
80
|
+
return { content: [{ type: "text", text: JSON.stringify(project, null, 2) }] };
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
server.registerTool(
|
|
85
|
+
"list_projects",
|
|
86
|
+
{
|
|
87
|
+
title: "List Projects",
|
|
88
|
+
description: "List projects with optional filters.",
|
|
89
|
+
inputSchema: {
|
|
90
|
+
status: z.string().optional(),
|
|
91
|
+
client: z.string().optional(),
|
|
92
|
+
owner: z.string().optional(),
|
|
93
|
+
search: z.string().optional(),
|
|
94
|
+
limit: z.number().optional(),
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
async (params) => {
|
|
98
|
+
const projects = listProjects(params);
|
|
99
|
+
return {
|
|
100
|
+
content: [
|
|
101
|
+
{
|
|
102
|
+
type: "text",
|
|
103
|
+
text: JSON.stringify({ projects, count: projects.length }, null, 2),
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
server.registerTool(
|
|
111
|
+
"update_project",
|
|
112
|
+
{
|
|
113
|
+
title: "Update Project",
|
|
114
|
+
description: "Update an existing project.",
|
|
115
|
+
inputSchema: {
|
|
116
|
+
id: z.string(),
|
|
117
|
+
name: z.string().optional(),
|
|
118
|
+
description: z.string().optional(),
|
|
119
|
+
client: z.string().optional(),
|
|
120
|
+
status: z.enum(["planning", "active", "on_hold", "completed", "cancelled"]).optional(),
|
|
121
|
+
budget: z.number().optional(),
|
|
122
|
+
spent: z.number().optional(),
|
|
123
|
+
currency: z.string().optional(),
|
|
124
|
+
start_date: z.string().optional(),
|
|
125
|
+
end_date: z.string().optional(),
|
|
126
|
+
owner: z.string().optional(),
|
|
127
|
+
tags: z.array(z.string()).optional(),
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
async ({ id, ...input }) => {
|
|
131
|
+
const project = updateProject(id, input);
|
|
132
|
+
if (!project) {
|
|
133
|
+
return { content: [{ type: "text", text: `Project '${id}' not found.` }], isError: true };
|
|
134
|
+
}
|
|
135
|
+
return { content: [{ type: "text", text: JSON.stringify(project, null, 2) }] };
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
server.registerTool(
|
|
140
|
+
"delete_project",
|
|
141
|
+
{
|
|
142
|
+
title: "Delete Project",
|
|
143
|
+
description: "Delete a project by ID.",
|
|
144
|
+
inputSchema: { id: z.string() },
|
|
145
|
+
},
|
|
146
|
+
async ({ id }) => {
|
|
147
|
+
const deleted = deleteProject(id);
|
|
148
|
+
return { content: [{ type: "text", text: JSON.stringify({ id, deleted }) }] };
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
server.registerTool(
|
|
153
|
+
"search_projects",
|
|
154
|
+
{
|
|
155
|
+
title: "Search Projects",
|
|
156
|
+
description: "Search projects by name, description, client, or owner.",
|
|
157
|
+
inputSchema: { query: z.string() },
|
|
158
|
+
},
|
|
159
|
+
async ({ query }) => {
|
|
160
|
+
const results = searchProjects(query);
|
|
161
|
+
return {
|
|
162
|
+
content: [
|
|
163
|
+
{ type: "text", text: JSON.stringify({ results, count: results.length }, null, 2) },
|
|
164
|
+
],
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
// --- Milestones ---
|
|
170
|
+
|
|
171
|
+
server.registerTool(
|
|
172
|
+
"create_milestone",
|
|
173
|
+
{
|
|
174
|
+
title: "Create Milestone",
|
|
175
|
+
description: "Create a new milestone for a project.",
|
|
176
|
+
inputSchema: {
|
|
177
|
+
project_id: z.string(),
|
|
178
|
+
name: z.string(),
|
|
179
|
+
description: z.string().optional(),
|
|
180
|
+
due_date: z.string().optional(),
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
async (params) => {
|
|
184
|
+
const milestone = createMilestone(params);
|
|
185
|
+
return { content: [{ type: "text", text: JSON.stringify(milestone, null, 2) }] };
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
server.registerTool(
|
|
190
|
+
"get_milestone",
|
|
191
|
+
{
|
|
192
|
+
title: "Get Milestone",
|
|
193
|
+
description: "Get a milestone by ID.",
|
|
194
|
+
inputSchema: { id: z.string() },
|
|
195
|
+
},
|
|
196
|
+
async ({ id }) => {
|
|
197
|
+
const milestone = getMilestone(id);
|
|
198
|
+
if (!milestone) {
|
|
199
|
+
return { content: [{ type: "text", text: `Milestone '${id}' not found.` }], isError: true };
|
|
200
|
+
}
|
|
201
|
+
return { content: [{ type: "text", text: JSON.stringify(milestone, null, 2) }] };
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
server.registerTool(
|
|
206
|
+
"list_milestones",
|
|
207
|
+
{
|
|
208
|
+
title: "List Milestones",
|
|
209
|
+
description: "List milestones with optional filters.",
|
|
210
|
+
inputSchema: {
|
|
211
|
+
project_id: z.string().optional(),
|
|
212
|
+
status: z.string().optional(),
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
async (params) => {
|
|
216
|
+
const milestones = listMilestones(params);
|
|
217
|
+
return {
|
|
218
|
+
content: [
|
|
219
|
+
{
|
|
220
|
+
type: "text",
|
|
221
|
+
text: JSON.stringify({ milestones, count: milestones.length }, null, 2),
|
|
222
|
+
},
|
|
223
|
+
],
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
|
|
228
|
+
server.registerTool(
|
|
229
|
+
"update_milestone",
|
|
230
|
+
{
|
|
231
|
+
title: "Update Milestone",
|
|
232
|
+
description: "Update an existing milestone.",
|
|
233
|
+
inputSchema: {
|
|
234
|
+
id: z.string(),
|
|
235
|
+
name: z.string().optional(),
|
|
236
|
+
description: z.string().optional(),
|
|
237
|
+
due_date: z.string().optional(),
|
|
238
|
+
status: z.enum(["pending", "in_progress", "completed", "missed"]).optional(),
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
async ({ id, ...input }) => {
|
|
242
|
+
const milestone = updateMilestone(id, input);
|
|
243
|
+
if (!milestone) {
|
|
244
|
+
return { content: [{ type: "text", text: `Milestone '${id}' not found.` }], isError: true };
|
|
245
|
+
}
|
|
246
|
+
return { content: [{ type: "text", text: JSON.stringify(milestone, null, 2) }] };
|
|
247
|
+
}
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
server.registerTool(
|
|
251
|
+
"complete_milestone",
|
|
252
|
+
{
|
|
253
|
+
title: "Complete Milestone",
|
|
254
|
+
description: "Mark a milestone as completed.",
|
|
255
|
+
inputSchema: { id: z.string() },
|
|
256
|
+
},
|
|
257
|
+
async ({ id }) => {
|
|
258
|
+
const milestone = completeMilestone(id);
|
|
259
|
+
if (!milestone) {
|
|
260
|
+
return { content: [{ type: "text", text: `Milestone '${id}' not found.` }], isError: true };
|
|
261
|
+
}
|
|
262
|
+
return { content: [{ type: "text", text: JSON.stringify(milestone, null, 2) }] };
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
server.registerTool(
|
|
267
|
+
"delete_milestone",
|
|
268
|
+
{
|
|
269
|
+
title: "Delete Milestone",
|
|
270
|
+
description: "Delete a milestone by ID.",
|
|
271
|
+
inputSchema: { id: z.string() },
|
|
272
|
+
},
|
|
273
|
+
async ({ id }) => {
|
|
274
|
+
const deleted = deleteMilestone(id);
|
|
275
|
+
return { content: [{ type: "text", text: JSON.stringify({ id, deleted }) }] };
|
|
276
|
+
}
|
|
277
|
+
);
|
|
278
|
+
|
|
279
|
+
// --- Deliverables ---
|
|
280
|
+
|
|
281
|
+
server.registerTool(
|
|
282
|
+
"create_deliverable",
|
|
283
|
+
{
|
|
284
|
+
title: "Create Deliverable",
|
|
285
|
+
description: "Create a new deliverable for a milestone.",
|
|
286
|
+
inputSchema: {
|
|
287
|
+
milestone_id: z.string(),
|
|
288
|
+
name: z.string(),
|
|
289
|
+
description: z.string().optional(),
|
|
290
|
+
assignee: z.string().optional(),
|
|
291
|
+
due_date: z.string().optional(),
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
async (params) => {
|
|
295
|
+
const deliverable = createDeliverable(params);
|
|
296
|
+
return { content: [{ type: "text", text: JSON.stringify(deliverable, null, 2) }] };
|
|
297
|
+
}
|
|
298
|
+
);
|
|
299
|
+
|
|
300
|
+
server.registerTool(
|
|
301
|
+
"get_deliverable",
|
|
302
|
+
{
|
|
303
|
+
title: "Get Deliverable",
|
|
304
|
+
description: "Get a deliverable by ID.",
|
|
305
|
+
inputSchema: { id: z.string() },
|
|
306
|
+
},
|
|
307
|
+
async ({ id }) => {
|
|
308
|
+
const deliverable = getDeliverable(id);
|
|
309
|
+
if (!deliverable) {
|
|
310
|
+
return { content: [{ type: "text", text: `Deliverable '${id}' not found.` }], isError: true };
|
|
311
|
+
}
|
|
312
|
+
return { content: [{ type: "text", text: JSON.stringify(deliverable, null, 2) }] };
|
|
313
|
+
}
|
|
314
|
+
);
|
|
315
|
+
|
|
316
|
+
server.registerTool(
|
|
317
|
+
"list_deliverables",
|
|
318
|
+
{
|
|
319
|
+
title: "List Deliverables",
|
|
320
|
+
description: "List deliverables with optional filters.",
|
|
321
|
+
inputSchema: {
|
|
322
|
+
milestone_id: z.string().optional(),
|
|
323
|
+
status: z.string().optional(),
|
|
324
|
+
assignee: z.string().optional(),
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
async (params) => {
|
|
328
|
+
const deliverables = listDeliverables(params);
|
|
329
|
+
return {
|
|
330
|
+
content: [
|
|
331
|
+
{
|
|
332
|
+
type: "text",
|
|
333
|
+
text: JSON.stringify({ deliverables, count: deliverables.length }, null, 2),
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
);
|
|
339
|
+
|
|
340
|
+
server.registerTool(
|
|
341
|
+
"update_deliverable",
|
|
342
|
+
{
|
|
343
|
+
title: "Update Deliverable",
|
|
344
|
+
description: "Update an existing deliverable.",
|
|
345
|
+
inputSchema: {
|
|
346
|
+
id: z.string(),
|
|
347
|
+
name: z.string().optional(),
|
|
348
|
+
description: z.string().optional(),
|
|
349
|
+
status: z.enum(["pending", "in_progress", "review", "completed"]).optional(),
|
|
350
|
+
assignee: z.string().optional(),
|
|
351
|
+
due_date: z.string().optional(),
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
async ({ id, ...input }) => {
|
|
355
|
+
const deliverable = updateDeliverable(id, input);
|
|
356
|
+
if (!deliverable) {
|
|
357
|
+
return { content: [{ type: "text", text: `Deliverable '${id}' not found.` }], isError: true };
|
|
358
|
+
}
|
|
359
|
+
return { content: [{ type: "text", text: JSON.stringify(deliverable, null, 2) }] };
|
|
360
|
+
}
|
|
361
|
+
);
|
|
362
|
+
|
|
363
|
+
server.registerTool(
|
|
364
|
+
"complete_deliverable",
|
|
365
|
+
{
|
|
366
|
+
title: "Complete Deliverable",
|
|
367
|
+
description: "Mark a deliverable as completed.",
|
|
368
|
+
inputSchema: { id: z.string() },
|
|
369
|
+
},
|
|
370
|
+
async ({ id }) => {
|
|
371
|
+
const deliverable = completeDeliverable(id);
|
|
372
|
+
if (!deliverable) {
|
|
373
|
+
return { content: [{ type: "text", text: `Deliverable '${id}' not found.` }], isError: true };
|
|
374
|
+
}
|
|
375
|
+
return { content: [{ type: "text", text: JSON.stringify(deliverable, null, 2) }] };
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
|
|
379
|
+
server.registerTool(
|
|
380
|
+
"delete_deliverable",
|
|
381
|
+
{
|
|
382
|
+
title: "Delete Deliverable",
|
|
383
|
+
description: "Delete a deliverable by ID.",
|
|
384
|
+
inputSchema: { id: z.string() },
|
|
385
|
+
},
|
|
386
|
+
async ({ id }) => {
|
|
387
|
+
const deleted = deleteDeliverable(id);
|
|
388
|
+
return { content: [{ type: "text", text: JSON.stringify({ id, deleted }) }] };
|
|
389
|
+
}
|
|
390
|
+
);
|
|
391
|
+
|
|
392
|
+
// --- Advanced Queries ---
|
|
393
|
+
|
|
394
|
+
server.registerTool(
|
|
395
|
+
"project_timeline",
|
|
396
|
+
{
|
|
397
|
+
title: "Project Timeline",
|
|
398
|
+
description: "Get a project's timeline showing milestones and deliverables ordered by date.",
|
|
399
|
+
inputSchema: { project_id: z.string() },
|
|
400
|
+
},
|
|
401
|
+
async ({ project_id }) => {
|
|
402
|
+
const project = getProject(project_id);
|
|
403
|
+
if (!project) {
|
|
404
|
+
return { content: [{ type: "text", text: `Project '${project_id}' not found.` }], isError: true };
|
|
405
|
+
}
|
|
406
|
+
const timeline = getProjectTimeline(project_id);
|
|
407
|
+
return {
|
|
408
|
+
content: [
|
|
409
|
+
{ type: "text", text: JSON.stringify({ project: project.name, timeline }, null, 2) },
|
|
410
|
+
],
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
);
|
|
414
|
+
|
|
415
|
+
server.registerTool(
|
|
416
|
+
"project_budget",
|
|
417
|
+
{
|
|
418
|
+
title: "Project Budget",
|
|
419
|
+
description: "Get budget vs actual spending for a project.",
|
|
420
|
+
inputSchema: { project_id: z.string() },
|
|
421
|
+
},
|
|
422
|
+
async ({ project_id }) => {
|
|
423
|
+
const report = getBudgetVsActual(project_id);
|
|
424
|
+
if (!report) {
|
|
425
|
+
return { content: [{ type: "text", text: `Project '${project_id}' not found.` }], isError: true };
|
|
426
|
+
}
|
|
427
|
+
return { content: [{ type: "text", text: JSON.stringify(report, null, 2) }] };
|
|
428
|
+
}
|
|
429
|
+
);
|
|
430
|
+
|
|
431
|
+
server.registerTool(
|
|
432
|
+
"overdue_projects",
|
|
433
|
+
{
|
|
434
|
+
title: "Overdue Projects",
|
|
435
|
+
description: "Get all overdue projects (past end_date, not completed/cancelled).",
|
|
436
|
+
inputSchema: {},
|
|
437
|
+
},
|
|
438
|
+
async () => {
|
|
439
|
+
const projects = getOverdueProjects();
|
|
440
|
+
return {
|
|
441
|
+
content: [
|
|
442
|
+
{ type: "text", text: JSON.stringify({ projects, count: projects.length }, null, 2) },
|
|
443
|
+
],
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
);
|
|
447
|
+
|
|
448
|
+
server.registerTool(
|
|
449
|
+
"overdue_milestones",
|
|
450
|
+
{
|
|
451
|
+
title: "Overdue Milestones",
|
|
452
|
+
description: "Get all overdue milestones (past due_date, not completed/missed).",
|
|
453
|
+
inputSchema: {},
|
|
454
|
+
},
|
|
455
|
+
async () => {
|
|
456
|
+
const milestones = getOverdueMilestones();
|
|
457
|
+
return {
|
|
458
|
+
content: [
|
|
459
|
+
{ type: "text", text: JSON.stringify({ milestones, count: milestones.length }, null, 2) },
|
|
460
|
+
],
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
);
|
|
464
|
+
|
|
465
|
+
server.registerTool(
|
|
466
|
+
"project_stats",
|
|
467
|
+
{
|
|
468
|
+
title: "Project Stats",
|
|
469
|
+
description: "Get project statistics: counts by status, total budget and spent.",
|
|
470
|
+
inputSchema: {},
|
|
471
|
+
},
|
|
472
|
+
async () => {
|
|
473
|
+
const stats = getProjectStats();
|
|
474
|
+
return { content: [{ type: "text", text: JSON.stringify(stats, null, 2) }] };
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
|
|
478
|
+
server.registerTool(
|
|
479
|
+
"milestone_progress",
|
|
480
|
+
{
|
|
481
|
+
title: "Milestone Progress",
|
|
482
|
+
description: "Get milestone completion progress for a project.",
|
|
483
|
+
inputSchema: { project_id: z.string() },
|
|
484
|
+
},
|
|
485
|
+
async ({ project_id }) => {
|
|
486
|
+
const progress = getMilestoneProgress(project_id);
|
|
487
|
+
return { content: [{ type: "text", text: JSON.stringify(progress, null, 2) }] };
|
|
488
|
+
}
|
|
489
|
+
);
|
|
490
|
+
|
|
491
|
+
// --- Start ---
|
|
492
|
+
async function main() {
|
|
493
|
+
const transport = new StdioServerTransport();
|
|
494
|
+
await server.connect(transport);
|
|
495
|
+
console.error("microservice-projects MCP server running on stdio");
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
main().catch((error) => {
|
|
499
|
+
console.error("Fatal error:", error);
|
|
500
|
+
process.exit(1);
|
|
501
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hasna/microservice-proposals",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Proposal management microservice with SQLite — create, send, track, and convert proposals",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"microservice-proposals": "./src/cli/index.ts",
|
|
8
|
+
"microservice-proposals-mcp": "./src/mcp/index.ts"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./src/index.ts"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "bun run ./src/cli/index.ts",
|
|
15
|
+
"test": "bun test"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
19
|
+
"commander": "^12.1.0",
|
|
20
|
+
"zod": "^3.24.0"
|
|
21
|
+
},
|
|
22
|
+
"license": "Apache-2.0",
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"registry": "https://registry.npmjs.org",
|
|
25
|
+
"access": "public"
|
|
26
|
+
}
|
|
27
|
+
}
|