@contextstream/mcp-server 0.3.42 → 0.3.43

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.
Files changed (2) hide show
  1. package/dist/index.js +177 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7443,11 +7443,155 @@ ${options.workspaceId ? `# Workspace ID: ${options.workspaceId}` : ""}
7443
7443
  };
7444
7444
  }
7445
7445
 
7446
+ // src/tool-catalog.ts
7447
+ var TOOL_CATALOG = [
7448
+ {
7449
+ name: "Session",
7450
+ tools: [
7451
+ { name: "init", hint: "start-conv" },
7452
+ { name: "smart", hint: "each-msg" },
7453
+ { name: "capture", hint: "save" },
7454
+ { name: "recall", hint: "find" },
7455
+ { name: "remember", hint: "quick" },
7456
+ { name: "compress", hint: "end" },
7457
+ { name: "summary", hint: "brief" },
7458
+ { name: "delta", hint: "changes" },
7459
+ { name: "get_lessons", hint: "learn" },
7460
+ { name: "capture_lesson", hint: "mistake" },
7461
+ { name: "get_user_context", hint: "prefs" },
7462
+ { name: "smart_search", hint: "deep-find" }
7463
+ ]
7464
+ },
7465
+ {
7466
+ name: "Search",
7467
+ tools: [
7468
+ { name: "semantic", hint: "meaning" },
7469
+ { name: "hybrid", hint: "combo" },
7470
+ { name: "keyword", hint: "exact" },
7471
+ { name: "pattern", hint: "code" }
7472
+ ]
7473
+ },
7474
+ {
7475
+ name: "Memory",
7476
+ tools: [
7477
+ { name: "create_event", hint: "new" },
7478
+ { name: "list_events", hint: "list" },
7479
+ { name: "get_event", hint: "get" },
7480
+ { name: "update_event", hint: "edit" },
7481
+ { name: "delete_event", hint: "rm" },
7482
+ { name: "search", hint: "find" },
7483
+ { name: "decisions", hint: "choices" },
7484
+ { name: "timeline", hint: "history" },
7485
+ { name: "distill_event", hint: "extract" }
7486
+ ]
7487
+ },
7488
+ {
7489
+ name: "Knowledge",
7490
+ tools: [
7491
+ { name: "create_node", hint: "new" },
7492
+ { name: "list_nodes", hint: "list" },
7493
+ { name: "get_node", hint: "get" },
7494
+ { name: "update_node", hint: "edit" },
7495
+ { name: "delete_node", hint: "rm" },
7496
+ { name: "supersede_node", hint: "replace" }
7497
+ ]
7498
+ },
7499
+ {
7500
+ name: "Graph",
7501
+ tools: [
7502
+ { name: "related", hint: "links" },
7503
+ { name: "path", hint: "trace" },
7504
+ { name: "decisions", hint: "choices" },
7505
+ { name: "dependencies", hint: "deps" },
7506
+ { name: "impact", hint: "changes" },
7507
+ { name: "contradictions", hint: "conflicts" }
7508
+ ]
7509
+ },
7510
+ {
7511
+ name: "Workspace",
7512
+ tools: [
7513
+ { name: "list", hint: "" },
7514
+ { name: "get", hint: "" },
7515
+ { name: "create", hint: "" },
7516
+ { name: "associate", hint: "link-folder" },
7517
+ { name: "bootstrap", hint: "new-ws" }
7518
+ ]
7519
+ },
7520
+ {
7521
+ name: "Project",
7522
+ tools: [
7523
+ { name: "list", hint: "" },
7524
+ { name: "get", hint: "" },
7525
+ { name: "create", hint: "" },
7526
+ { name: "index", hint: "scan-code" },
7527
+ { name: "files", hint: "list-files" },
7528
+ { name: "overview", hint: "summary" }
7529
+ ]
7530
+ },
7531
+ {
7532
+ name: "AI",
7533
+ tools: [
7534
+ { name: "context", hint: "smart-ctx" },
7535
+ { name: "plan", hint: "generate" },
7536
+ { name: "tasks", hint: "breakdown" },
7537
+ { name: "embeddings", hint: "vectors" }
7538
+ ]
7539
+ }
7540
+ ];
7541
+ function generateToolCatalog(format = "grouped", category) {
7542
+ let categories = TOOL_CATALOG;
7543
+ if (category) {
7544
+ const filtered = TOOL_CATALOG.filter(
7545
+ (c) => c.name.toLowerCase() === category.toLowerCase()
7546
+ );
7547
+ if (filtered.length > 0) {
7548
+ categories = filtered;
7549
+ }
7550
+ }
7551
+ switch (format) {
7552
+ case "minimal":
7553
+ return generateMinimal(categories);
7554
+ case "full":
7555
+ return generateFull(categories);
7556
+ case "grouped":
7557
+ default:
7558
+ return generateGrouped(categories);
7559
+ }
7560
+ }
7561
+ function generateGrouped(categories) {
7562
+ return categories.map((cat) => {
7563
+ const tools = cat.tools.map((t) => t.hint ? `${t.name}(${t.hint})` : t.name).join(" ");
7564
+ return `${cat.name}: ${tools}`;
7565
+ }).join("\n");
7566
+ }
7567
+ function generateMinimal(categories) {
7568
+ return categories.map((cat) => {
7569
+ const tools = cat.tools.map((t) => t.name).join("|");
7570
+ return `${cat.name}:${tools}`;
7571
+ }).join("\n");
7572
+ }
7573
+ function generateFull(categories) {
7574
+ const lines = [];
7575
+ for (const cat of categories) {
7576
+ lines.push(`## ${cat.name}`);
7577
+ for (const tool of cat.tools) {
7578
+ const prefix = cat.name.toLowerCase().replace(/\s+/g, "_");
7579
+ const fullName = `${prefix}_${tool.name}`;
7580
+ lines.push(`- ${fullName}: ${tool.hint || "standard CRUD"}`);
7581
+ }
7582
+ }
7583
+ return lines.join("\n");
7584
+ }
7585
+ function getCoreToolsHint() {
7586
+ return `Session: init(start) smart(each-msg) capture(save) recall(find) remember(quick)`;
7587
+ }
7588
+
7446
7589
  // src/tools.ts
7447
7590
  var LESSON_DEDUP_WINDOW_MS = 2 * 60 * 1e3;
7448
7591
  var recentLessonCaptures = /* @__PURE__ */ new Map();
7449
7592
  var CORE_TOOLSET = /* @__PURE__ */ new Set([
7450
7593
  "session_init",
7594
+ "session_tools",
7451
7595
  "context_smart",
7452
7596
  "session_summary",
7453
7597
  "session_capture",
@@ -8688,6 +8832,7 @@ This does semantic search on the first message. You only need context_smart on s
8688
8832
  ideRoots = [input.folder_path];
8689
8833
  }
8690
8834
  const result = await client.initSession(input, ideRoots);
8835
+ result.tools_hint = getCoreToolsHint();
8691
8836
  if (sessionManager) {
8692
8837
  sessionManager.markInitialized(result);
8693
8838
  }
@@ -8743,6 +8888,38 @@ This does semantic search on the first message. You only need context_smart on s
8743
8888
  return { content: [{ type: "text", text }], structuredContent: toStructured(result) };
8744
8889
  }
8745
8890
  );
8891
+ registerTool(
8892
+ "session_tools",
8893
+ {
8894
+ title: "Get available ContextStream tools",
8895
+ description: `Get an ultra-compact list of all available ContextStream MCP tools.
8896
+ Use this when you need to know what tools are available without reading full descriptions.
8897
+
8898
+ Returns a token-efficient tool catalog (~120 tokens) organized by category.
8899
+
8900
+ Format options:
8901
+ - 'grouped' (default): Category: tool(hint) tool(hint) - best for quick reference
8902
+ - 'minimal': Category:tool|tool|tool - most compact
8903
+ - 'full': Detailed list with descriptions
8904
+
8905
+ Example output (grouped):
8906
+ Session: init(start-conv) smart(each-msg) capture(save) recall(find) remember(quick)
8907
+ Search: semantic(meaning) hybrid(combo) keyword(exact)
8908
+ Memory: events(crud) nodes(knowledge) search(find) decisions(choices)`,
8909
+ inputSchema: external_exports.object({
8910
+ format: external_exports.enum(["grouped", "minimal", "full"]).optional().default("grouped").describe("Output format: grouped (default, ~120 tokens), minimal (~80 tokens), or full (~200 tokens)"),
8911
+ category: external_exports.string().optional().describe("Filter to specific category: Session, Search, Memory, Knowledge, Graph, Workspace, Project, AI")
8912
+ })
8913
+ },
8914
+ async (input) => {
8915
+ const format = input.format || "grouped";
8916
+ const catalog = generateToolCatalog(format, input.category);
8917
+ return {
8918
+ content: [{ type: "text", text: catalog }],
8919
+ structuredContent: { format, catalog }
8920
+ };
8921
+ }
8922
+ );
8746
8923
  registerTool(
8747
8924
  "session_get_user_context",
8748
8925
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contextstream/mcp-server",
3
- "version": "0.3.42",
3
+ "version": "0.3.43",
4
4
  "description": "MCP server exposing ContextStream public API - code context, memory, search, and AI tools for developers",
5
5
  "type": "module",
6
6
  "license": "MIT",