@contextstream/mcp-server 0.4.25 → 0.4.26

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 +70 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5141,6 +5141,7 @@ var ContextStreamClient = class {
5141
5141
  body: {
5142
5142
  ...this.withDefaults(body),
5143
5143
  search_type: "semantic",
5144
+ output_format: body.output_format,
5144
5145
  filters: body.workspace_id ? {} : { file_types: [], languages: [], file_paths: [], exclude_paths: [], content_types: [], tags: [] }
5145
5146
  }
5146
5147
  });
@@ -5150,6 +5151,7 @@ var ContextStreamClient = class {
5150
5151
  body: {
5151
5152
  ...this.withDefaults(body),
5152
5153
  search_type: "hybrid",
5154
+ output_format: body.output_format,
5153
5155
  filters: body.workspace_id ? {} : { file_types: [], languages: [], file_paths: [], exclude_paths: [], content_types: [], tags: [] }
5154
5156
  }
5155
5157
  });
@@ -5159,6 +5161,7 @@ var ContextStreamClient = class {
5159
5161
  body: {
5160
5162
  ...this.withDefaults(body),
5161
5163
  search_type: "keyword",
5164
+ output_format: body.output_format,
5162
5165
  filters: body.workspace_id ? {} : { file_types: [], languages: [], file_paths: [], exclude_paths: [], content_types: [], tags: [] }
5163
5166
  }
5164
5167
  });
@@ -5168,6 +5171,7 @@ var ContextStreamClient = class {
5168
5171
  body: {
5169
5172
  ...this.withDefaults(body),
5170
5173
  search_type: "pattern",
5174
+ output_format: body.output_format,
5171
5175
  filters: body.workspace_id ? {} : { file_types: [], languages: [], file_paths: [], exclude_paths: [], content_types: [], tags: [] }
5172
5176
  }
5173
5177
  });
@@ -5182,6 +5186,7 @@ var ContextStreamClient = class {
5182
5186
  body: {
5183
5187
  ...this.withDefaults(body),
5184
5188
  search_type: "exhaustive",
5189
+ output_format: body.output_format,
5185
5190
  filters: body.workspace_id ? {} : { file_types: [], languages: [], file_paths: [], exclude_paths: [], content_types: [], tags: [] }
5186
5191
  }
5187
5192
  });
@@ -7888,6 +7893,18 @@ Only after this preflight, proceed with search/analysis below.
7888
7893
 
7889
7894
  \u26A0\uFE0F **STOP: Before using Search/Glob/Grep/Read/Explore** \u2192 Call \`search(mode="hybrid")\` FIRST. Use local tools ONLY if ContextStream returns 0 results.
7890
7895
 
7896
+ **\u274C WRONG workflow (wastes tokens, slow):**
7897
+ \`\`\`
7898
+ Grep "function" \u2192 Read file1.ts \u2192 Read file2.ts \u2192 Read file3.ts \u2192 finally understand
7899
+ \`\`\`
7900
+
7901
+ **\u2705 CORRECT workflow (fast, complete):**
7902
+ \`\`\`
7903
+ search(mode="hybrid", query="function implementation") \u2192 done (results include context)
7904
+ \`\`\`
7905
+
7906
+ **Why?** ContextStream search returns semantic matches + context + file locations in ONE call. Local tools require multiple round-trips.
7907
+
7891
7908
  **Search order:**
7892
7909
  1. \`session(action="smart_search", query="...")\` - context-enriched
7893
7910
  2. \`search(mode="hybrid", query="...", limit=3)\` or \`search(mode="keyword", query="<filename>", limit=3)\`
@@ -7895,6 +7912,22 @@ Only after this preflight, proceed with search/analysis below.
7895
7912
  4. \`graph(action="dependencies", ...)\` - code structure
7896
7913
  5. Local repo scans (rg/ls/find) - ONLY if ContextStream returns no results, errors, or the user explicitly asks
7897
7914
 
7915
+ **Search Mode Selection:**
7916
+
7917
+ | Need | Mode | Example |
7918
+ |------|------|---------|
7919
+ | Find code by meaning | \`hybrid\` | "authentication logic", "error handling" |
7920
+ | Exact string/symbol | \`keyword\` | "UserAuthService", "API_KEY" |
7921
+ | File patterns | \`pattern\` | "*.sql", "test_*.py" |
7922
+ | ALL matches (refactoring) | \`exhaustive\` | "oldFunctionName" (rename across codebase) |
7923
+ | Conceptual search | \`semantic\` | "how does caching work" |
7924
+
7925
+ **Token Efficiency:** Use \`output_format\` to reduce response size:
7926
+ - \`full\` (default): Full content for understanding code
7927
+ - \`paths\`: File paths only (80% token savings) - use for file listings
7928
+ - \`minimal\`: Compact format (60% savings) - use for refactoring
7929
+ - \`count\`: Match counts only (90% savings) - use for quick checks
7930
+
7898
7931
  **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.
7899
7932
 
7900
7933
  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.
@@ -8010,6 +8043,18 @@ Rules Version: ${RULES_VERSION}
8010
8043
 
8011
8044
  \u26A0\uFE0F **STOP: Before using Search/Glob/Grep/Read/Explore** \u2192 Call \`search(mode="hybrid")\` FIRST. Use local tools ONLY if ContextStream returns 0 results.
8012
8045
 
8046
+ **\u274C WRONG workflow (wastes tokens, slow):**
8047
+ \`\`\`
8048
+ Grep "function" \u2192 Read file1.ts \u2192 Read file2.ts \u2192 Read file3.ts \u2192 finally understand
8049
+ \`\`\`
8050
+
8051
+ **\u2705 CORRECT workflow (fast, complete):**
8052
+ \`\`\`
8053
+ search(mode="hybrid", query="function implementation") \u2192 done (results include context)
8054
+ \`\`\`
8055
+
8056
+ **Why?** ContextStream search returns semantic matches + context + file locations in ONE call. Local tools require multiple round-trips.
8057
+
8013
8058
  - **First message**: Call \`session_init\` with context_hint, then call \`context_smart\` before any other tool or response
8014
8059
  - **On [INGEST_RECOMMENDED]**: Ask the user if they want to enable semantic code search. Explain: "Indexing your codebase enables AI-powered code search, dependency analysis, and better context. This takes a few minutes." If user agrees, run the provided \`project(action="ingest_local")\` command.
8015
8060
  - **Every message after**: Always call \`context_smart\` BEFORE responding (semantic search for relevant context)
@@ -8022,6 +8067,24 @@ Rules Version: ${RULES_VERSION}
8022
8067
  - **After completing work**: Always capture decisions/insights with \`session(action="capture")\`
8023
8068
  - **On mistakes/corrections**: Immediately capture lessons with \`session(action="capture_lesson")\`
8024
8069
 
8070
+ ### Search Mode Selection
8071
+
8072
+ | Need | Mode | Example |
8073
+ |------|------|---------|
8074
+ | Find code by meaning | \`hybrid\` | "authentication logic", "error handling" |
8075
+ | Exact string/symbol | \`keyword\` | "UserAuthService", "API_KEY" |
8076
+ | File patterns | \`pattern\` | "*.sql", "test_*.py" |
8077
+ | ALL matches (refactoring) | \`exhaustive\` | "oldFunctionName" (rename across codebase) |
8078
+ | Conceptual search | \`semantic\` | "how does caching work" |
8079
+
8080
+ ### Token Efficiency
8081
+
8082
+ Use \`output_format\` to reduce response size:
8083
+ - \`full\` (default): Full content for understanding code
8084
+ - \`paths\`: File paths only (80% token savings) - use for file listings
8085
+ - \`minimal\`: Compact format (60% savings) - use for refactoring
8086
+ - \`count\`: Match counts only (90% savings) - use for quick checks
8087
+
8025
8088
  ### Plans & Tasks
8026
8089
 
8027
8090
  When user asks to create a plan or implementation roadmap:
@@ -10604,7 +10667,8 @@ Access: Free`,
10604
10667
  offset,
10605
10668
  content_max_chars: contentMax,
10606
10669
  context_lines: contextLines,
10607
- exact_match_boost: exactMatchBoost
10670
+ exact_match_boost: exactMatchBoost,
10671
+ output_format: input.output_format
10608
10672
  };
10609
10673
  }
10610
10674
  registerTool(
@@ -13432,7 +13496,9 @@ Use this to remove a reminder that is no longer relevant.`,
13432
13496
  "search",
13433
13497
  {
13434
13498
  title: "Search",
13435
- description: `Search workspace memory and knowledge. Modes: semantic (meaning-based), hybrid (semantic + keyword), keyword (exact match), pattern (regex), exhaustive (all matches like grep).`,
13499
+ description: `Search workspace memory and knowledge. Modes: semantic (meaning-based), hybrid (semantic + keyword), keyword (exact match), pattern (regex), exhaustive (all matches like grep).
13500
+
13501
+ Output formats: full (default, includes content), paths (file paths only - 80% token savings), minimal (compact - 60% savings), count (match counts only - 90% savings).`,
13436
13502
  inputSchema: external_exports.object({
13437
13503
  mode: external_exports.enum(["semantic", "hybrid", "keyword", "pattern", "exhaustive"]).describe("Search mode"),
13438
13504
  query: external_exports.string().describe("Search query"),
@@ -13442,7 +13508,8 @@ Use this to remove a reminder that is no longer relevant.`,
13442
13508
  offset: external_exports.number().optional().describe("Offset for pagination"),
13443
13509
  content_max_chars: external_exports.number().optional().describe("Max chars per result content (default: 400)"),
13444
13510
  context_lines: external_exports.number().min(0).max(10).optional().describe("Lines of context around matches (like grep -C)"),
13445
- exact_match_boost: external_exports.number().min(1).max(10).optional().describe("Boost factor for exact matches (default: 2.0)")
13511
+ exact_match_boost: external_exports.number().min(1).max(10).optional().describe("Boost factor for exact matches (default: 2.0)"),
13512
+ output_format: external_exports.enum(["full", "paths", "minimal", "count"]).optional().describe("Response format: full (default), paths (80% savings), minimal (60% savings), count (90% savings)")
13446
13513
  })
13447
13514
  },
13448
13515
  async (input) => {
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.25",
4
+ "version": "0.4.26",
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",