contextforge-mcp 0.1.74 → 0.1.76
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/api-client.d.ts +48 -0
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +90 -0
- package/dist/api-client.js.map +1 -1
- package/dist/index.js +400 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +187 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +75 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
import { ApiClient, ApiClientError, readProjectLinkConfig, } from "./api-client.js";
|
|
6
|
-
import { ConfigSchema, IngestInputSchema, QueryInputSchema, CreateProjectInputSchema, CreateSpaceInputSchema, RelateInputSchema, ListRelationshipsInputSchema, DeleteInputSchema, GitConnectInputSchema, GitActivateInputSchema, GitDisconnectInputSchema, GitSyncInputSchema, GitHistoryInputSchema, SnapshotCreateInputSchema, SnapshotRestoreInputSchema, SnapshotDeleteInputSchema, ExportInputSchema, ImportInputSchema, IngestBatchInputSchema, DeleteBatchInputSchema, LinkProjectInputSchema, parseArrayInput, } from "./types.js";
|
|
6
|
+
import { ConfigSchema, IngestInputSchema, QueryInputSchema, CreateProjectInputSchema, CreateSpaceInputSchema, RelateInputSchema, ListRelationshipsInputSchema, DeleteInputSchema, GitConnectInputSchema, GitActivateInputSchema, GitDisconnectInputSchema, GitSyncInputSchema, GitHistoryInputSchema, SnapshotCreateInputSchema, SnapshotRestoreInputSchema, SnapshotDeleteInputSchema, ExportInputSchema, ImportInputSchema, IngestBatchInputSchema, DeleteBatchInputSchema, LinkProjectInputSchema, SkillsListInputSchema, SkillsGetInputSchema, SkillsCreateInputSchema, SkillsUpdateInputSchema, SkillsDeleteInputSchema, SkillsRunInputSchema, RoutinesListInputSchema, RoutinesGetInputSchema, RoutinesCreateInputSchema, RoutinesUpdateInputSchema, RoutinesToggleInputSchema, RoutinesRunNowInputSchema, RoutinesDeleteInputSchema, parseArrayInput, } from "./types.js";
|
|
7
7
|
import { resolveTaskIdentifier } from "./task-params.js";
|
|
8
8
|
import { appendFileSync } from "fs";
|
|
9
9
|
import { createRequire } from "module";
|
|
@@ -89,6 +89,19 @@ function logTool(toolName, details) {
|
|
|
89
89
|
tasks_add_comment: "💬",
|
|
90
90
|
collaborators_list: "👥",
|
|
91
91
|
project_share: "🔗",
|
|
92
|
+
skills_list: "🧰",
|
|
93
|
+
skills_get: "🔧",
|
|
94
|
+
skills_create: "➕",
|
|
95
|
+
skills_update: "✏️",
|
|
96
|
+
skills_delete: "🗑️",
|
|
97
|
+
skills_run: "▶️",
|
|
98
|
+
routines_list: "📅",
|
|
99
|
+
routines_get: "🔍",
|
|
100
|
+
routines_create: "➕",
|
|
101
|
+
routines_update: "✏️",
|
|
102
|
+
routines_toggle: "⏯",
|
|
103
|
+
routines_run_now: "▶",
|
|
104
|
+
routines_delete: "🗑️",
|
|
92
105
|
};
|
|
93
106
|
const icon = icons[toolName] || "🔧";
|
|
94
107
|
log(icon, `${colors.bright}${toolName}${colors.reset}${details ? ` ${colors.dim}${details}${colors.reset}` : ""}`, colors.cyan);
|
|
@@ -1276,6 +1289,214 @@ const TOOLS = [
|
|
|
1276
1289
|
required: ["email"],
|
|
1277
1290
|
},
|
|
1278
1291
|
},
|
|
1292
|
+
{
|
|
1293
|
+
name: "skills_list",
|
|
1294
|
+
description: "List all Skills in a project. Returns skills with their name, description, model, and prompt body.",
|
|
1295
|
+
annotations: { title: "List Skills", readOnlyHint: true },
|
|
1296
|
+
inputSchema: {
|
|
1297
|
+
type: "object",
|
|
1298
|
+
properties: {
|
|
1299
|
+
project_id: { type: "string", description: "Project UUID" },
|
|
1300
|
+
},
|
|
1301
|
+
required: ["project_id"],
|
|
1302
|
+
},
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
name: "skills_get",
|
|
1306
|
+
description: "Get a single Skill by ID with full body.",
|
|
1307
|
+
annotations: { title: "Get Skill", readOnlyHint: true },
|
|
1308
|
+
inputSchema: {
|
|
1309
|
+
type: "object",
|
|
1310
|
+
properties: {
|
|
1311
|
+
id: { type: "string", description: "Skill UUID" },
|
|
1312
|
+
},
|
|
1313
|
+
required: ["id"],
|
|
1314
|
+
},
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
name: "skills_create",
|
|
1318
|
+
description: "Create a new Skill in a project. The 'body' is a markdown prompt template that may use {{variable}} placeholders for input_params at run time.",
|
|
1319
|
+
annotations: { title: "Create Skill", destructiveHint: false },
|
|
1320
|
+
inputSchema: {
|
|
1321
|
+
type: "object",
|
|
1322
|
+
properties: {
|
|
1323
|
+
project_id: { type: "string" },
|
|
1324
|
+
name: { type: "string" },
|
|
1325
|
+
description: { type: "string" },
|
|
1326
|
+
body: {
|
|
1327
|
+
type: "string",
|
|
1328
|
+
description: "Markdown prompt template with optional {{var}} placeholders",
|
|
1329
|
+
},
|
|
1330
|
+
input_schema: {
|
|
1331
|
+
type: "object",
|
|
1332
|
+
description: "Optional JSON Schema for input_params",
|
|
1333
|
+
},
|
|
1334
|
+
llm_provider: {
|
|
1335
|
+
type: "string",
|
|
1336
|
+
enum: ["anthropic", "openai"],
|
|
1337
|
+
description: "Default 'anthropic'",
|
|
1338
|
+
},
|
|
1339
|
+
model: { type: "string", description: "e.g., claude-sonnet-4-6" },
|
|
1340
|
+
save_to_space_id: {
|
|
1341
|
+
type: "string",
|
|
1342
|
+
description: "Optional: save outputs as knowledge_items in this space",
|
|
1343
|
+
},
|
|
1344
|
+
},
|
|
1345
|
+
required: ["project_id", "name", "body", "model"],
|
|
1346
|
+
},
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
name: "skills_update",
|
|
1350
|
+
description: "Update an existing Skill.",
|
|
1351
|
+
annotations: { title: "Update Skill", destructiveHint: true },
|
|
1352
|
+
inputSchema: {
|
|
1353
|
+
type: "object",
|
|
1354
|
+
properties: {
|
|
1355
|
+
id: { type: "string" },
|
|
1356
|
+
name: { type: "string" },
|
|
1357
|
+
description: { type: "string" },
|
|
1358
|
+
body: { type: "string" },
|
|
1359
|
+
input_schema: { type: "object" },
|
|
1360
|
+
llm_provider: { type: "string", enum: ["anthropic", "openai"] },
|
|
1361
|
+
model: { type: "string" },
|
|
1362
|
+
save_to_space_id: { type: "string" },
|
|
1363
|
+
},
|
|
1364
|
+
required: ["id"],
|
|
1365
|
+
},
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
name: "skills_delete",
|
|
1369
|
+
description: "Delete a Skill.",
|
|
1370
|
+
annotations: { title: "Delete Skill", destructiveHint: true },
|
|
1371
|
+
inputSchema: {
|
|
1372
|
+
type: "object",
|
|
1373
|
+
properties: {
|
|
1374
|
+
id: { type: "string" },
|
|
1375
|
+
},
|
|
1376
|
+
required: ["id"],
|
|
1377
|
+
},
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
name: "skills_run",
|
|
1381
|
+
description: "Execute a Skill on the configured LLM, optionally storing the output as a knowledge_item, and returns the result. Available to all project members.",
|
|
1382
|
+
annotations: { title: "Run Skill", destructiveHint: false },
|
|
1383
|
+
inputSchema: {
|
|
1384
|
+
type: "object",
|
|
1385
|
+
properties: {
|
|
1386
|
+
skill_id: { type: "string" },
|
|
1387
|
+
input_params: {
|
|
1388
|
+
type: "object",
|
|
1389
|
+
description: "Variables substituted into the skill body",
|
|
1390
|
+
},
|
|
1391
|
+
},
|
|
1392
|
+
required: ["skill_id"],
|
|
1393
|
+
},
|
|
1394
|
+
},
|
|
1395
|
+
{
|
|
1396
|
+
name: "routines_list",
|
|
1397
|
+
description: "List all Routines in a project. Returns routines with their schedule, last/next run, and enabled flag.",
|
|
1398
|
+
annotations: { title: "List Routines", readOnlyHint: true },
|
|
1399
|
+
inputSchema: {
|
|
1400
|
+
type: "object",
|
|
1401
|
+
properties: {
|
|
1402
|
+
project_id: { type: "string", description: "Project UUID" },
|
|
1403
|
+
},
|
|
1404
|
+
required: ["project_id"],
|
|
1405
|
+
},
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
name: "routines_get",
|
|
1409
|
+
description: "Get a single Routine by ID, including its cron expression, input_params, and last/next run.",
|
|
1410
|
+
annotations: { title: "Get Routine", readOnlyHint: true },
|
|
1411
|
+
inputSchema: {
|
|
1412
|
+
type: "object",
|
|
1413
|
+
properties: { id: { type: "string", description: "Routine UUID" } },
|
|
1414
|
+
required: ["id"],
|
|
1415
|
+
},
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
name: "routines_create",
|
|
1419
|
+
description: "Create a new Routine. Schedules a Skill to run on a cron expression. Pass either schedule_preset (hourly/daily/weekly/monthly) OR a custom cron_expression. timezone defaults to UTC.",
|
|
1420
|
+
annotations: { title: "Create Routine", destructiveHint: false },
|
|
1421
|
+
inputSchema: {
|
|
1422
|
+
type: "object",
|
|
1423
|
+
properties: {
|
|
1424
|
+
project_id: { type: "string" },
|
|
1425
|
+
skill_id: { type: "string" },
|
|
1426
|
+
name: { type: "string" },
|
|
1427
|
+
schedule_preset: {
|
|
1428
|
+
type: "string",
|
|
1429
|
+
enum: ["hourly", "daily", "weekly", "monthly", "custom"],
|
|
1430
|
+
},
|
|
1431
|
+
cron_expression: {
|
|
1432
|
+
type: "string",
|
|
1433
|
+
description: "Required if schedule_preset=custom. Standard 5-field cron.",
|
|
1434
|
+
},
|
|
1435
|
+
timezone: {
|
|
1436
|
+
type: "string",
|
|
1437
|
+
description: "IANA TZ name, e.g. America/New_York. Default UTC.",
|
|
1438
|
+
},
|
|
1439
|
+
input_params: {
|
|
1440
|
+
type: "object",
|
|
1441
|
+
description: "Variables substituted into the Skill body at each run",
|
|
1442
|
+
},
|
|
1443
|
+
},
|
|
1444
|
+
required: ["project_id", "skill_id", "name"],
|
|
1445
|
+
},
|
|
1446
|
+
},
|
|
1447
|
+
{
|
|
1448
|
+
name: "routines_update",
|
|
1449
|
+
description: "Update an existing Routine (name, schedule, timezone, input_params).",
|
|
1450
|
+
annotations: { title: "Update Routine", destructiveHint: false },
|
|
1451
|
+
inputSchema: {
|
|
1452
|
+
type: "object",
|
|
1453
|
+
properties: {
|
|
1454
|
+
id: { type: "string" },
|
|
1455
|
+
name: { type: "string" },
|
|
1456
|
+
schedule_preset: {
|
|
1457
|
+
type: "string",
|
|
1458
|
+
enum: ["hourly", "daily", "weekly", "monthly", "custom"],
|
|
1459
|
+
},
|
|
1460
|
+
cron_expression: { type: "string" },
|
|
1461
|
+
timezone: { type: "string" },
|
|
1462
|
+
input_params: { type: "object" },
|
|
1463
|
+
},
|
|
1464
|
+
required: ["id"],
|
|
1465
|
+
},
|
|
1466
|
+
},
|
|
1467
|
+
{
|
|
1468
|
+
name: "routines_toggle",
|
|
1469
|
+
description: "Enable or disable a Routine without deleting it. Pass enabled=false to pause.",
|
|
1470
|
+
annotations: { title: "Toggle Routine", destructiveHint: false },
|
|
1471
|
+
inputSchema: {
|
|
1472
|
+
type: "object",
|
|
1473
|
+
properties: {
|
|
1474
|
+
id: { type: "string" },
|
|
1475
|
+
enabled: { type: "boolean" },
|
|
1476
|
+
},
|
|
1477
|
+
required: ["id", "enabled"],
|
|
1478
|
+
},
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
name: "routines_run_now",
|
|
1482
|
+
description: "Fire a Routine immediately, ahead of its schedule. Creates a skill_executions row with trigger_type=scheduled and routine_id set, just like the cron tick would.",
|
|
1483
|
+
annotations: { title: "Run Routine Now", destructiveHint: false },
|
|
1484
|
+
inputSchema: {
|
|
1485
|
+
type: "object",
|
|
1486
|
+
properties: { id: { type: "string" } },
|
|
1487
|
+
required: ["id"],
|
|
1488
|
+
},
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
name: "routines_delete",
|
|
1492
|
+
description: "Permanently delete a Routine. Execution history rows are retained.",
|
|
1493
|
+
annotations: { title: "Delete Routine", destructiveHint: true },
|
|
1494
|
+
inputSchema: {
|
|
1495
|
+
type: "object",
|
|
1496
|
+
properties: { id: { type: "string" } },
|
|
1497
|
+
required: ["id"],
|
|
1498
|
+
},
|
|
1499
|
+
},
|
|
1279
1500
|
];
|
|
1280
1501
|
// ============ Main Server ============
|
|
1281
1502
|
async function main() {
|
|
@@ -3013,6 +3234,184 @@ https://github.com/contextforge/contextforge-mcp
|
|
|
3013
3234
|
],
|
|
3014
3235
|
};
|
|
3015
3236
|
}
|
|
3237
|
+
case "skills_list": {
|
|
3238
|
+
const input = SkillsListInputSchema.parse(args);
|
|
3239
|
+
logTool(name, input.project_id);
|
|
3240
|
+
const skills = await apiClient.listSkills(input);
|
|
3241
|
+
return {
|
|
3242
|
+
content: [
|
|
3243
|
+
{
|
|
3244
|
+
type: "text",
|
|
3245
|
+
text: JSON.stringify(skills, null, 2),
|
|
3246
|
+
},
|
|
3247
|
+
],
|
|
3248
|
+
};
|
|
3249
|
+
}
|
|
3250
|
+
case "skills_get": {
|
|
3251
|
+
const input = SkillsGetInputSchema.parse(args);
|
|
3252
|
+
logTool(name, input.id);
|
|
3253
|
+
const skill = await apiClient.getSkill(input);
|
|
3254
|
+
return {
|
|
3255
|
+
content: [
|
|
3256
|
+
{
|
|
3257
|
+
type: "text",
|
|
3258
|
+
text: JSON.stringify(skill, null, 2),
|
|
3259
|
+
},
|
|
3260
|
+
],
|
|
3261
|
+
};
|
|
3262
|
+
}
|
|
3263
|
+
case "skills_create": {
|
|
3264
|
+
const input = SkillsCreateInputSchema.parse(args);
|
|
3265
|
+
logTool(name, `"${input.name}"`);
|
|
3266
|
+
const skill = await apiClient.createSkill(input);
|
|
3267
|
+
return {
|
|
3268
|
+
content: [
|
|
3269
|
+
{
|
|
3270
|
+
type: "text",
|
|
3271
|
+
text: `✅ Created skill ${skill.name} (id: ${skill.id})`,
|
|
3272
|
+
},
|
|
3273
|
+
],
|
|
3274
|
+
};
|
|
3275
|
+
}
|
|
3276
|
+
case "skills_update": {
|
|
3277
|
+
const input = SkillsUpdateInputSchema.parse(args);
|
|
3278
|
+
logTool(name, input.id);
|
|
3279
|
+
const skill = await apiClient.updateSkill(input);
|
|
3280
|
+
return {
|
|
3281
|
+
content: [
|
|
3282
|
+
{
|
|
3283
|
+
type: "text",
|
|
3284
|
+
text: `✅ Updated skill ${skill.name}`,
|
|
3285
|
+
},
|
|
3286
|
+
],
|
|
3287
|
+
};
|
|
3288
|
+
}
|
|
3289
|
+
case "skills_delete": {
|
|
3290
|
+
const input = SkillsDeleteInputSchema.parse(args);
|
|
3291
|
+
logTool(name, input.id);
|
|
3292
|
+
await apiClient.deleteSkill(input);
|
|
3293
|
+
return {
|
|
3294
|
+
content: [
|
|
3295
|
+
{
|
|
3296
|
+
type: "text",
|
|
3297
|
+
text: `🗑️ Skill ${input.id} deleted`,
|
|
3298
|
+
},
|
|
3299
|
+
],
|
|
3300
|
+
};
|
|
3301
|
+
}
|
|
3302
|
+
case "skills_run": {
|
|
3303
|
+
const input = SkillsRunInputSchema.parse(args);
|
|
3304
|
+
logTool(name, input.skill_id);
|
|
3305
|
+
const result = await apiClient.runSkill(input);
|
|
3306
|
+
const cost = typeof result?.cost_usd === "number"
|
|
3307
|
+
? result.cost_usd.toFixed(4)
|
|
3308
|
+
: "0";
|
|
3309
|
+
const summary = `**Output:**\n\n${result?.output ?? ""}\n\n---\n*Tokens: ${result?.tokens_input ?? 0}/${result?.tokens_output ?? 0} • Cost: $${cost}*`;
|
|
3310
|
+
return {
|
|
3311
|
+
content: [
|
|
3312
|
+
{
|
|
3313
|
+
type: "text",
|
|
3314
|
+
text: summary,
|
|
3315
|
+
},
|
|
3316
|
+
],
|
|
3317
|
+
};
|
|
3318
|
+
}
|
|
3319
|
+
case "routines_list": {
|
|
3320
|
+
const input = RoutinesListInputSchema.parse(args);
|
|
3321
|
+
logTool(name, input.project_id);
|
|
3322
|
+
const routines = await apiClient.listRoutines(input);
|
|
3323
|
+
return {
|
|
3324
|
+
content: [
|
|
3325
|
+
{
|
|
3326
|
+
type: "text",
|
|
3327
|
+
text: JSON.stringify(routines, null, 2),
|
|
3328
|
+
},
|
|
3329
|
+
],
|
|
3330
|
+
};
|
|
3331
|
+
}
|
|
3332
|
+
case "routines_get": {
|
|
3333
|
+
const input = RoutinesGetInputSchema.parse(args);
|
|
3334
|
+
logTool(name, input.id);
|
|
3335
|
+
const routine = await apiClient.getRoutine(input);
|
|
3336
|
+
return {
|
|
3337
|
+
content: [
|
|
3338
|
+
{
|
|
3339
|
+
type: "text",
|
|
3340
|
+
text: JSON.stringify(routine, null, 2),
|
|
3341
|
+
},
|
|
3342
|
+
],
|
|
3343
|
+
};
|
|
3344
|
+
}
|
|
3345
|
+
case "routines_create": {
|
|
3346
|
+
const input = RoutinesCreateInputSchema.parse(args);
|
|
3347
|
+
logTool(name, input.name);
|
|
3348
|
+
const routine = await apiClient.createRoutine(input);
|
|
3349
|
+
return {
|
|
3350
|
+
content: [
|
|
3351
|
+
{
|
|
3352
|
+
type: "text",
|
|
3353
|
+
text: `✅ Created routine ${routine?.name ?? input.name} (id: ${routine?.id ?? "?"})`,
|
|
3354
|
+
},
|
|
3355
|
+
],
|
|
3356
|
+
};
|
|
3357
|
+
}
|
|
3358
|
+
case "routines_update": {
|
|
3359
|
+
const input = RoutinesUpdateInputSchema.parse(args);
|
|
3360
|
+
logTool(name, input.id);
|
|
3361
|
+
const routine = await apiClient.updateRoutine(input);
|
|
3362
|
+
return {
|
|
3363
|
+
content: [
|
|
3364
|
+
{
|
|
3365
|
+
type: "text",
|
|
3366
|
+
text: `✅ Updated routine ${routine?.name ?? input.id}`,
|
|
3367
|
+
},
|
|
3368
|
+
],
|
|
3369
|
+
};
|
|
3370
|
+
}
|
|
3371
|
+
case "routines_toggle": {
|
|
3372
|
+
const input = RoutinesToggleInputSchema.parse(args);
|
|
3373
|
+
logTool(name, `${input.id} → ${input.enabled ? "enabled" : "paused"}`);
|
|
3374
|
+
const routine = await apiClient.toggleRoutine(input);
|
|
3375
|
+
const verb = input.enabled ? "enabled" : "paused";
|
|
3376
|
+
return {
|
|
3377
|
+
content: [
|
|
3378
|
+
{
|
|
3379
|
+
type: "text",
|
|
3380
|
+
text: `✅ Routine ${verb}: ${routine?.name ?? input.id}`,
|
|
3381
|
+
},
|
|
3382
|
+
],
|
|
3383
|
+
};
|
|
3384
|
+
}
|
|
3385
|
+
case "routines_run_now": {
|
|
3386
|
+
const input = RoutinesRunNowInputSchema.parse(args);
|
|
3387
|
+
logTool(name, input.id);
|
|
3388
|
+
const result = await apiClient.runRoutineNow(input);
|
|
3389
|
+
const cost = typeof result?.cost_usd === "number"
|
|
3390
|
+
? result.cost_usd.toFixed(4)
|
|
3391
|
+
: "0";
|
|
3392
|
+
const summary = `**Routine fired**\n\n${result?.output ?? ""}\n\n---\n*Tokens: ${result?.tokens_input ?? 0}/${result?.tokens_output ?? 0} • Cost: $${cost}*`;
|
|
3393
|
+
return {
|
|
3394
|
+
content: [
|
|
3395
|
+
{
|
|
3396
|
+
type: "text",
|
|
3397
|
+
text: summary,
|
|
3398
|
+
},
|
|
3399
|
+
],
|
|
3400
|
+
};
|
|
3401
|
+
}
|
|
3402
|
+
case "routines_delete": {
|
|
3403
|
+
const input = RoutinesDeleteInputSchema.parse(args);
|
|
3404
|
+
logTool(name, input.id);
|
|
3405
|
+
await apiClient.deleteRoutine(input);
|
|
3406
|
+
return {
|
|
3407
|
+
content: [
|
|
3408
|
+
{
|
|
3409
|
+
type: "text",
|
|
3410
|
+
text: `🗑 Routine deleted: ${input.id}`,
|
|
3411
|
+
},
|
|
3412
|
+
],
|
|
3413
|
+
};
|
|
3414
|
+
}
|
|
3016
3415
|
default:
|
|
3017
3416
|
logError(`Unknown tool: ${name}`);
|
|
3018
3417
|
return {
|