@contextstream/mcp-server 0.4.27 → 0.4.28

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 (3) hide show
  1. package/README.md +13 -4
  2. package/dist/index.js +60 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,10 +1,19 @@
1
1
  # ContextStream MCP Server
2
2
 
3
- Persistent memory, semantic search, and code intelligence for any MCP-compatible AI tool (Cursor, Claude Code, Windsurf, VS Code, Claude Desktop, Codex CLI, etc.).
3
+ **Get set up in 30 seconds (recommended):**
4
4
 
5
- ContextStream is a shared "brain" for AI-assisted development. It stores decisions, preferences, lessons, tasks, and project context — and lets your AI tools search and analyze your codebase with consistent context across sessions.
5
+ ```bash
6
+ npx -y @contextstream/mcp-server setup
7
+ ```
8
+
9
+ This wizard authenticates you, creates/stores an API key, installs editor rules, and writes MCP config files.
10
+
11
+ Persistent memory, semantic search, and code intelligence for any MCP-compatible AI tool (Cursor, Claude Code, Windsurf, VS Code, Claude Desktop, Codex CLI, etc.).
6
12
 
7
- **v0.4.x:** Consolidated domain tools (~11 tools) for **~75% lower tool-registry token overhead** vs previous versions.
13
+ **At a glance:**
14
+ - Shared "brain" for decisions, preferences, notes (including implementation notes), lessons, tasks, and project context.
15
+ - Search + analysis across sessions with consistent context (semantic/hybrid/keyword + graph tools).
16
+ - v0.4.x consolidated domain tools (~11 tools) for ~75% lower tool-registry token overhead vs previous versions.
8
17
 
9
18
  ---
10
19
 
@@ -45,7 +54,7 @@ MCP clients often inject the tool catalog into the model context. v0.4.x is desi
45
54
 
46
55
  - **Consolidated domain tools** (v0.4.x): short tool list with action/mode dispatch
47
56
  - Session-aware context loading (`session_init`, `context_smart`)
48
- - Memory capture + recall (decisions, preferences, lessons, tasks, bugs)
57
+ - Memory capture + recall (decisions, preferences, notes, implementation notes, lessons, tasks, bugs)
49
58
  - Code search (semantic, hybrid, keyword, pattern)
50
59
  - Knowledge graph + code analysis (dependencies, impact, call paths, circular deps, unused code)
51
60
  - Graph ingestion for full graph builds (`graph(action="ingest")`)
package/dist/index.js CHANGED
@@ -6256,6 +6256,8 @@ var ContextStreamClient = class {
6256
6256
  case "decision":
6257
6257
  case "insight":
6258
6258
  case "preference":
6259
+ case "note":
6260
+ case "implementation":
6259
6261
  apiEventType = "manual_note";
6260
6262
  tags.push(params.event_type);
6261
6263
  break;
@@ -7796,6 +7798,16 @@ function applyMcpToolPrefix(markdown, toolPrefix) {
7796
7798
  return markdown.replace(toolRegex, `${toolPrefix}$1`);
7797
7799
  }
7798
7800
  var CONTEXTSTREAM_RULES_FULL = `
7801
+ ## \u{1F6A8} CRITICAL RULE - READ EVERY TURN \u{1F6A8}
7802
+
7803
+ **BEFORE using Glob, Grep, Search, Read (for discovery), or Explore:**
7804
+ \`\`\`
7805
+ STOP \u2192 Call search(mode="hybrid", query="...") FIRST
7806
+ \`\`\`
7807
+ Only use local tools if ContextStream returns 0 results. This applies to EVERY search throughout the ENTIRE conversation, not just the first message.
7808
+
7809
+ ---
7810
+
7799
7811
  ## ContextStream v0.4.x Integration (Enhanced)
7800
7812
 
7801
7813
  You have access to ContextStream MCP tools for persistent memory and context.
@@ -7808,6 +7820,7 @@ Rules Version: ${RULES_VERSION}
7808
7820
  |---------|--------------|
7809
7821
  | **1st message** | \`session_init(folder_path="...", context_hint="<user's message>")\`, then \`context_smart(user_message="<user's message>", format="minified", max_tokens=400)\` |
7810
7822
  | **2nd+ messages** | \`context_smart(user_message="<user's message>", format="minified", max_tokens=400)\` |
7823
+ | **\u{1F50D} ANY code search** | \`search(mode="hybrid", query="...")\` \u2014 ALWAYS before Glob/Grep/Search/Read |
7811
7824
  | **Before risky/non-trivial work** | \`session(action="get_lessons", query="<topic>")\` |
7812
7825
  | **After completing task** | \`session(action="capture", event_type="decision", ...)\` - MUST capture |
7813
7826
  | **User frustration/correction** | \`session(action="capture_lesson", ...)\` - MUST capture lessons |
@@ -7944,6 +7957,11 @@ search(mode="hybrid", query="function implementation") \u2192 done (results incl
7944
7957
  - \`minimal\`: Compact format (60% savings) - use for refactoring
7945
7958
  - \`count\`: Match counts only (90% savings) - use for quick checks
7946
7959
 
7960
+ **When to use \`output_format=count\`:**
7961
+ - User asks "how many X" or "count of X" \u2192 \`search(..., output_format="count")\`
7962
+ - Checking if something exists \u2192 count > 0 is sufficient
7963
+ - Large exhaustive searches \u2192 get count first, then fetch if needed
7964
+
7947
7965
  **Search defaults:** \`search\` returns the top 3 results with compact snippets. Use \`limit\` + \`offset\` for pagination, and \`content_max_chars\` to expand snippets when needed.
7948
7966
 
7949
7967
  If ContextStream returns results, stop and use them. NEVER use local Search/Explore/Read unless you need exact code edits or ContextStream returned 0 results.
@@ -8023,6 +8041,16 @@ To manage existing plans/tasks:
8023
8041
  See full documentation: https://contextstream.io/docs/mcp/tools
8024
8042
  `.trim();
8025
8043
  var CONTEXTSTREAM_RULES_MINIMAL = `
8044
+ ## \u{1F6A8} CRITICAL RULE - READ EVERY TURN \u{1F6A8}
8045
+
8046
+ **BEFORE using Glob, Grep, Search, Read (for discovery), or Explore:**
8047
+ \`\`\`
8048
+ STOP \u2192 Call search(mode="hybrid", query="...") FIRST
8049
+ \`\`\`
8050
+ Only use local tools if ContextStream returns 0 results. This applies to EVERY search throughout the ENTIRE conversation, not just the first message.
8051
+
8052
+ ---
8053
+
8026
8054
  ## ContextStream v0.4.x (Consolidated Domain Tools)
8027
8055
 
8028
8056
  v0.4.x uses ~11 consolidated domain tools for ~75% token reduction vs previous versions.
@@ -8034,6 +8062,7 @@ Rules Version: ${RULES_VERSION}
8034
8062
  |---------|--------------|
8035
8063
  | **1st message** | \`session_init(folder_path="<cwd>", context_hint="<user_message>")\`, then \`context_smart(user_message="<user_message>", format="minified", max_tokens=400)\` |
8036
8064
  | **2nd+ messages** | \`context_smart(user_message="<user_message>", format="minified", max_tokens=400)\` |
8065
+ | **\u{1F50D} ANY code search** | \`search(mode="hybrid", query="...")\` \u2014 ALWAYS before Glob/Grep/Search/Read |
8037
8066
  | **Capture decisions** | \`session(action="capture", event_type="decision", title="...", content="...")\` |
8038
8067
  | **Before risky work** | \`session(action="get_lessons", query="<topic>")\` |
8039
8068
  | **On user frustration** | \`session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")\` |
@@ -8102,6 +8131,14 @@ Use \`output_format\` to reduce response size:
8102
8131
  - \`minimal\`: Compact format (60% savings) - use for refactoring
8103
8132
  - \`count\`: Match counts only (90% savings) - use for quick checks
8104
8133
 
8134
+ **When to use \`output_format=count\`:**
8135
+ - User asks "how many X" or "count of X" \u2192 \`search(..., output_format="count")\`
8136
+ - Checking if something exists \u2192 count > 0 is sufficient
8137
+ - Large exhaustive searches \u2192 get count first, then fetch if needed
8138
+
8139
+ **Example:** User asks "how many TODO comments?" \u2192
8140
+ \`search(mode="exhaustive", query="TODO", output_format="count")\` returns \`{total: 47}\` (not 47 full results)
8141
+
8105
8142
  ### Plans & Tasks
8106
8143
 
8107
8144
  When user asks to create a plan or implementation roadmap:
@@ -8427,6 +8464,8 @@ function normalizeUuid(value) {
8427
8464
  }
8428
8465
  var RULES_NOTICE_CACHE_TTL_MS = 10 * 60 * 1e3;
8429
8466
  var RULES_VERSION_REGEX = /Rules Version:\s*([0-9][0-9A-Za-z.\-]*)/i;
8467
+ var CONTEXTSTREAM_START_MARKER = "<!-- BEGIN ContextStream -->";
8468
+ var CONTEXTSTREAM_END_MARKER = "<!-- END ContextStream -->";
8430
8469
  var RULES_PROJECT_FILES = {
8431
8470
  codex: "AGENTS.md",
8432
8471
  claude: "CLAUDE.md",
@@ -8455,9 +8494,25 @@ function compareVersions2(v1, v2) {
8455
8494
  }
8456
8495
  return 0;
8457
8496
  }
8497
+ function extractRulesVersions(content) {
8498
+ const regex = new RegExp(RULES_VERSION_REGEX.source, "gi");
8499
+ return Array.from(content.matchAll(regex)).map((match) => match[1]?.trim()).filter((version) => Boolean(version));
8500
+ }
8501
+ function extractContextStreamMarkerBlock(content) {
8502
+ const startIdx = content.indexOf(CONTEXTSTREAM_START_MARKER);
8503
+ const endIdx = content.indexOf(CONTEXTSTREAM_END_MARKER);
8504
+ if (startIdx === -1 || endIdx === -1 || endIdx <= startIdx) {
8505
+ return null;
8506
+ }
8507
+ return content.slice(startIdx + CONTEXTSTREAM_START_MARKER.length, endIdx).trim();
8508
+ }
8458
8509
  function extractRulesVersion(content) {
8459
- const match = content.match(RULES_VERSION_REGEX);
8460
- return match?.[1]?.trim() ?? null;
8510
+ const markerBlock = extractContextStreamMarkerBlock(content);
8511
+ const candidates = markerBlock ? extractRulesVersions(markerBlock) : extractRulesVersions(content);
8512
+ if (candidates.length === 0) {
8513
+ return null;
8514
+ }
8515
+ return candidates.sort(compareVersions2).at(-1) ?? null;
8461
8516
  }
8462
8517
  function detectEditorFromClientName(clientName) {
8463
8518
  if (!clientName) return null;
@@ -8588,8 +8643,6 @@ function getRulesNotice(folderPath, clientName) {
8588
8643
  rulesNoticeCache.set(cacheKey, { checkedAt: Date.now(), notice });
8589
8644
  return notice;
8590
8645
  }
8591
- var CONTEXTSTREAM_START_MARKER = "<!-- BEGIN ContextStream -->";
8592
- var CONTEXTSTREAM_END_MARKER = "<!-- END ContextStream -->";
8593
8646
  var LEGACY_CONTEXTSTREAM_HINTS = [
8594
8647
  "contextstream integration",
8595
8648
  "contextstream v0.4",
@@ -11926,6 +11979,8 @@ Use this to persist decisions, insights, preferences, or important information.`
11926
11979
  "decision",
11927
11980
  "insight",
11928
11981
  "preference",
11982
+ "note",
11983
+ "implementation",
11929
11984
  "task",
11930
11985
  "bug",
11931
11986
  "feature",
@@ -13585,7 +13640,7 @@ Output formats: full (default, includes content), paths (file paths only - 80% t
13585
13640
  query: external_exports.string().optional().describe("Query for recall/search/lessons/decision_trace"),
13586
13641
  content: external_exports.string().optional().describe("Content for capture/remember/compress"),
13587
13642
  title: external_exports.string().optional().describe("Title for capture/capture_lesson/capture_plan"),
13588
- event_type: external_exports.enum(["decision", "preference", "insight", "task", "bug", "feature", "plan", "correction", "lesson", "warning", "frustration", "conversation"]).optional().describe("Event type for capture"),
13643
+ event_type: external_exports.enum(["decision", "preference", "insight", "note", "implementation", "task", "bug", "feature", "plan", "correction", "lesson", "warning", "frustration", "conversation"]).optional().describe("Event type for capture"),
13589
13644
  importance: external_exports.enum(["low", "medium", "high", "critical"]).optional(),
13590
13645
  tags: external_exports.array(external_exports.string()).optional(),
13591
13646
  // Lesson-specific
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.27",
4
+ "version": "0.4.28",
5
5
  "description": "ContextStream MCP server - v0.4.x with consolidated domain tools (~11 tools, ~75% token reduction). Code context, memory, search, and AI tools.",
6
6
  "type": "module",
7
7
  "license": "MIT",