@contextstream/mcp-server 0.4.42 → 0.4.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 +33 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7689,6 +7689,7 @@ var ContextStreamClient = class {
7689
7689
  project_id: withDefaults.project_id,
7690
7690
  ...versionNotice2 ? { version_notice: versionNotice2 } : {},
7691
7691
  ...Array.isArray(data?.errors) ? { errors: data.errors } : {},
7692
+ ...Array.isArray(data?.warnings) && data.warnings.length > 0 ? { warnings: data.warnings } : {},
7692
7693
  ...this.indexRefreshInProgress ? { index_status: "refreshing" } : {},
7693
7694
  ...data?.context_pressure ? { context_pressure: data.context_pressure } : {}
7694
7695
  };
@@ -8995,6 +8996,7 @@ Rules Version: ${RULES_VERSION}
8995
8996
  | **Code search** | \`search(mode="hybrid", query="...")\` \u2014 BEFORE Glob/Grep/Read |
8996
8997
  | **After significant work** | \`session(action="capture", event_type="decision", ...)\` |
8997
8998
  | **User correction** | \`session(action="capture_lesson", ...)\` |
8999
+ | **\u26A0\uFE0F When warnings received** | **STOP**, acknowledge, explain mitigation, then proceed |
8998
9000
 
8999
9001
  **How to detect simple utility operations:**
9000
9002
  - Single-word commands: "list", "show", "version", "help"
@@ -9138,6 +9140,24 @@ session(action="capture", event_type="session_snapshot", title="Pre-compaction s
9138
9140
 
9139
9141
  **NEVER fall back to local tools (Glob/Grep/Read) just because search returned 0 results on first try.** Retry first.
9140
9142
 
9143
+ ### Enhanced Context (Server-Side Warnings)
9144
+
9145
+ \`context_smart\` now includes **intelligent server-side filtering** that proactively surfaces relevant warnings:
9146
+
9147
+ **Response fields:**
9148
+ - \`warnings\`: Array of warning strings (displayed with \u26A0\uFE0F prefix)
9149
+
9150
+ **What triggers warnings:**
9151
+ - **Lessons**: Past mistakes relevant to the current query (via semantic matching)
9152
+ - **Risky actions**: Detected high-risk operations (deployments, migrations, destructive commands)
9153
+ - **Breaking changes**: When modifications may impact other parts of the codebase
9154
+
9155
+ **When you receive warnings:**
9156
+ 1. **STOP** and read each warning carefully
9157
+ 2. **Acknowledge** the warning to the user
9158
+ 3. **Explain** how you will avoid the issue
9159
+ 4. Only proceed after addressing the warnings
9160
+
9141
9161
  ### Search & Code Intelligence (ContextStream-first)
9142
9162
 
9143
9163
  \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.
@@ -9395,6 +9415,11 @@ ContextStream search is **indexed** and returns semantic matches + context in ON
9395
9415
  - If \`context_smart\` returns high/critical \`context_pressure\`: call \`session(action="capture", ...)\` to save state
9396
9416
  - PreCompact hooks automatically save snapshots before compaction (if installed)
9397
9417
 
9418
+ ### Enhanced Context (Warnings)
9419
+
9420
+ \`context_smart\` returns server-side \`warnings\` for lessons, risky actions, and breaking changes.
9421
+ When warnings are present: **STOP**, acknowledge them, explain mitigation, then proceed.
9422
+
9398
9423
  ### Automatic Context Restoration
9399
9424
 
9400
9425
  **Context restoration is now enabled by default.** Every \`session_init\` call automatically:
@@ -16430,8 +16455,11 @@ The conversation may compact soon. Save important decisions, insights, and progr
16430
16455
  Action: ${cp.suggested_action === "prepare_save" ? "Consider saving important decisions and conversation state soon." : cp.suggested_action}`;
16431
16456
  }
16432
16457
  }
16458
+ const serverWarnings = result.warnings || [];
16459
+ const serverWarningsLine = serverWarnings.length > 0 ? "\n\n" + serverWarnings.map((w) => `\u26A0\uFE0F ${w}`).join("\n") : "";
16433
16460
  const allWarnings = [
16434
- lessonsWarningLine,
16461
+ serverWarningsLine || lessonsWarningLine,
16462
+ // Server warnings OR client-side lesson detection
16435
16463
  rulesWarningLine ? `
16436
16464
 
16437
16465
  ${rulesWarningLine}` : "",
@@ -17042,6 +17070,8 @@ Returns: the created page ID, URL, title, and timestamps.
17042
17070
  Use this to save notes, documentation, or any content to Notion.
17043
17071
  Supports Markdown content which is automatically converted to Notion blocks.
17044
17072
 
17073
+ IMPORTANT: If using parent_database_id, you MUST call integration(provider="notion", action="list_databases") FIRST to get valid database IDs. Do NOT use database IDs from memory or previous conversations - they may be stale or inaccessible.
17074
+
17045
17075
  Example prompts:
17046
17076
  - "Create a Notion page with today's meeting notes"
17047
17077
  - "Save this documentation to Notion"
@@ -17051,7 +17081,7 @@ Example prompts:
17051
17081
  project_id: external_exports.string().uuid().optional().describe("Project ID (uses session default if not provided). If provided, the memory event will be scoped to this project."),
17052
17082
  title: external_exports.string().describe("Page title"),
17053
17083
  content: external_exports.string().optional().describe("Page content in Markdown format"),
17054
- parent_database_id: external_exports.string().optional().describe("Parent database ID to create page in"),
17084
+ parent_database_id: external_exports.string().optional().describe("Parent database ID. MUST call integration(provider='notion', action='list_databases') first to get valid IDs - do NOT use IDs from memory"),
17055
17085
  parent_page_id: external_exports.string().optional().describe("Parent page ID to create page under")
17056
17086
  })
17057
17087
  },
@@ -19167,7 +19197,7 @@ ${formatContent(result)}`
19167
19197
  title: external_exports.string().optional().describe("Page/database title (for Notion create_page/update_page/create_database)"),
19168
19198
  content: external_exports.string().optional().describe("Page content in Markdown (for Notion create_page/update_page)"),
19169
19199
  description: external_exports.string().optional().describe("Database description (for Notion create_database)"),
19170
- parent_database_id: external_exports.string().optional().describe("Parent database ID (for Notion create_page)"),
19200
+ parent_database_id: external_exports.string().optional().describe("Parent database ID (for Notion create_page). MUST call list_databases first - do NOT use IDs from memory"),
19171
19201
  parent_page_id: external_exports.string().optional().describe("Parent page ID (for Notion create_page/create_database)"),
19172
19202
  page_id: external_exports.string().optional().describe("Page ID (for Notion get_page/update_page)"),
19173
19203
  database_id: external_exports.string().optional().describe("Database ID (for Notion query_database/search_pages/activity)"),
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.42",
4
+ "version": "0.4.43",
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",