@artyfacts/mcp-server 1.0.3 → 1.0.5
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/dist/chunk-MO7NJ56L.js +579 -0
- package/dist/chunk-NUVCJMET.js +600 -0
- package/dist/index.cjs +51 -7
- package/dist/index.js +1 -1
- package/dist/server.cjs +51 -7
- package/dist/server.js +1 -1
- package/package.json +1 -1
- package/src/server.ts +54 -9
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
// src/server.ts
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import {
|
|
5
|
+
CallToolRequestSchema,
|
|
6
|
+
ListToolsRequestSchema
|
|
7
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
var ARTYFACTS_TOOLS = [
|
|
9
|
+
// Organization tools
|
|
10
|
+
{
|
|
11
|
+
name: "get_organization",
|
|
12
|
+
description: "Get details about the current organization",
|
|
13
|
+
inputSchema: {
|
|
14
|
+
type: "object",
|
|
15
|
+
properties: {},
|
|
16
|
+
required: []
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
// Project tools
|
|
20
|
+
{
|
|
21
|
+
name: "list_projects",
|
|
22
|
+
description: "List all projects in the organization",
|
|
23
|
+
inputSchema: {
|
|
24
|
+
type: "object",
|
|
25
|
+
properties: {
|
|
26
|
+
limit: { type: "number", description: "Max results (default 50)" },
|
|
27
|
+
offset: { type: "number", description: "Pagination offset" }
|
|
28
|
+
},
|
|
29
|
+
required: []
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "get_project",
|
|
34
|
+
description: "Get details about a specific project",
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: {
|
|
38
|
+
project_id: { type: "string", description: "Project ID" }
|
|
39
|
+
},
|
|
40
|
+
required: ["project_id"]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
// Artifact tools
|
|
44
|
+
{
|
|
45
|
+
name: "list_artifacts",
|
|
46
|
+
description: "List artifacts, optionally filtered by project",
|
|
47
|
+
inputSchema: {
|
|
48
|
+
type: "object",
|
|
49
|
+
properties: {
|
|
50
|
+
project_id: { type: "string", description: "Filter by project" },
|
|
51
|
+
type: { type: "string", description: "Filter by type (goal, spec, research, etc.)" },
|
|
52
|
+
status: { type: "string", description: "Filter by status" },
|
|
53
|
+
limit: { type: "number", description: "Max results" }
|
|
54
|
+
},
|
|
55
|
+
required: []
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "get_artifact",
|
|
60
|
+
description: "Get a specific artifact by ID",
|
|
61
|
+
inputSchema: {
|
|
62
|
+
type: "object",
|
|
63
|
+
properties: {
|
|
64
|
+
artifact_id: { type: "string", description: "Artifact ID" }
|
|
65
|
+
},
|
|
66
|
+
required: ["artifact_id"]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "create_artifact",
|
|
71
|
+
description: "Create a new artifact (document, goal, spec, etc.)",
|
|
72
|
+
inputSchema: {
|
|
73
|
+
type: "object",
|
|
74
|
+
properties: {
|
|
75
|
+
title: { type: "string", description: "Artifact title" },
|
|
76
|
+
type: { type: "string", description: "Artifact type: goal, spec, research, report, experiment, decision, doc" },
|
|
77
|
+
content: { type: "string", description: "Markdown content" },
|
|
78
|
+
parent_id: { type: "string", description: "Parent artifact ID for nested artifacts" },
|
|
79
|
+
tags: { type: "array", items: { type: "string" }, description: "Tags for categorization" }
|
|
80
|
+
},
|
|
81
|
+
required: ["title", "type"]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "update_artifact",
|
|
86
|
+
description: "Update an existing artifact",
|
|
87
|
+
inputSchema: {
|
|
88
|
+
type: "object",
|
|
89
|
+
properties: {
|
|
90
|
+
artifact_id: { type: "string", description: "Artifact ID" },
|
|
91
|
+
title: { type: "string", description: "New title" },
|
|
92
|
+
content: { type: "string", description: "New content" },
|
|
93
|
+
status: { type: "string", description: "New status" }
|
|
94
|
+
},
|
|
95
|
+
required: ["artifact_id"]
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
// Section tools
|
|
99
|
+
{
|
|
100
|
+
name: "list_sections",
|
|
101
|
+
description: "List sections of an artifact",
|
|
102
|
+
inputSchema: {
|
|
103
|
+
type: "object",
|
|
104
|
+
properties: {
|
|
105
|
+
artifact_id: { type: "string", description: "Artifact ID" }
|
|
106
|
+
},
|
|
107
|
+
required: ["artifact_id"]
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "get_section",
|
|
112
|
+
description: "Get a specific section",
|
|
113
|
+
inputSchema: {
|
|
114
|
+
type: "object",
|
|
115
|
+
properties: {
|
|
116
|
+
artifact_id: { type: "string", description: "Artifact ID" },
|
|
117
|
+
section_id: { type: "string", description: "Section ID" }
|
|
118
|
+
},
|
|
119
|
+
required: ["artifact_id", "section_id"]
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "create_section",
|
|
124
|
+
description: "Create a new section on an artifact",
|
|
125
|
+
inputSchema: {
|
|
126
|
+
type: "object",
|
|
127
|
+
properties: {
|
|
128
|
+
artifact_id: { type: "string", description: "Artifact ID" },
|
|
129
|
+
section_id: { type: "string", description: "Section identifier (slug)" },
|
|
130
|
+
heading: { type: "string", description: "Section heading" },
|
|
131
|
+
content: { type: "string", description: "Markdown content" },
|
|
132
|
+
type: { type: "string", description: "Type: content, task, decision, blocker" },
|
|
133
|
+
position: { type: "number", description: "Order position" }
|
|
134
|
+
},
|
|
135
|
+
required: ["artifact_id", "section_id", "heading", "content"]
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "update_section",
|
|
140
|
+
description: "Update an existing section",
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: "object",
|
|
143
|
+
properties: {
|
|
144
|
+
artifact_id: { type: "string", description: "Artifact ID" },
|
|
145
|
+
section_id: { type: "string", description: "Section ID" },
|
|
146
|
+
heading: { type: "string", description: "New heading" },
|
|
147
|
+
content: { type: "string", description: "New content" },
|
|
148
|
+
task_status: { type: "string", description: "Task status if type=task" }
|
|
149
|
+
},
|
|
150
|
+
required: ["artifact_id", "section_id"]
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "delete_section",
|
|
155
|
+
description: "Delete a section",
|
|
156
|
+
inputSchema: {
|
|
157
|
+
type: "object",
|
|
158
|
+
properties: {
|
|
159
|
+
artifact_id: { type: "string", description: "Artifact ID" },
|
|
160
|
+
section_id: { type: "string", description: "Section ID" }
|
|
161
|
+
},
|
|
162
|
+
required: ["artifact_id", "section_id"]
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
// Task tools
|
|
166
|
+
{
|
|
167
|
+
name: "list_tasks",
|
|
168
|
+
description: "List tasks (sections with type=task)",
|
|
169
|
+
inputSchema: {
|
|
170
|
+
type: "object",
|
|
171
|
+
properties: {
|
|
172
|
+
artifact_id: { type: "string", description: "Filter by artifact" },
|
|
173
|
+
status: { type: "string", description: "Filter by status: pending, in_progress, done, blocked" },
|
|
174
|
+
assignee: { type: "string", description: "Filter by assignee agent" }
|
|
175
|
+
},
|
|
176
|
+
required: []
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "claim_task",
|
|
181
|
+
description: "Claim a task for the current agent",
|
|
182
|
+
inputSchema: {
|
|
183
|
+
type: "object",
|
|
184
|
+
properties: {
|
|
185
|
+
task_id: { type: "string", description: "Task ID (section UUID)" }
|
|
186
|
+
},
|
|
187
|
+
required: ["task_id"]
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "complete_task",
|
|
192
|
+
description: "Mark a task as complete",
|
|
193
|
+
inputSchema: {
|
|
194
|
+
type: "object",
|
|
195
|
+
properties: {
|
|
196
|
+
task_id: { type: "string", description: "Task ID" },
|
|
197
|
+
output_url: { type: "string", description: "URL to deliverable (PR, doc, etc.)" },
|
|
198
|
+
summary: { type: "string", description: "Completion summary" }
|
|
199
|
+
},
|
|
200
|
+
required: ["task_id"]
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "block_task",
|
|
205
|
+
description: "Mark a task as blocked",
|
|
206
|
+
inputSchema: {
|
|
207
|
+
type: "object",
|
|
208
|
+
properties: {
|
|
209
|
+
task_id: { type: "string", description: "Task ID" },
|
|
210
|
+
reason: { type: "string", description: "Why it is blocked" },
|
|
211
|
+
blocker_type: { type: "string", description: "Type: decision, dependency, resource, external" }
|
|
212
|
+
},
|
|
213
|
+
required: ["task_id", "reason"]
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: "create_task",
|
|
218
|
+
description: "Create a new task under a goal. Use this to create actionable tasks \u2014 NOT create_artifact or create_section.",
|
|
219
|
+
inputSchema: {
|
|
220
|
+
type: "object",
|
|
221
|
+
properties: {
|
|
222
|
+
goal_id: { type: "string", description: "The goal UUID this task belongs to (required)" },
|
|
223
|
+
title: { type: "string", description: "Task title" },
|
|
224
|
+
description: { type: "string", description: "Task description / what needs to be done" },
|
|
225
|
+
priority: { type: "string", description: "Priority: low, medium, high, urgent" },
|
|
226
|
+
assigned_to: { type: "string", description: "Agent UUID to assign the task to" },
|
|
227
|
+
depends_on: { type: "array", items: { type: "string" }, description: "List of task UUIDs this task depends on" },
|
|
228
|
+
estimated_minutes: { type: "number", description: "Estimated time in minutes" }
|
|
229
|
+
},
|
|
230
|
+
required: ["goal_id", "title"]
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
// Agent tools
|
|
234
|
+
{
|
|
235
|
+
name: "list_agents",
|
|
236
|
+
description: "List all agents in the organization",
|
|
237
|
+
inputSchema: {
|
|
238
|
+
type: "object",
|
|
239
|
+
properties: {
|
|
240
|
+
status: { type: "string", description: "Filter by status: active, inactive" }
|
|
241
|
+
},
|
|
242
|
+
required: []
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: "get_agent",
|
|
247
|
+
description: "Get details about an agent",
|
|
248
|
+
inputSchema: {
|
|
249
|
+
type: "object",
|
|
250
|
+
properties: {
|
|
251
|
+
agent_id: { type: "string", description: "Agent ID" }
|
|
252
|
+
},
|
|
253
|
+
required: ["agent_id"]
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: "create_agent",
|
|
258
|
+
description: "Register a new AI agent with role, capabilities, and permissions",
|
|
259
|
+
inputSchema: {
|
|
260
|
+
type: "object",
|
|
261
|
+
properties: {
|
|
262
|
+
agentId: { type: "string", description: 'Unique agent ID (e.g., "engineering-agent", "qa-agent")' },
|
|
263
|
+
name: { type: "string", description: "Agent display name" },
|
|
264
|
+
role: { type: "string", description: "Role: pm, engineering, qa, research, content, design" },
|
|
265
|
+
description: { type: "string", description: "What this agent does - detailed description" },
|
|
266
|
+
capabilities: { type: "array", items: { type: "string" }, description: 'List of capabilities (e.g., ["code-review", "testing", "debugging"])' },
|
|
267
|
+
permissions: {
|
|
268
|
+
type: "object",
|
|
269
|
+
description: "Permission settings",
|
|
270
|
+
properties: {
|
|
271
|
+
write: { type: "boolean", description: "Can create/edit artifacts" },
|
|
272
|
+
delete: { type: "boolean", description: "Can delete artifacts" },
|
|
273
|
+
delegate_tasks: { type: "boolean", description: "Can assign tasks to other agents" }
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
systemPrompt: { type: "string", description: "System prompt for the agent" }
|
|
277
|
+
},
|
|
278
|
+
required: ["agentId", "name", "role", "description"]
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: "update_agent",
|
|
283
|
+
description: "Update an agent",
|
|
284
|
+
inputSchema: {
|
|
285
|
+
type: "object",
|
|
286
|
+
properties: {
|
|
287
|
+
agent_id: { type: "string", description: "Agent ID" },
|
|
288
|
+
name: { type: "string", description: "New name" },
|
|
289
|
+
status: { type: "string", description: "New status" },
|
|
290
|
+
config: { type: "object", description: "Updated config" }
|
|
291
|
+
},
|
|
292
|
+
required: ["agent_id"]
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
// Blocker tools
|
|
296
|
+
{
|
|
297
|
+
name: "list_blockers",
|
|
298
|
+
description: "List blockers (decisions, dependencies needing resolution)",
|
|
299
|
+
inputSchema: {
|
|
300
|
+
type: "object",
|
|
301
|
+
properties: {
|
|
302
|
+
artifact_id: { type: "string", description: "Filter by artifact" },
|
|
303
|
+
status: { type: "string", description: "Filter by status: open, resolved" }
|
|
304
|
+
},
|
|
305
|
+
required: []
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: "create_blocker",
|
|
310
|
+
description: "Create a blocker (decision request, dependency, etc.)",
|
|
311
|
+
inputSchema: {
|
|
312
|
+
type: "object",
|
|
313
|
+
properties: {
|
|
314
|
+
artifact_id: { type: "string", description: "Artifact ID" },
|
|
315
|
+
kind: { type: "string", description: "Kind: decision, dependency, resource, external" },
|
|
316
|
+
title: { type: "string", description: "Blocker title" },
|
|
317
|
+
description: { type: "string", description: "Details" },
|
|
318
|
+
options: { type: "array", description: "Options for decisions" },
|
|
319
|
+
blocked_tasks: { type: "array", items: { type: "string" }, description: "Task IDs blocked by this" }
|
|
320
|
+
},
|
|
321
|
+
required: ["artifact_id", "kind", "title"]
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: "resolve_blocker",
|
|
326
|
+
description: "Resolve a blocker",
|
|
327
|
+
inputSchema: {
|
|
328
|
+
type: "object",
|
|
329
|
+
properties: {
|
|
330
|
+
blocker_id: { type: "string", description: "Blocker ID" },
|
|
331
|
+
resolution: { type: "string", description: "How it was resolved" },
|
|
332
|
+
selected_option: { type: "string", description: "Selected option (for decisions)" }
|
|
333
|
+
},
|
|
334
|
+
required: ["blocker_id", "resolution"]
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
// Search tools
|
|
338
|
+
{
|
|
339
|
+
name: "search_artifacts",
|
|
340
|
+
description: "Search artifacts by text query",
|
|
341
|
+
inputSchema: {
|
|
342
|
+
type: "object",
|
|
343
|
+
properties: {
|
|
344
|
+
query: { type: "string", description: "Search query" },
|
|
345
|
+
type: { type: "string", description: "Filter by type" },
|
|
346
|
+
limit: { type: "number", description: "Max results" }
|
|
347
|
+
},
|
|
348
|
+
required: ["query"]
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
// Context tools
|
|
352
|
+
{
|
|
353
|
+
name: "get_task_context",
|
|
354
|
+
description: "Get full context for a task (org, project, artifact, related sections)",
|
|
355
|
+
inputSchema: {
|
|
356
|
+
type: "object",
|
|
357
|
+
properties: {
|
|
358
|
+
task_id: { type: "string", description: "Task ID" }
|
|
359
|
+
},
|
|
360
|
+
required: ["task_id"]
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
];
|
|
364
|
+
var ArtyfactsApiClient = class {
|
|
365
|
+
constructor(baseUrl, apiKey) {
|
|
366
|
+
this.baseUrl = baseUrl;
|
|
367
|
+
this.apiKey = apiKey;
|
|
368
|
+
}
|
|
369
|
+
async request(method, path, body) {
|
|
370
|
+
const url = `${this.baseUrl}${path}`;
|
|
371
|
+
const response = await fetch(url, {
|
|
372
|
+
method,
|
|
373
|
+
headers: {
|
|
374
|
+
"Authorization": `Bearer ${this.apiKey}`,
|
|
375
|
+
"Content-Type": "application/json"
|
|
376
|
+
},
|
|
377
|
+
body: body ? JSON.stringify(body) : void 0
|
|
378
|
+
});
|
|
379
|
+
if (!response.ok) {
|
|
380
|
+
const error = await response.json().catch(() => ({ error: "Request failed" }));
|
|
381
|
+
throw new Error(error.error || `HTTP ${response.status}: ${response.statusText}`);
|
|
382
|
+
}
|
|
383
|
+
return response.json();
|
|
384
|
+
}
|
|
385
|
+
get(path) {
|
|
386
|
+
return this.request("GET", path);
|
|
387
|
+
}
|
|
388
|
+
post(path, body) {
|
|
389
|
+
return this.request("POST", path, body);
|
|
390
|
+
}
|
|
391
|
+
patch(path, body) {
|
|
392
|
+
return this.request("PATCH", path, body);
|
|
393
|
+
}
|
|
394
|
+
delete(path) {
|
|
395
|
+
return this.request("DELETE", path);
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
var toolHandlers = {
|
|
399
|
+
// Organization
|
|
400
|
+
get_organization: (client) => client.get("/org"),
|
|
401
|
+
// Projects
|
|
402
|
+
list_projects: (client, args) => {
|
|
403
|
+
const params = new URLSearchParams();
|
|
404
|
+
if (args.limit) params.set("limit", String(args.limit));
|
|
405
|
+
if (args.offset) params.set("offset", String(args.offset));
|
|
406
|
+
return client.get(`/projects?${params}`);
|
|
407
|
+
},
|
|
408
|
+
get_project: (client, args) => client.get(`/projects/${args.project_id}`),
|
|
409
|
+
// Artifacts
|
|
410
|
+
list_artifacts: (client, args) => {
|
|
411
|
+
const params = new URLSearchParams();
|
|
412
|
+
if (args.project_id) params.set("project_id", String(args.project_id));
|
|
413
|
+
if (args.type) params.set("type", String(args.type));
|
|
414
|
+
if (args.status) params.set("status", String(args.status));
|
|
415
|
+
if (args.limit) params.set("limit", String(args.limit));
|
|
416
|
+
return client.get(`/artifacts?${params}`);
|
|
417
|
+
},
|
|
418
|
+
get_artifact: (client, args) => client.get(`/artifacts/${args.artifact_id}`),
|
|
419
|
+
create_artifact: (client, args) => {
|
|
420
|
+
const envelope = {
|
|
421
|
+
aah_version: "0.3",
|
|
422
|
+
artifact: {
|
|
423
|
+
id: args.id || `artifact-${Date.now()}`,
|
|
424
|
+
title: args.title,
|
|
425
|
+
type: args.type || "document/sectioned",
|
|
426
|
+
artifact_type: args.artifact_type || args.type || "doc",
|
|
427
|
+
parent_id: args.parent_id,
|
|
428
|
+
tags: args.tags
|
|
429
|
+
},
|
|
430
|
+
content: args.content ? {
|
|
431
|
+
media_type: "text/markdown",
|
|
432
|
+
body: args.content
|
|
433
|
+
} : void 0,
|
|
434
|
+
source: {
|
|
435
|
+
agent_id: "mcp-agent"
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
return client.post("/artifacts", envelope);
|
|
439
|
+
},
|
|
440
|
+
update_artifact: (client, args) => {
|
|
441
|
+
const { artifact_id, ...body } = args;
|
|
442
|
+
return client.patch(`/artifacts/${artifact_id}`, body);
|
|
443
|
+
},
|
|
444
|
+
// Sections
|
|
445
|
+
list_sections: (client, args) => client.get(`/artifacts/${args.artifact_id}/sections`),
|
|
446
|
+
get_section: (client, args) => client.get(`/artifacts/${args.artifact_id}/sections/${args.section_id}`),
|
|
447
|
+
create_section: (client, args) => {
|
|
448
|
+
const { artifact_id, section_id, ...rest } = args;
|
|
449
|
+
const body = { id: section_id, ...rest };
|
|
450
|
+
return client.post(`/artifacts/${artifact_id}/sections`, body);
|
|
451
|
+
},
|
|
452
|
+
update_section: (client, args) => {
|
|
453
|
+
const { artifact_id, section_id, ...body } = args;
|
|
454
|
+
return client.patch(`/artifacts/${artifact_id}/sections/${section_id}`, body);
|
|
455
|
+
},
|
|
456
|
+
delete_section: (client, args) => client.delete(`/artifacts/${args.artifact_id}/sections/${args.section_id}`),
|
|
457
|
+
// Tasks
|
|
458
|
+
list_tasks: (client, args) => {
|
|
459
|
+
const params = new URLSearchParams();
|
|
460
|
+
if (args.artifact_id) params.set("artifact_id", String(args.artifact_id));
|
|
461
|
+
if (args.status) params.set("status", String(args.status));
|
|
462
|
+
if (args.assignee) params.set("assignee", String(args.assignee));
|
|
463
|
+
return client.get(`/tasks?${params}`);
|
|
464
|
+
},
|
|
465
|
+
claim_task: (client, args) => client.post(`/tasks/${args.task_id}/claim`),
|
|
466
|
+
complete_task: (client, args) => {
|
|
467
|
+
const { task_id, ...body } = args;
|
|
468
|
+
return client.post(`/tasks/${task_id}/complete`, body);
|
|
469
|
+
},
|
|
470
|
+
block_task: (client, args) => {
|
|
471
|
+
const { task_id, ...body } = args;
|
|
472
|
+
return client.post(`/tasks/${task_id}/block`, body);
|
|
473
|
+
},
|
|
474
|
+
create_task: (client, args) => {
|
|
475
|
+
const { goal_id, title, description, priority, assigned_to, depends_on, estimated_minutes } = args;
|
|
476
|
+
return client.post("/tasks", { goal_id, title, description, priority, assigned_to, depends_on, estimated_minutes });
|
|
477
|
+
},
|
|
478
|
+
// Agents
|
|
479
|
+
list_agents: (client, args) => {
|
|
480
|
+
const params = new URLSearchParams();
|
|
481
|
+
if (args.status) params.set("status", String(args.status));
|
|
482
|
+
return client.get(`/agents?${params}`);
|
|
483
|
+
},
|
|
484
|
+
get_agent: (client, args) => client.get(`/agents/${args.agent_id}`),
|
|
485
|
+
create_agent: (client, args) => {
|
|
486
|
+
const body = {
|
|
487
|
+
agentId: args.agentId,
|
|
488
|
+
name: args.name,
|
|
489
|
+
role: args.role,
|
|
490
|
+
description: args.description,
|
|
491
|
+
permissions: args.permissions || { write: true, delete: false, delegate_tasks: false },
|
|
492
|
+
metadata: {
|
|
493
|
+
capabilities: args.capabilities || [],
|
|
494
|
+
systemPrompt: args.systemPrompt,
|
|
495
|
+
createdVia: "mcp"
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
return client.post("/agents", body);
|
|
499
|
+
},
|
|
500
|
+
update_agent: (client, args) => {
|
|
501
|
+
const { agent_id, ...body } = args;
|
|
502
|
+
return client.patch(`/agents/${agent_id}`, body);
|
|
503
|
+
},
|
|
504
|
+
// Blockers
|
|
505
|
+
list_blockers: (client, args) => {
|
|
506
|
+
const params = new URLSearchParams();
|
|
507
|
+
if (args.artifact_id) params.set("artifact_id", String(args.artifact_id));
|
|
508
|
+
if (args.status) params.set("status", String(args.status));
|
|
509
|
+
return client.get(`/blockers?${params}`);
|
|
510
|
+
},
|
|
511
|
+
create_blocker: (client, args) => {
|
|
512
|
+
const { artifact_id, ...body } = args;
|
|
513
|
+
return client.post(`/artifacts/${artifact_id}/blockers`, body);
|
|
514
|
+
},
|
|
515
|
+
resolve_blocker: (client, args) => {
|
|
516
|
+
const { blocker_id, ...body } = args;
|
|
517
|
+
return client.post(`/blockers/${blocker_id}/resolve`, body);
|
|
518
|
+
},
|
|
519
|
+
// Search
|
|
520
|
+
search_artifacts: (client, args) => {
|
|
521
|
+
const params = new URLSearchParams();
|
|
522
|
+
params.set("q", String(args.query));
|
|
523
|
+
if (args.type) params.set("type", String(args.type));
|
|
524
|
+
if (args.limit) params.set("limit", String(args.limit));
|
|
525
|
+
return client.get(`/search?${params}`);
|
|
526
|
+
},
|
|
527
|
+
// Context
|
|
528
|
+
get_task_context: (client, args) => client.get(`/tasks/${args.task_id}/context`)
|
|
529
|
+
};
|
|
530
|
+
var ArtyfactsMcpServer = class {
|
|
531
|
+
server;
|
|
532
|
+
client;
|
|
533
|
+
config;
|
|
534
|
+
constructor(config) {
|
|
535
|
+
this.config = config;
|
|
536
|
+
this.client = new ArtyfactsApiClient(
|
|
537
|
+
config.baseUrl || "https://artyfacts.dev/api/v1",
|
|
538
|
+
config.apiKey
|
|
539
|
+
);
|
|
540
|
+
this.server = new Server(
|
|
541
|
+
{
|
|
542
|
+
name: config.name || "artyfacts-mcp",
|
|
543
|
+
version: config.version || "1.0.0"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
capabilities: {
|
|
547
|
+
tools: {}
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
);
|
|
551
|
+
this.setupHandlers();
|
|
552
|
+
}
|
|
553
|
+
setupHandlers() {
|
|
554
|
+
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
555
|
+
return { tools: ARTYFACTS_TOOLS };
|
|
556
|
+
});
|
|
557
|
+
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
558
|
+
const { name, arguments: args } = request.params;
|
|
559
|
+
const handler = toolHandlers[name];
|
|
560
|
+
if (!handler) {
|
|
561
|
+
return {
|
|
562
|
+
content: [{ type: "text", text: `Unknown tool: ${name}` }],
|
|
563
|
+
isError: true
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
try {
|
|
567
|
+
const result = await handler(this.client, args || {});
|
|
568
|
+
return {
|
|
569
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
570
|
+
};
|
|
571
|
+
} catch (error) {
|
|
572
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
573
|
+
return {
|
|
574
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
575
|
+
isError: true
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
async start() {
|
|
581
|
+
const transport = new StdioServerTransport();
|
|
582
|
+
await this.server.connect(transport);
|
|
583
|
+
console.error(`Artyfacts MCP server running (${ARTYFACTS_TOOLS.length} tools)`);
|
|
584
|
+
}
|
|
585
|
+
getServer() {
|
|
586
|
+
return this.server;
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
function createMcpServer(config) {
|
|
590
|
+
return new ArtyfactsMcpServer(config);
|
|
591
|
+
}
|
|
592
|
+
async function startServer(server) {
|
|
593
|
+
await server.start();
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
export {
|
|
597
|
+
ArtyfactsMcpServer,
|
|
598
|
+
createMcpServer,
|
|
599
|
+
startServer
|
|
600
|
+
};
|
package/dist/index.cjs
CHANGED
|
@@ -238,6 +238,23 @@ var ARTYFACTS_TOOLS = [
|
|
|
238
238
|
required: ["task_id", "reason"]
|
|
239
239
|
}
|
|
240
240
|
},
|
|
241
|
+
{
|
|
242
|
+
name: "create_task",
|
|
243
|
+
description: "Create a new task under a goal. Use this to create actionable tasks \u2014 NOT create_artifact or create_section.",
|
|
244
|
+
inputSchema: {
|
|
245
|
+
type: "object",
|
|
246
|
+
properties: {
|
|
247
|
+
goal_id: { type: "string", description: "The goal UUID this task belongs to (required)" },
|
|
248
|
+
title: { type: "string", description: "Task title" },
|
|
249
|
+
description: { type: "string", description: "Task description / what needs to be done" },
|
|
250
|
+
priority: { type: "string", description: "Priority: low, medium, high, urgent" },
|
|
251
|
+
assigned_to: { type: "string", description: "Agent UUID to assign the task to" },
|
|
252
|
+
depends_on: { type: "array", items: { type: "string" }, description: "List of task UUIDs this task depends on" },
|
|
253
|
+
estimated_minutes: { type: "number", description: "Estimated time in minutes" }
|
|
254
|
+
},
|
|
255
|
+
required: ["goal_id", "title"]
|
|
256
|
+
}
|
|
257
|
+
},
|
|
241
258
|
// Agent tools
|
|
242
259
|
{
|
|
243
260
|
name: "list_agents",
|
|
@@ -263,18 +280,27 @@ var ARTYFACTS_TOOLS = [
|
|
|
263
280
|
},
|
|
264
281
|
{
|
|
265
282
|
name: "create_agent",
|
|
266
|
-
description: "Register a new agent",
|
|
283
|
+
description: "Register a new AI agent with role, capabilities, and permissions",
|
|
267
284
|
inputSchema: {
|
|
268
285
|
type: "object",
|
|
269
286
|
properties: {
|
|
270
287
|
agentId: { type: "string", description: 'Unique agent ID (e.g., "engineering-agent", "qa-agent")' },
|
|
271
288
|
name: { type: "string", description: "Agent display name" },
|
|
272
|
-
|
|
273
|
-
description: { type: "string", description: "What this agent does" },
|
|
274
|
-
capabilities: { type: "array", items: { type: "string" }, description:
|
|
275
|
-
|
|
289
|
+
role: { type: "string", description: "Role: pm, engineering, qa, research, content, design" },
|
|
290
|
+
description: { type: "string", description: "What this agent does - detailed description" },
|
|
291
|
+
capabilities: { type: "array", items: { type: "string" }, description: 'List of capabilities (e.g., ["code-review", "testing", "debugging"])' },
|
|
292
|
+
permissions: {
|
|
293
|
+
type: "object",
|
|
294
|
+
description: "Permission settings",
|
|
295
|
+
properties: {
|
|
296
|
+
write: { type: "boolean", description: "Can create/edit artifacts" },
|
|
297
|
+
delete: { type: "boolean", description: "Can delete artifacts" },
|
|
298
|
+
delegate_tasks: { type: "boolean", description: "Can assign tasks to other agents" }
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
systemPrompt: { type: "string", description: "System prompt for the agent" }
|
|
276
302
|
},
|
|
277
|
-
required: ["agentId", "name", "
|
|
303
|
+
required: ["agentId", "name", "role", "description"]
|
|
278
304
|
}
|
|
279
305
|
},
|
|
280
306
|
{
|
|
@@ -470,6 +496,10 @@ var toolHandlers = {
|
|
|
470
496
|
const { task_id, ...body } = args;
|
|
471
497
|
return client.post(`/tasks/${task_id}/block`, body);
|
|
472
498
|
},
|
|
499
|
+
create_task: (client, args) => {
|
|
500
|
+
const { goal_id, title, description, priority, assigned_to, depends_on, estimated_minutes } = args;
|
|
501
|
+
return client.post("/tasks", { goal_id, title, description, priority, assigned_to, depends_on, estimated_minutes });
|
|
502
|
+
},
|
|
473
503
|
// Agents
|
|
474
504
|
list_agents: (client, args) => {
|
|
475
505
|
const params = new URLSearchParams();
|
|
@@ -477,7 +507,21 @@ var toolHandlers = {
|
|
|
477
507
|
return client.get(`/agents?${params}`);
|
|
478
508
|
},
|
|
479
509
|
get_agent: (client, args) => client.get(`/agents/${args.agent_id}`),
|
|
480
|
-
create_agent: (client, args) =>
|
|
510
|
+
create_agent: (client, args) => {
|
|
511
|
+
const body = {
|
|
512
|
+
agentId: args.agentId,
|
|
513
|
+
name: args.name,
|
|
514
|
+
role: args.role,
|
|
515
|
+
description: args.description,
|
|
516
|
+
permissions: args.permissions || { write: true, delete: false, delegate_tasks: false },
|
|
517
|
+
metadata: {
|
|
518
|
+
capabilities: args.capabilities || [],
|
|
519
|
+
systemPrompt: args.systemPrompt,
|
|
520
|
+
createdVia: "mcp"
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
return client.post("/agents", body);
|
|
524
|
+
},
|
|
481
525
|
update_agent: (client, args) => {
|
|
482
526
|
const { agent_id, ...body } = args;
|
|
483
527
|
return client.patch(`/agents/${agent_id}`, body);
|