@contextstream/mcp-server 0.4.2 → 0.4.3

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 +159 -227
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7289,116 +7289,29 @@ import * as path4 from "node:path";
7289
7289
  // src/rules-templates.ts
7290
7290
  var DEFAULT_CLAUDE_MCP_SERVER_NAME = "contextstream";
7291
7291
  var CONTEXTSTREAM_TOOL_NAMES = [
7292
- // Session/Context (standard)
7292
+ // Standalone tools (always present)
7293
7293
  "session_init",
7294
7294
  "context_smart",
7295
7295
  "context_feedback",
7296
- "session_summary",
7297
- "session_capture",
7298
- "session_capture_lesson",
7299
- "session_get_lessons",
7300
- "session_recall",
7301
- "session_remember",
7302
- "session_get_user_context",
7303
- "session_smart_search",
7304
- "session_compress",
7305
- "session_delta",
7306
- // Editor Rules
7307
- "generate_editor_rules",
7308
- // Workspaces
7309
- "workspace_associate",
7310
- "workspace_bootstrap",
7311
- "workspaces_list",
7312
- "workspaces_create",
7313
- "workspaces_update",
7314
- "workspaces_delete",
7315
- "workspaces_get",
7316
- "workspaces_overview",
7317
- "workspaces_analytics",
7318
- "workspaces_content",
7319
- // Projects
7320
- "projects_list",
7321
- "projects_create",
7322
- "projects_update",
7323
- "projects_delete",
7324
- "projects_get",
7325
- "projects_overview",
7326
- "projects_statistics",
7327
- "projects_files",
7328
- "projects_index",
7329
- "projects_index_status",
7330
- "projects_ingest_local",
7331
- // Search
7332
- "search_semantic",
7333
- "search_hybrid",
7334
- "search_keyword",
7335
- "search_pattern",
7336
- "search_suggestions",
7337
- // Memory
7338
- "memory_create_event",
7339
- "memory_bulk_ingest",
7340
- "memory_list_events",
7341
- "memory_create_node",
7342
- "memory_list_nodes",
7343
- "memory_search",
7344
- "memory_decisions",
7345
- "decision_trace",
7346
- "memory_get_event",
7347
- "memory_update_event",
7348
- "memory_delete_event",
7349
- "memory_distill_event",
7350
- "memory_get_node",
7351
- "memory_update_node",
7352
- "memory_delete_node",
7353
- "memory_supersede_node",
7354
- "memory_timeline",
7355
- "memory_summary",
7356
- // Graph
7357
- "graph_related",
7358
- "graph_path",
7359
- "graph_decisions",
7360
- "graph_dependencies",
7361
- "graph_call_path",
7362
- "graph_impact",
7363
- "graph_circular_dependencies",
7364
- "graph_unused_code",
7365
- "graph_ingest",
7366
- "graph_contradictions",
7367
- // AI (PRO)
7368
- "ai_context",
7369
- "ai_enhanced_context",
7370
- "ai_context_budget",
7371
- "ai_embeddings",
7372
- "ai_plan",
7373
- "ai_tasks",
7374
- // GitHub Integration (PRO)
7375
- "github_stats",
7376
- "github_repos",
7377
- "github_contributors",
7378
- "github_activity",
7379
- "github_issues",
7380
- "github_search",
7381
- // Slack Integration (PRO)
7382
- "slack_stats",
7383
- "slack_channels",
7384
- "slack_contributors",
7385
- "slack_activity",
7386
- "slack_discussions",
7387
- "slack_search",
7388
- "slack_sync_users",
7389
- "slack_knowledge",
7390
- "slack_summary",
7391
- // GitHub additional
7392
- "github_knowledge",
7393
- "github_summary",
7394
- // Cross-source integrations
7395
- "integrations_status",
7396
- "integrations_search",
7397
- "integrations_summary",
7398
- "integrations_knowledge",
7399
- // Auth/Meta
7400
- "auth_me",
7401
- "mcp_server_version"
7296
+ // Consolidated domain tools (v0.4.x default)
7297
+ "search",
7298
+ // Modes: semantic, hybrid, keyword, pattern
7299
+ "session",
7300
+ // Actions: capture, capture_lesson, get_lessons, recall, remember, user_context, summary, compress, delta, smart_search, decision_trace
7301
+ "memory",
7302
+ // Actions: create_event, get_event, update_event, delete_event, list_events, distill_event, create_node, get_node, update_node, delete_node, list_nodes, supersede_node, search, decisions, timeline, summary
7303
+ "graph",
7304
+ // Actions: dependencies, impact, call_path, related, path, decisions, ingest, circular_dependencies, unused_code, contradictions
7305
+ "project",
7306
+ // Actions: list, get, create, update, index, overview, statistics, files, index_status, ingest_local
7307
+ "workspace",
7308
+ // Actions: list, get, associate, bootstrap
7309
+ "reminder",
7310
+ // Actions: list, active, create, snooze, complete, dismiss
7311
+ "integration",
7312
+ // Provider: slack, github, all; Actions: status, search, stats, activity, contributors, knowledge, summary, channels, discussions, sync_users, repos, issues
7313
+ "help"
7314
+ // Actions: tools, auth, version, editor_rules, enable_bundle
7402
7315
  ];
7403
7316
  function applyMcpToolPrefix(markdown, toolPrefix) {
7404
7317
  const toolPattern = CONTEXTSTREAM_TOOL_NAMES.join("|");
@@ -7406,9 +7319,10 @@ function applyMcpToolPrefix(markdown, toolPrefix) {
7406
7319
  return markdown.replace(toolRegex, `${toolPrefix}$1`);
7407
7320
  }
7408
7321
  var CONTEXTSTREAM_RULES_FULL = `
7409
- ## ContextStream Integration (Enhanced)
7322
+ ## ContextStream v0.4.x Integration (Enhanced)
7410
7323
 
7411
7324
  You have access to ContextStream MCP tools for persistent memory and context.
7325
+ v0.4.x uses **~11 consolidated domain tools** for ~75% token reduction vs previous versions.
7412
7326
 
7413
7327
  ## TL;DR - REQUIRED EVERY MESSAGE
7414
7328
 
@@ -7416,15 +7330,39 @@ You have access to ContextStream MCP tools for persistent memory and context.
7416
7330
  |---------|--------------|
7417
7331
  | **1st message** | \`session_init(folder_path="...", context_hint="<user's message>")\` |
7418
7332
  | **2nd+ messages** | \`context_smart(user_message="<user's message>", format="minified", max_tokens=400)\` |
7419
- | **Before risky/non-trivial work** | \`session_get_lessons(query="<topic>")\` |
7420
- | **After completing task** | \`session_capture(...)\` - MUST capture decisions/insights |
7421
- | **User frustration/correction** | \`session_capture_lesson(...)\` - MUST capture lessons |
7422
- | **Command/tool error + fix** | \`session_capture_lesson(...)\` - MUST capture lessons |
7333
+ | **Before risky/non-trivial work** | \`session(action="get_lessons", query="<topic>")\` |
7334
+ | **After completing task** | \`session(action="capture", event_type="decision", ...)\` - MUST capture |
7335
+ | **User frustration/correction** | \`session(action="capture_lesson", ...)\` - MUST capture lessons |
7336
+ | **Command/tool error + fix** | \`session(action="capture_lesson", ...)\` - MUST capture lessons |
7423
7337
 
7424
7338
  **NO EXCEPTIONS.** Do not skip even if you think you have enough context.
7425
7339
 
7426
7340
  ---
7427
7341
 
7342
+ ## Consolidated Domain Tools Architecture
7343
+
7344
+ v0.4.x consolidates ~58 individual tools into ~11 domain tools with action/mode dispatch:
7345
+
7346
+ ### Standalone Tools (Always Call)
7347
+ - **\`session_init\`** - Initialize session with workspace detection + context
7348
+ - **\`context_smart\`** - Semantic search for relevant context (CALL EVERY MESSAGE)
7349
+
7350
+ ### Domain Tools (Use action/mode parameter)
7351
+
7352
+ | Domain | Actions/Modes | Example |
7353
+ |--------|---------------|---------|
7354
+ | **\`search\`** | mode: semantic, hybrid, keyword, pattern | \`search(mode="hybrid", query="auth implementation")\` |
7355
+ | **\`session\`** | action: capture, capture_lesson, get_lessons, recall, remember, user_context, summary, compress, delta, smart_search, decision_trace | \`session(action="capture", event_type="decision", title="Use JWT", content="...")\` |
7356
+ | **\`memory\`** | action: create_event, get_event, update_event, delete_event, list_events, distill_event, create_node, get_node, update_node, delete_node, list_nodes, supersede_node, search, decisions, timeline, summary | \`memory(action="list_events", limit=10)\` |
7357
+ | **\`graph\`** | action: dependencies, impact, call_path, related, path, decisions, ingest, circular_dependencies, unused_code, contradictions | \`graph(action="impact", symbol_name="AuthService")\` |
7358
+ | **\`project\`** | action: list, get, create, update, index, overview, statistics, files, index_status, ingest_local | \`project(action="statistics")\` |
7359
+ | **\`workspace\`** | action: list, get, associate, bootstrap | \`workspace(action="list")\` |
7360
+ | **\`reminder\`** | action: list, active, create, snooze, complete, dismiss | \`reminder(action="active")\` |
7361
+ | **\`integration\`** | provider: slack/github/all; action: status, search, stats, activity, contributors, knowledge, summary, channels, discussions, sync_users, repos, issues | \`integration(provider="github", action="search", query="...")\` |
7362
+ | **\`help\`** | action: tools, auth, version, editor_rules, enable_bundle | \`help(action="tools")\` |
7363
+
7364
+ ---
7365
+
7428
7366
  ### Why context_smart is Required (Even After session_init)
7429
7367
 
7430
7368
  **Common mistake:** "session_init already gave me context, I don't need context_smart"
@@ -7447,126 +7385,124 @@ You have access to ContextStream MCP tools for persistent memory and context.
7447
7385
 
7448
7386
  - For trivial/local edits: \`context_smart(..., max_tokens=200)\`
7449
7387
  - Default: \`context_smart(..., max_tokens=400)\`
7450
- - Deep debugging/architecture or heavy "what did we decide?": \`context_smart(..., max_tokens=800)\`
7451
- - Keep \`format="minified"\` (default) unless you're debugging tool output
7388
+ - Deep debugging/architecture: \`context_smart(..., max_tokens=800)\`
7389
+ - Keep \`format="minified"\` (default) unless debugging
7452
7390
 
7453
- If context still feels missing, increase \`max_tokens\` and/or call \`session_recall\` for a focused deep lookup.
7391
+ If context still feels missing, use \`session(action="recall", query="...")\` for focused deep lookup.
7454
7392
 
7455
7393
  ---
7456
7394
 
7457
7395
  ### Preferences & Lessons (Use Early)
7458
7396
 
7459
- - If preferences or style matter, call \`session_get_user_context\`.
7460
- - Before risky changes or when past mistakes may apply, call \`session_get_lessons(query="<topic>")\`.
7461
- - When frustration, corrections, or tool mistakes occur, immediately call \`session_capture_lesson\`.
7397
+ - If preferences/style matter: \`session(action="user_context")\`
7398
+ - Before risky changes: \`session(action="get_lessons", query="<topic>")\`
7399
+ - On frustration/corrections: \`session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")\`
7462
7400
 
7463
7401
  ---
7464
7402
 
7465
- ### Search, Graphs, and Code Intelligence (ContextStream-first)
7403
+ ### Search & Code Intelligence (ContextStream-first)
7404
+
7405
+ **Search order:**
7406
+ 1. \`session(action="smart_search", query="...")\` - context-enriched
7407
+ 2. \`search(mode="hybrid", query="...")\` - semantic + keyword
7408
+ 3. \`graph(action="dependencies", ...)\` - code structure
7409
+ 4. Local repo scans (rg/ls/find) - only if ContextStream returns no results
7466
7410
 
7467
- - Default order: \`session_smart_search\` -> \`search_hybrid\`/\`search_keyword\`/\`search_semantic\` -> graph tools -> local repo scans (rg/ls/find) only if ContextStream returns no results.
7468
- - Use \`session_smart_search\` before scanning the repo or grepping.
7469
- - Use \`search_semantic\`/\`search_hybrid\`/\`search_keyword\` for targeted queries.
7470
- - For dependencies/impact/call paths, use \`graph_dependencies\`, \`graph_impact\`, and \`graph_call_path\`.
7471
- - If the toolset is complete (Elite), prefer \`graph_call_path\` and \`graph_path\` for call relationships instead of manual searches.
7472
- - If the graph is missing or stale, run \`graph_ingest\` (async by default with \`wait: false\`). Tell the user it can take a few minutes; optionally call \`projects_statistics\` to estimate time.
7411
+ **Code Analysis:**
7412
+ - Dependencies: \`graph(action="dependencies", file_path="...")\`
7413
+ - Change impact: \`graph(action="impact", symbol_name="...")\`
7414
+ - Call path: \`graph(action="call_path", from_symbol="...", to_symbol="...")\`
7415
+ - Build graph: \`graph(action="ingest")\` - async, can take a few minutes
7473
7416
 
7474
7417
  ---
7475
7418
 
7476
7419
  ### Distillation & Memory Hygiene
7477
7420
 
7478
- - Use \`session_summary\` for a fast workspace snapshot.
7479
- - Use \`session_compress\` when the chat is long or context limits are near.
7480
- - Use \`memory_summary\` for recent work summaries and \`memory_distill_event\` to condense noisy memory entries.
7421
+ - Quick context: \`session(action="summary")\`
7422
+ - Long chat: \`session(action="compress", content="...")\`
7423
+ - Memory summary: \`memory(action="summary")\`
7424
+ - Condense noisy entries: \`memory(action="distill_event", event_id="...")\`
7481
7425
 
7482
7426
  ---
7483
7427
 
7484
7428
  ### When to Capture (MANDATORY)
7485
7429
 
7486
- | When | Tool | Example |
7430
+ | When | Call | Example |
7487
7431
  |------|------|---------|
7488
- | User makes a decision | \`session_capture\` | "Let's use PostgreSQL" -> capture as decision |
7489
- | User states preference | \`session_capture\` | "I prefer TypeScript" -> capture as preference |
7490
- | You complete a task | \`session_capture\` | Capture what was done, decisions made |
7491
- | Need past context | \`session_recall\` | "What did we decide about X?" |
7432
+ | User makes decision | \`session(action="capture", event_type="decision", ...)\` | "Let's use PostgreSQL" |
7433
+ | User states preference | \`session(action="capture", event_type="preference", ...)\` | "I prefer TypeScript" |
7434
+ | You complete a task | \`session(action="capture", event_type="task", ...)\` | Capture what was done |
7435
+ | Need past context | \`session(action="recall", query="...")\` | "What did we decide about X?" |
7492
7436
 
7493
7437
  **You MUST capture after completing any significant task.** This ensures future sessions have context.
7494
7438
 
7495
7439
  ---
7496
7440
 
7497
- ### Full Tool Catalog
7498
-
7499
- To expose all tools below, set \`CONTEXTSTREAM_TOOLSET=complete\` in your MCP config. The default (\`standard\`) includes the essential session, search, memory, and graph tools above.
7500
-
7501
- **To enable the complete toolset in your MCP config:**
7502
- \`\`\`json
7503
- {
7504
- "env": {
7505
- "CONTEXTSTREAM_TOOLSET": "complete"
7506
- }
7507
- }
7508
- \`\`\`
7509
-
7510
- **Available tool categories (when \`CONTEXTSTREAM_TOOLSET=complete\`):**
7511
-
7512
- **Session/Context** (included in standard):
7513
- \`session_init\`, \`context_smart\`, \`context_feedback\`, \`session_summary\`, \`session_capture\`, \`session_capture_lesson\`, \`session_get_lessons\`, \`session_recall\`, \`session_remember\`, \`session_get_user_context\`, \`session_smart_search\`, \`session_compress\`, \`session_delta\`, \`generate_editor_rules\`, \`workspace_associate\`, \`workspace_bootstrap\`
7514
-
7515
- **Workspaces**:
7516
- \`workspaces_list\`, \`workspaces_create\`, \`workspaces_update\`, \`workspaces_delete\`, \`workspaces_get\`, \`workspaces_overview\`, \`workspaces_analytics\`, \`workspaces_content\`
7517
-
7518
- **Projects**:
7519
- \`projects_list\`, \`projects_create\`, \`projects_update\`, \`projects_delete\`, \`projects_get\`, \`projects_overview\`, \`projects_statistics\`, \`projects_files\`, \`projects_index\`, \`projects_index_status\`, \`projects_ingest_local\`
7520
-
7521
- **Search**:
7522
- \`search_semantic\`, \`search_hybrid\`, \`search_keyword\`, \`search_pattern\`, \`search_suggestions\`
7523
-
7524
- **Memory**:
7525
- \`memory_create_event\`, \`memory_bulk_ingest\`, \`memory_list_events\`, \`memory_create_node\`, \`memory_list_nodes\`, \`memory_search\`, \`memory_decisions\`, \`decision_trace\`, \`memory_get_event\`, \`memory_update_event\`, \`memory_delete_event\`, \`memory_distill_event\`, \`memory_get_node\`, \`memory_update_node\`, \`memory_delete_node\`, \`memory_supersede_node\`, \`memory_timeline\`, \`memory_summary\`
7526
-
7527
- **Graph** (code analysis):
7528
- \`graph_related\`, \`graph_path\`, \`graph_decisions\`, \`graph_dependencies\`, \`graph_call_path\`, \`graph_impact\`, \`graph_circular_dependencies\`, \`graph_unused_code\`, \`graph_ingest\`, \`graph_contradictions\`
7529
-
7530
- **AI** (PRO):
7531
- \`ai_context\`, \`ai_enhanced_context\`, \`ai_context_budget\`, \`ai_embeddings\`, \`ai_plan\`, \`ai_tasks\`
7532
-
7533
- **GitHub Integration** (PRO):
7534
- \`github_stats\`, \`github_repos\`, \`github_contributors\`, \`github_activity\`, \`github_issues\`, \`github_search\`, \`github_knowledge\`, \`github_summary\`
7535
-
7536
- **Slack Integration** (PRO):
7537
- \`slack_stats\`, \`slack_channels\`, \`slack_contributors\`, \`slack_activity\`, \`slack_discussions\`, \`slack_search\`, \`slack_sync_users\`, \`slack_knowledge\`, \`slack_summary\`
7538
-
7539
- **Cross-Source Integrations** (PRO):
7540
- \`integrations_status\`, \`integrations_search\`, \`integrations_summary\`, \`integrations_knowledge\`
7441
+ ### Complete Action Reference
7442
+
7443
+ **session actions:**
7444
+ - \`capture\` - Save decision/insight/task (requires: event_type, title, content)
7445
+ - \`capture_lesson\` - Save lesson from mistake (requires: title, category, trigger, impact, prevention)
7446
+ - \`get_lessons\` - Retrieve relevant lessons (optional: query, category, severity)
7447
+ - \`recall\` - Natural language memory recall (requires: query)
7448
+ - \`remember\` - Quick save to memory (requires: content)
7449
+ - \`user_context\` - Get user preferences/style
7450
+ - \`summary\` - Workspace summary
7451
+ - \`compress\` - Compress long conversation
7452
+ - \`delta\` - Changes since timestamp
7453
+ - \`smart_search\` - Context-enriched search
7454
+ - \`decision_trace\` - Trace decision provenance
7455
+
7456
+ **memory actions:**
7457
+ - Event CRUD: \`create_event\`, \`get_event\`, \`update_event\`, \`delete_event\`, \`list_events\`, \`distill_event\`
7458
+ - Node CRUD: \`create_node\`, \`get_node\`, \`update_node\`, \`delete_node\`, \`list_nodes\`, \`supersede_node\`
7459
+ - Query: \`search\`, \`decisions\`, \`timeline\`, \`summary\`
7460
+
7461
+ **graph actions:**
7462
+ - Analysis: \`dependencies\`, \`impact\`, \`call_path\`, \`related\`, \`path\`
7463
+ - Quality: \`circular_dependencies\`, \`unused_code\`, \`contradictions\`
7464
+ - Management: \`ingest\`, \`decisions\`
7541
7465
 
7542
7466
  See full documentation: https://contextstream.io/docs/mcp/tools
7543
7467
  `.trim();
7544
7468
  var CONTEXTSTREAM_RULES_MINIMAL = `
7545
- ## ContextStream (Standard)
7546
-
7547
- - First user message: \`session_init(folder_path="<cwd>", context_hint="<user_message>")\`, then answer.
7548
- - Every user message: \`context_smart(user_message="<user_message>", format="minified", max_tokens=400)\` BEFORE answering.
7549
- - Use \`max_tokens=200\` for trivial/local edits, \`max_tokens=800\` for deep debugging/architecture.
7550
- - Before risky/non-trivial work: check \`session_get_lessons(query="<topic>")\`; use \`session_get_user_context\` when preferences/style matter.
7551
- - For discovery: use \`session_smart_search\` first; use \`search_semantic\`/\`search_hybrid\`/\`search_keyword\` for targeted lookups; avoid local scans until ContextStream returns no results.
7552
- - For code intelligence: use \`graph_dependencies\`/\`graph_impact\`/\`graph_call_path\`; if the toolset is complete (Elite), prefer \`graph_call_path\`/\`graph_path\` for call relationships; run \`graph_ingest\` if the graph is missing (async by default, can take a few minutes).
7553
- - For distillation: use \`session_summary\` for quick context; use \`session_compress\` for long chats; use \`memory_summary\` or \`memory_distill_event\` to condense memory.
7554
- - After meaningful work/decisions/preferences: \`session_capture(event_type=decision|preference|task|insight, title="...", content="...")\`.
7555
- - On frustration/corrections/tool mistakes: \`session_capture_lesson(...)\`.
7469
+ ## ContextStream v0.4.x (Consolidated Domain Tools)
7556
7470
 
7557
- ### Tool Catalog
7471
+ v0.4.x uses ~11 consolidated domain tools for ~75% token reduction vs previous versions.
7558
7472
 
7559
- By default, the MCP server exposes the **standard** toolset (~58 tools). To expose fewer tools, set \`CONTEXTSTREAM_TOOLSET=light\`. To expose everything (~86 tools), set \`CONTEXTSTREAM_TOOLSET=complete\` in your MCP config:
7473
+ ### Required Every Message
7560
7474
 
7561
- \`\`\`json
7562
- {
7563
- "env": {
7564
- "CONTEXTSTREAM_TOOLSET": "complete"
7565
- }
7566
- }
7567
- \`\`\`
7568
-
7569
- Full tool reference: https://contextstream.io/docs/mcp/tools
7475
+ | Message | What to Call |
7476
+ |---------|--------------|
7477
+ | **1st message** | \`session_init(folder_path="<cwd>", context_hint="<user_message>")\` |
7478
+ | **2nd+ messages** | \`context_smart(user_message="<user_message>", format="minified", max_tokens=400)\` |
7479
+ | **Capture decisions** | \`session(action="capture", event_type="decision", title="...", content="...")\` |
7480
+ | **Before risky work** | \`session(action="get_lessons", query="<topic>")\` |
7481
+ | **On user frustration** | \`session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")\` |
7482
+
7483
+ ### Quick Reference: Domain Tools
7484
+
7485
+ | Tool | Common Usage |
7486
+ |------|--------------|
7487
+ | \`search\` | \`search(mode="semantic", query="...")\` \u2014 modes: semantic, hybrid, keyword, pattern |
7488
+ | \`session\` | \`session(action="capture", ...)\` \u2014 actions: capture, capture_lesson, get_lessons, recall, remember, user_context, summary, compress, delta, smart_search |
7489
+ | \`memory\` | \`memory(action="list_events", ...)\` \u2014 CRUD for events/nodes, search, decisions, timeline, summary |
7490
+ | \`graph\` | \`graph(action="dependencies", ...)\` \u2014 dependencies, impact, call_path, related, ingest |
7491
+ | \`project\` | \`project(action="list", ...)\` \u2014 list, get, create, update, index, statistics |
7492
+ | \`workspace\` | \`workspace(action="list", ...)\` \u2014 list, get, associate, bootstrap |
7493
+ | \`integration\` | \`integration(provider="github", action="search", ...)\` \u2014 GitHub/Slack integration |
7494
+ | \`help\` | \`help(action="tools")\` \u2014 tools, auth, version, editor_rules |
7495
+
7496
+ ### Behavior Rules
7497
+
7498
+ - **First message**: Always call \`session_init\` with context_hint
7499
+ - **Every message after**: Always call \`context_smart\` BEFORE responding (semantic search for relevant context)
7500
+ - **For discovery**: Use \`session(action="smart_search")\` or \`search(mode="hybrid")\` before local repo scans
7501
+ - **For code analysis**: Use \`graph(action="dependencies")\` or \`graph(action="impact")\` for call/dependency analysis
7502
+ - **After completing work**: Always capture decisions/insights with \`session(action="capture")\`
7503
+ - **On mistakes/corrections**: Immediately capture lessons with \`session(action="capture_lesson")\`
7504
+
7505
+ Full docs: https://contextstream.io/docs/mcp/tools
7570
7506
  `.trim();
7571
7507
  var TEMPLATES = {
7572
7508
  codex: {
@@ -15215,8 +15151,8 @@ function buildContextStreamMcpServer(params) {
15215
15151
  CONTEXTSTREAM_API_URL: params.apiUrl,
15216
15152
  CONTEXTSTREAM_API_KEY: params.apiKey
15217
15153
  };
15218
- if (params.toolset) {
15219
- env.CONTEXTSTREAM_TOOLSET = params.toolset;
15154
+ if (params.toolset === "router") {
15155
+ env.CONTEXTSTREAM_PROGRESSIVE_MODE = "true";
15220
15156
  }
15221
15157
  return {
15222
15158
  command: "npx",
@@ -15229,8 +15165,8 @@ function buildContextStreamVsCodeServer(params) {
15229
15165
  CONTEXTSTREAM_API_URL: params.apiUrl,
15230
15166
  CONTEXTSTREAM_API_KEY: params.apiKey
15231
15167
  };
15232
- if (params.toolset) {
15233
- env.CONTEXTSTREAM_TOOLSET = params.toolset;
15168
+ if (params.toolset === "router") {
15169
+ env.CONTEXTSTREAM_PROGRESSIVE_MODE = "true";
15234
15170
  }
15235
15171
  return {
15236
15172
  type: "stdio",
@@ -15312,7 +15248,7 @@ async function upsertCodexTomlConfig(filePath, params) {
15312
15248
  const existing = exists ? await fs5.readFile(filePath, "utf8").catch(() => "") : "";
15313
15249
  const marker = "[mcp_servers.contextstream]";
15314
15250
  const envMarker = "[mcp_servers.contextstream.env]";
15315
- const toolsetLine = params.toolset ? `CONTEXTSTREAM_TOOLSET = "${params.toolset}"
15251
+ const toolsetLine = params.toolset === "router" ? `CONTEXTSTREAM_PROGRESSIVE_MODE = "true"
15316
15252
  ` : "";
15317
15253
  const block = `
15318
15254
 
@@ -15602,19 +15538,16 @@ Created API key: ${maskedNewKey}
15602
15538
  console.log(`
15603
15539
  Detected plan: ${planLabel} (graph: ${graphTierLabel})`);
15604
15540
  console.log("\nMCP toolset (which tools to expose to the AI):");
15605
- console.log(" 1) Light \u2014 core session, project, and basic memory/graph tools (~31 tools)");
15606
- console.log(" Best for: Claude Code, faster responses, token-constrained environments");
15607
- console.log(" 2) Standard (recommended) \u2014 adds workspace, memory CRUD, graph analysis, search (~58 tools)");
15608
- console.log(" Best for: most users, full development workflow with memory + code analysis");
15609
- console.log(" 3) Complete \u2014 all tools including full graph + AI, GitHub, Slack integrations (~86 tools)");
15610
- console.log(" Best for: Elite users or power users needing full graph + integrations");
15541
+ console.log(" 1) Standard (recommended) \u2014 consolidated domain tools (~11 tools, ~75% token reduction)");
15542
+ console.log(" Best for: all users, full functionality with minimal token overhead");
15543
+ console.log(" Includes: session_init, context_smart + 9 domain tools (search, session, memory, graph, etc.)");
15544
+ console.log(" 2) Router \u2014 ultra-minimal with AI routing (~2 meta-tools)");
15545
+ console.log(" Best for: experimental, routes requests through session_init + context_smart only");
15611
15546
  console.log("");
15612
- console.log(" Note: Slack/GitHub tools are auto-hidden until you connect those integrations.");
15613
- console.log(" Tip: Elite users should choose Complete to unlock full graph tools.");
15614
- console.log(" Tip: Change later by setting CONTEXTSTREAM_TOOLSET=light|standard|complete");
15615
- const toolsetDefault = detectedGraphTier === "full" ? "3" : "2";
15616
- const toolsetChoice = normalizeInput(await rl.question(`Choose [1/2/3] (default ${toolsetDefault}): `)) || toolsetDefault;
15617
- const toolset = toolsetChoice === "1" ? "light" : toolsetChoice === "3" ? "complete" : "standard";
15547
+ console.log(" Note: v0.4.x uses consolidated domain tools by default for ~75% token reduction.");
15548
+ console.log(" Tip: Change later by setting CONTEXTSTREAM_CONSOLIDATED=true|false");
15549
+ const toolsetChoice = normalizeInput(await rl.question("Choose [1/2] (default 1): ")) || "1";
15550
+ const toolset = toolsetChoice === "2" ? "router" : "consolidated";
15618
15551
  const editors = ["codex", "claude", "cursor", "windsurf", "cline", "kilo", "roo", "aider"];
15619
15552
  console.log('\nSelect editors to configure (comma-separated numbers, or "all"):');
15620
15553
  editors.forEach((e, i) => console.log(` ${i + 1}) ${EDITOR_LABELS[e]}`));
@@ -15671,9 +15604,9 @@ Detected plan: ${planLabel} (graph: ${graphTierLabel})`);
15671
15604
  const mcpChoiceDefault = hasCodex && !hasProjectMcpEditors ? "1" : "3";
15672
15605
  const mcpChoice = normalizeInput(await rl.question(`Choose [${hasCodex && !hasProjectMcpEditors ? "1/2" : "1/2/3/4"}] (default ${mcpChoiceDefault}): `)) || mcpChoiceDefault;
15673
15606
  const mcpScope = mcpChoice === "2" && hasCodex && !hasProjectMcpEditors ? "skip" : mcpChoice === "4" ? "skip" : mcpChoice === "1" ? "global" : mcpChoice === "2" ? "project" : "both";
15674
- const mcpServer = toolset === "complete" ? buildContextStreamMcpServer({ apiUrl, apiKey, toolset: "complete" }) : buildContextStreamMcpServer({ apiUrl, apiKey });
15607
+ const mcpServer = buildContextStreamMcpServer({ apiUrl, apiKey, toolset });
15675
15608
  const mcpServerClaude = buildContextStreamMcpServer({ apiUrl, apiKey, toolset });
15676
- const vsCodeServer = toolset === "complete" ? buildContextStreamVsCodeServer({ apiUrl, apiKey, toolset: "complete" }) : buildContextStreamVsCodeServer({ apiUrl, apiKey });
15609
+ const vsCodeServer = buildContextStreamVsCodeServer({ apiUrl, apiKey, toolset });
15677
15610
  const needsGlobalMcpConfig = mcpScope === "global" || mcpScope === "both" || mcpScope === "project" && hasCodex;
15678
15611
  if (needsGlobalMcpConfig) {
15679
15612
  console.log("\nInstalling global MCP config...");
@@ -15687,8 +15620,7 @@ Detected plan: ${planLabel} (graph: ${graphTierLabel})`);
15687
15620
  console.log(`- ${EDITOR_LABELS[editor]}: would update ${filePath}`);
15688
15621
  continue;
15689
15622
  }
15690
- const codexParams = toolset === "complete" ? { apiUrl, apiKey, toolset: "complete" } : { apiUrl, apiKey };
15691
- const status = await upsertCodexTomlConfig(filePath, codexParams);
15623
+ const status = await upsertCodexTomlConfig(filePath, { apiUrl, apiKey, toolset });
15692
15624
  writeActions.push({ kind: "mcp-config", target: filePath, status });
15693
15625
  console.log(`- ${EDITOR_LABELS[editor]}: ${status} ${filePath}`);
15694
15626
  continue;
@@ -15721,7 +15653,8 @@ Detected plan: ${planLabel} (graph: ${graphTierLabel})`);
15721
15653
  }
15722
15654
  }
15723
15655
  console.log("- Claude Code: global MCP config is best done via `claude mcp add --transport stdio ...` (see docs).");
15724
- console.log(` macOS/Linux: claude mcp add --transport stdio contextstream --scope user --env CONTEXTSTREAM_API_URL=... --env CONTEXTSTREAM_API_KEY=... --env CONTEXTSTREAM_TOOLSET=${toolset} -- npx -y @contextstream/mcp-server`);
15656
+ const envHint = toolset === "router" ? " --env CONTEXTSTREAM_PROGRESSIVE_MODE=true" : "";
15657
+ console.log(` macOS/Linux: claude mcp add --transport stdio contextstream --scope user --env CONTEXTSTREAM_API_URL=... --env CONTEXTSTREAM_API_KEY=...${envHint} -- npx -y @contextstream/mcp-server`);
15725
15658
  console.log(" Windows (native): use `cmd /c npx -y @contextstream/mcp-server` after `--` if `npx` is not found.");
15726
15659
  continue;
15727
15660
  }
@@ -15925,17 +15858,16 @@ Applying to ${projects.length} project(s)...`);
15925
15858
  const skipped = writeActions.filter((a) => a.status === "skipped").length;
15926
15859
  const dry = writeActions.filter((a) => a.status === "dry-run").length;
15927
15860
  console.log(`Summary: ${created} created, ${updated} updated, ${appended} appended, ${skipped} skipped, ${dry} dry-run.`);
15928
- const toolsetDesc = toolset === "light" ? "~31 tools" : toolset === "complete" ? "~86 tools" : "~58 tools";
15861
+ const toolsetDesc = toolset === "router" ? "~2 meta-tools (router mode)" : "~11 domain tools (consolidated)";
15929
15862
  console.log(`Toolset: ${toolset} (${toolsetDesc})`);
15930
- console.log(`Auto-hide: Slack/GitHub tools hidden until integrations connected.`);
15863
+ console.log(`Token reduction: ~75% compared to previous versions.`);
15931
15864
  }
15932
15865
  console.log("\nNext steps:");
15933
15866
  console.log("- Restart your editor/CLI after changing MCP config or rules.");
15934
- console.log("- Prefer ContextStream search first: use session_smart_search (or mcp__contextstream__session_smart_search) before raw repo scans (rg/ls/find).");
15867
+ console.log("- v0.4.x uses consolidated domain tools by default (~11 tools vs ~58 in v0.3.x).");
15935
15868
  console.log("- If any tools require UI-based MCP setup (e.g. Cline/Kilo/Roo global), follow https://contextstream.io/docs/mcp.");
15936
- if (toolset === "complete") {
15937
- console.log("- For full graph tools, run graph_ingest once per project (async; can take a few minutes).");
15938
- console.log("- Note: Claude Code/Desktop may warn about large tool contexts. This is expected with the complete toolset.");
15869
+ if (toolset === "router") {
15870
+ console.log("- Router mode uses 2 meta-tools (session_init + context_smart) for ultra-minimal token usage.");
15939
15871
  }
15940
15872
  } finally {
15941
15873
  rl.close();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contextstream/mcp-server",
3
3
  "mcpName": "io.github.contextstreamio/mcp-server",
4
- "version": "0.4.2",
4
+ "version": "0.4.3",
5
5
  "description": "MCP server exposing ContextStream public API - code context, memory, search, and AI tools for developers",
6
6
  "type": "module",
7
7
  "license": "MIT",