@contextstream/mcp-server 0.4.29 → 0.4.31

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 (4) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +44 -0
  3. package/dist/index.js +298 -49
  4. package/package.json +1 -1
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 ContextStream
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 ContextStream
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -270,6 +270,50 @@ CONTEXTSTREAM_API_URL = "https://api.contextstream.io"
270
270
  CONTEXTSTREAM_API_KEY = "YOUR_API_KEY"
271
271
  ```
272
272
 
273
+ ### Antigravity (Google)
274
+
275
+ Antigravity uses project-scoped `.mcp.json` files with the same format as Cursor/Claude Desktop:
276
+
277
+ **Project configuration (`.mcp.json` in project root):**
278
+
279
+ ```json
280
+ {
281
+ "mcpServers": {
282
+ "contextstream": {
283
+ "command": "npx",
284
+ "args": ["-y", "@contextstream/mcp-server"],
285
+ "env": {
286
+ "CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
287
+ "CONTEXTSTREAM_API_KEY": "YOUR_API_KEY"
288
+ }
289
+ }
290
+ }
291
+ }
292
+ ```
293
+
294
+ **Windows users:** Use `cmd /c npx` wrapper:
295
+
296
+ ```json
297
+ {
298
+ "mcpServers": {
299
+ "contextstream": {
300
+ "command": "cmd",
301
+ "args": ["/c", "npx", "-y", "@contextstream/mcp-server"],
302
+ "env": {
303
+ "CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
304
+ "CONTEXTSTREAM_API_KEY": "YOUR_API_KEY"
305
+ }
306
+ }
307
+ }
308
+ }
309
+ ```
310
+
311
+ After adding the config, access via the "..." menu → "MCP Servers" → "View raw config" to verify.
312
+
313
+ **Rules files:**
314
+ - Global rules: `~/.gemini/GEMINI.md`
315
+ - Workspace rules: `.agent/rules/contextstream.md`
316
+
273
317
  ---
274
318
 
275
319
  ## Tool Overview (v0.4.x Consolidated)
package/dist/index.js CHANGED
@@ -7774,6 +7774,28 @@ W:${wsHint}
7774
7774
  });
7775
7775
  }
7776
7776
  // ============================================
7777
+ // Notion Integration Methods
7778
+ // ============================================
7779
+ /**
7780
+ * Create a page in Notion
7781
+ */
7782
+ async createNotionPage(params) {
7783
+ const withDefaults = this.withDefaults(params || {});
7784
+ if (!withDefaults.workspace_id) {
7785
+ throw new Error("workspace_id is required for creating Notion pages");
7786
+ }
7787
+ return request(this.config, `/integrations/notion/pages`, {
7788
+ method: "POST",
7789
+ body: JSON.stringify({
7790
+ workspace_id: withDefaults.workspace_id,
7791
+ title: params.title,
7792
+ content: params.content,
7793
+ parent_database_id: params.parent_database_id,
7794
+ parent_page_id: params.parent_page_id
7795
+ })
7796
+ });
7797
+ }
7798
+ // ============================================
7777
7799
  // Reminder Methods
7778
7800
  // ============================================
7779
7801
  /**
@@ -8020,13 +8042,76 @@ function applyMcpToolPrefix(markdown, toolPrefix) {
8020
8042
  return markdown.replace(toolRegex, `${toolPrefix}$1`);
8021
8043
  }
8022
8044
  var CONTEXTSTREAM_RULES_FULL = `
8023
- ## \u{1F6A8} CRITICAL RULE - READ EVERY TURN \u{1F6A8}
8045
+ ## \u{1F6A8} CRITICAL RULE #1 - CONTEXTSTREAM SEARCH FIRST \u{1F6A8}
8024
8046
 
8025
- **BEFORE using Glob, Grep, Search, Read (for discovery), or Explore:**
8047
+ **BEFORE using Glob, Grep, Search, Read (for discovery), Explore, or ANY local file scanning:**
8026
8048
  \`\`\`
8027
8049
  STOP \u2192 Call search(mode="hybrid", query="...") FIRST
8028
8050
  \`\`\`
8029
- 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
+ **Claude Code users:** Your tool names are \`mcp__contextstream__search\`, \`mcp__contextstream__session_init\`, etc.
8053
+
8054
+ \u274C **NEVER DO THIS:**
8055
+ - \`Glob("**/*.ts")\` \u2192 Use \`search(mode="pattern", query="*.ts")\` instead
8056
+ - \`Grep("functionName")\` \u2192 Use \`search(mode="keyword", query="functionName")\` instead
8057
+ - \`Read(file)\` for discovery \u2192 Use \`search(mode="hybrid", query="...")\` instead
8058
+ - \`Task(subagent_type="Explore")\` \u2192 Use \`search(mode="hybrid")\` instead
8059
+
8060
+ \u2705 **ALWAYS DO THIS:**
8061
+ 1. \`search(mode="hybrid", query="what you're looking for")\`
8062
+ 2. Only use local tools (Glob/Grep/Read) if ContextStream returns **0 results**
8063
+ 3. Use Read ONLY for exact file edits after you know the file path
8064
+
8065
+ This applies to **EVERY search** throughout the **ENTIRE conversation**, not just the first message.
8066
+
8067
+ ---
8068
+
8069
+ ## \u{1F6A8} CRITICAL RULE #2 - AUTO-INDEXING \u{1F6A8}
8070
+
8071
+ **ContextStream auto-indexes your project on \`session_init\`.** You do NOT need to:
8072
+ - Ask the user to index
8073
+ - Manually trigger ingestion
8074
+ - Check index_status before every search
8075
+
8076
+ **When \`session_init\` returns \`indexing_status: "started"\` or \`"refreshing"\`:**
8077
+ - Background indexing is running automatically
8078
+ - Search results will be available within seconds to minutes
8079
+ - **DO NOT fall back to local tools** - wait for ContextStream search to work
8080
+ - If search returns 0 results initially, try again after a moment
8081
+
8082
+ **Only manually trigger indexing if:**
8083
+ - \`session_init\` returned \`ingest_recommendation.recommended: true\` (rare edge case)
8084
+ - User explicitly asks to re-index
8085
+
8086
+ ---
8087
+
8088
+ ## \u{1F6A8} CRITICAL RULE #3 - LESSONS (PAST MISTAKES) \u{1F6A8}
8089
+
8090
+ **Lessons are past mistakes that MUST inform your work.** Ignoring lessons leads to repeated failures.
8091
+
8092
+ ### On \`session_init\`:
8093
+ - Check for \`lessons\` and \`lessons_warning\` in the response
8094
+ - If present, **READ THEM IMMEDIATELY** before doing any work
8095
+ - These are high-priority lessons (critical/high severity) relevant to your context
8096
+ - **Apply the prevention steps** from each lesson to avoid repeating mistakes
8097
+
8098
+ ### On \`context_smart\`:
8099
+ - Check for any lessons in the returned context
8100
+ - Lessons may be included based on semantic relevance to the user's message
8101
+
8102
+ ### Before ANY Non-Trivial Work:
8103
+ **ALWAYS call \`session(action="get_lessons", query="<topic>")\`** where \`<topic>\` matches what you're about to do:
8104
+ - Before refactoring \u2192 \`session(action="get_lessons", query="refactoring")\`
8105
+ - Before API changes \u2192 \`session(action="get_lessons", query="API changes")\`
8106
+ - Before database work \u2192 \`session(action="get_lessons", query="database migrations")\`
8107
+ - Before deployments \u2192 \`session(action="get_lessons", query="deployment")\`
8108
+
8109
+ ### When Lessons Are Found:
8110
+ 1. **Summarize the lessons** to the user before proceeding
8111
+ 2. **Explicitly state how you will avoid the past mistakes**
8112
+ 3. If a lesson conflicts with the current approach, **warn the user**
8113
+
8114
+ **Failing to check lessons before risky work is a critical error.**
8030
8115
 
8031
8116
  ---
8032
8117
 
@@ -8040,17 +8125,20 @@ Rules Version: ${RULES_VERSION}
8040
8125
 
8041
8126
  | Message | What to Call |
8042
8127
  |---------|--------------|
8043
- | **1st message** | \`session_init(folder_path="...", context_hint="<user's message>")\`, then \`context_smart(user_message="<user's message>", format="minified", max_tokens=400)\` |
8128
+ | **1st message** | \`session_init(folder_path="...", context_hint="<user's message>")\`, then \`context_smart(...)\` |
8129
+ | **\u26A0\uFE0F After session_init** | **CHECK \`lessons\` field** - if present, read and apply them BEFORE any work |
8044
8130
  | **2nd+ messages** | \`context_smart(user_message="<user's message>", format="minified", max_tokens=400)\` |
8045
8131
  | **\u{1F50D} ANY code search** | \`search(mode="hybrid", query="...")\` \u2014 ALWAYS before Glob/Grep/Search/Read |
8046
- | **Before risky/non-trivial work** | \`session(action="get_lessons", query="<topic>")\` |
8132
+ | **\u26A0\uFE0F Before ANY risky work** | \`session(action="get_lessons", query="<topic>")\` \u2014 **MANDATORY, not optional** |
8047
8133
  | **After completing task** | \`session(action="capture", event_type="decision", ...)\` - MUST capture |
8048
8134
  | **User frustration/correction** | \`session(action="capture_lesson", ...)\` - MUST capture lessons |
8049
8135
  | **Command/tool error + fix** | \`session(action="capture_lesson", ...)\` - MUST capture lessons |
8050
8136
 
8051
8137
  **NO EXCEPTIONS.** Do not skip even if you think you have enough context.
8052
8138
 
8053
- **First message rule:** After \`session_init\`, always call \`context_smart\` before any other tool or response.
8139
+ **First message rule:** After \`session_init\`:
8140
+ 1. Check for \`lessons\` in response - if present, READ and SUMMARIZE them to user
8141
+ 2. Then call \`context_smart\` before any other tool or response
8054
8142
 
8055
8143
  **Context Pack (Pro+):** If enabled, use \`context_smart(..., mode="pack", distill=true)\` for code/file queries. If unavailable or disabled, omit \`mode\` and proceed with standard \`context_smart\` (the API will fall back).
8056
8144
 
@@ -8126,18 +8214,20 @@ If context still feels missing, use \`session(action="recall", query="...")\` fo
8126
8214
 
8127
8215
  ---
8128
8216
 
8129
- ### Index & Graph Preflight (REQUIRED for code/file search)
8217
+ ### Index Status (Auto-Managed)
8130
8218
 
8131
- Before searching files or code, confirm the project is indexed and the graph is available:
8219
+ **Indexing is automatic.** After \`session_init\`, the project is auto-indexed in the background.
8132
8220
 
8133
- 1. \`project(action="index_status")\` for the current project
8134
- 2. If missing/stale:
8135
- - Local repo: \`project(action="ingest_local", path="<cwd>")\`
8136
- - Otherwise: \`project(action="index")\`
8137
- 3. If graph queries are empty/unavailable: \`graph(action="ingest")\`
8138
- 4. If indexing is in progress, tell the user and wait; do not fall back to local scans.
8221
+ **You do NOT need to manually check index_status before every search.** Just use \`search()\`.
8139
8222
 
8140
- Only after this preflight, proceed with search/analysis below.
8223
+ **If search returns 0 results and you expected matches:**
8224
+ 1. Check if \`session_init\` returned \`indexing_status: "started"\` - indexing may still be in progress
8225
+ 2. Wait a moment and retry \`search()\`
8226
+ 3. Only as a last resort: \`project(action="index_status")\` to check
8227
+
8228
+ **Graph data:** If graph queries (\`dependencies\`, \`impact\`) return empty, run \`graph(action="ingest")\` once.
8229
+
8230
+ **NEVER fall back to local tools (Glob/Grep/Read) just because search returned 0 results on first try.** Retry first.
8141
8231
 
8142
8232
  ### Search & Code Intelligence (ContextStream-first)
8143
8233
 
@@ -8223,13 +8313,44 @@ If ContextStream returns results, stop and use them. NEVER use local Search/Expl
8223
8313
 
8224
8314
  ---
8225
8315
 
8226
- ### Plans & Tasks
8316
+ ### \u{1F6A8} Plans & Tasks - USE CONTEXTSTREAM, NOT FILE-BASED PLANS \u{1F6A8}
8317
+
8318
+ **CRITICAL: When the user requests planning, implementation plans, roadmaps, task breakdowns, or step-by-step approaches:**
8319
+
8320
+ \u274C **DO NOT** use built-in plan mode (EnterPlanMode tool)
8321
+ \u274C **DO NOT** write plans to markdown files or plan documents
8322
+ \u274C **DO NOT** ask "should I create a plan file?"
8323
+
8324
+ \u2705 **ALWAYS** use ContextStream's plan/task system instead
8325
+
8326
+ **Trigger phrases to detect (use ContextStream immediately):**
8327
+ - "create a plan", "make a plan", "plan this", "plan for"
8328
+ - "implementation plan", "roadmap", "milestones"
8329
+ - "break down", "breakdown", "break this into steps"
8330
+ - "what are the steps", "step by step", "outline the approach"
8331
+ - "task list", "todo list", "action items"
8332
+ - "how should we approach", "implementation strategy"
8333
+
8334
+ **When detected, immediately:**
8335
+
8336
+ 1. **Create the plan in ContextStream:**
8337
+ \`\`\`
8338
+ session(action="capture_plan", title="<descriptive title>", description="<what this plan accomplishes>", goals=["goal1", "goal2"], steps=[{id: "1", title: "Step 1", order: 1, description: "..."}, ...])
8339
+ \`\`\`
8340
+
8341
+ 2. **Create tasks for each step:**
8342
+ \`\`\`
8343
+ memory(action="create_task", title="<task title>", plan_id="<plan_id from step 1>", priority="high|medium|low", description="<detailed task description>")
8344
+ \`\`\`
8227
8345
 
8228
- When user asks to create a plan or implementation roadmap:
8229
- 1. Create plan: \`session(action="capture_plan", title="Plan Title", description="...", goals=["goal1", "goal2"], steps=[{id: "1", title: "Step 1", order: 1}, ...])\`
8230
- 2. Get plan_id from response, then create tasks: \`memory(action="create_task", title="Task Title", plan_id="<plan_id>", priority="high|medium|low", description="...")\`
8346
+ **Why ContextStream plans are better:**
8347
+ - Plans persist across sessions and are searchable
8348
+ - Tasks track status (pending/in_progress/completed/blocked)
8349
+ - Context is preserved with workspace/project association
8350
+ - Can be retrieved with \`session(action="get_plan", plan_id="...", include_tasks=true)\`
8351
+ - Future sessions can continue from where you left off
8231
8352
 
8232
- To manage existing plans/tasks:
8353
+ **Managing plans/tasks:**
8233
8354
  - List plans: \`session(action="list_plans")\`
8234
8355
  - Get plan with tasks: \`session(action="get_plan", plan_id="<uuid>", include_tasks=true)\`
8235
8356
  - List tasks: \`memory(action="list_tasks", plan_id="<uuid>")\` or \`memory(action="list_tasks")\` for all
@@ -8268,13 +8389,35 @@ To manage existing plans/tasks:
8268
8389
  See full documentation: https://contextstream.io/docs/mcp/tools
8269
8390
  `.trim();
8270
8391
  var CONTEXTSTREAM_RULES_MINIMAL = `
8271
- ## \u{1F6A8} CRITICAL RULE - READ EVERY TURN \u{1F6A8}
8392
+ ## \u{1F6A8} CRITICAL: CONTEXTSTREAM SEARCH FIRST \u{1F6A8}
8272
8393
 
8273
- **BEFORE using Glob, Grep, Search, Read (for discovery), or Explore:**
8394
+ **BEFORE using Glob, Grep, Search, Read (for discovery), Explore, or ANY local scanning:**
8274
8395
  \`\`\`
8275
8396
  STOP \u2192 Call search(mode="hybrid", query="...") FIRST
8276
8397
  \`\`\`
8277
- Only use local tools if ContextStream returns 0 results. This applies to EVERY search throughout the ENTIRE conversation, not just the first message.
8398
+
8399
+ **Claude Code:** Tools are \`mcp__contextstream__search\`, \`mcp__contextstream__session_init\`, etc.
8400
+
8401
+ \u274C **NEVER:** \`Glob\`, \`Grep\`, \`Read\` for discovery, \`Task(Explore)\`
8402
+ \u2705 **ALWAYS:** \`search(mode="hybrid", query="...")\` first, local tools ONLY if 0 results
8403
+
8404
+ ---
8405
+
8406
+ ## \u{1F6A8} AUTO-INDEXING \u{1F6A8}
8407
+
8408
+ **\`session_init\` auto-indexes your project.** No manual ingestion needed.
8409
+
8410
+ If \`indexing_status: "started"\`: Search will work shortly. **DO NOT fall back to local tools.**
8411
+
8412
+ ---
8413
+
8414
+ ## \u{1F6A8} LESSONS (PAST MISTAKES) - CRITICAL \u{1F6A8}
8415
+
8416
+ **After \`session_init\`:** Check for \`lessons\` field. If present, **READ and APPLY** before any work.
8417
+
8418
+ **Before ANY risky work:** \`session(action="get_lessons", query="<topic>")\` \u2014 **MANDATORY**
8419
+
8420
+ **When lessons found:** Summarize to user, state how you'll avoid past mistakes.
8278
8421
 
8279
8422
  ---
8280
8423
 
@@ -8287,11 +8430,12 @@ Rules Version: ${RULES_VERSION}
8287
8430
 
8288
8431
  | Message | What to Call |
8289
8432
  |---------|--------------|
8290
- | **1st message** | \`session_init(folder_path="<cwd>", context_hint="<user_message>")\`, then \`context_smart(user_message="<user_message>", format="minified", max_tokens=400)\` |
8433
+ | **1st message** | \`session_init(folder_path="<cwd>", context_hint="<user_message>")\`, then \`context_smart(...)\` |
8434
+ | **\u26A0\uFE0F After session_init** | **CHECK \`lessons\` field** \u2014 read and apply BEFORE any work |
8291
8435
  | **2nd+ messages** | \`context_smart(user_message="<user_message>", format="minified", max_tokens=400)\` |
8292
8436
  | **\u{1F50D} ANY code search** | \`search(mode="hybrid", query="...")\` \u2014 ALWAYS before Glob/Grep/Search/Read |
8437
+ | **\u26A0\uFE0F Before risky work** | \`session(action="get_lessons", query="<topic>")\` \u2014 **MANDATORY** |
8293
8438
  | **Capture decisions** | \`session(action="capture", event_type="decision", title="...", content="...")\` |
8294
- | **Before risky work** | \`session(action="get_lessons", query="<topic>")\` |
8295
8439
  | **On user frustration** | \`session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")\` |
8296
8440
 
8297
8441
  **Context Pack (Pro+):** If enabled, use \`context_smart(..., mode="pack", distill=true)\` for code/file queries. If unavailable or disabled, omit \`mode\` and proceed with standard \`context_smart\` (the API will fall back).
@@ -8327,17 +8471,16 @@ search(mode="hybrid", query="function implementation") \u2192 done (results incl
8327
8471
 
8328
8472
  **Why?** ContextStream search returns semantic matches + context + file locations in ONE call. Local tools require multiple round-trips.
8329
8473
 
8330
- - **First message**: Call \`session_init\` with context_hint, then call \`context_smart\` before any other tool or response
8331
- - **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.
8332
- - **Every message after**: Always call \`context_smart\` BEFORE responding (semantic search for relevant context)
8333
- - **Before searching files/code**: Check \`project(action="index_status")\`; if missing/stale run \`project(action="ingest_local", path="<cwd>")\` or \`project(action="index")\`, and use \`graph(action="ingest")\` if needed
8334
- - **For discovery**: Use \`session(action="smart_search")\` or \`search(mode="hybrid")\` \u2014 NEVER use local Glob/Grep/Read first
8335
- - **For file/function/config lookups**: Use \`search\`/\`graph\` first; only fall back to rg/ls/find if ContextStream returns no results
8336
- - **If ContextStream returns results**: Do NOT use local Search/Explore/Read; only open specific files when needed for exact edits
8337
- - **For code analysis**: Use \`graph(action="dependencies")\` or \`graph(action="impact")\` for call/dependency analysis
8474
+ - **First message**: Call \`session_init\` with context_hint, then \`context_smart\` before any other tool
8475
+ - **Every message**: Call \`context_smart\` BEFORE responding
8476
+ - **For discovery**: Use \`search(mode="hybrid")\` \u2014 **NEVER use local Glob/Grep/Read first**
8477
+ - **If search returns 0 results**: Retry once (indexing may be in progress), THEN try local tools
8478
+ - **For file lookups**: Use \`search\`/\`graph\` first; fall back to local ONLY if ContextStream returns nothing
8479
+ - **If ContextStream returns results**: Do NOT use local tools; Read ONLY for exact edits
8480
+ - **For code analysis**: \`graph(action="dependencies")\` or \`graph(action="impact")\`
8338
8481
  - **On [RULES_NOTICE]**: Use \`generate_rules()\` to update rules
8339
- - **After completing work**: Always capture decisions/insights with \`session(action="capture")\`
8340
- - **On mistakes/corrections**: Immediately capture lessons with \`session(action="capture_lesson")\`
8482
+ - **After completing work**: Capture with \`session(action="capture")\`
8483
+ - **On mistakes**: Capture with \`session(action="capture_lesson")\`
8341
8484
 
8342
8485
  ### Search Mode Selection
8343
8486
 
@@ -8371,20 +8514,26 @@ Use \`output_format\` to reduce response size:
8371
8514
  **Example:** User asks "how many TODO comments?" \u2192
8372
8515
  \`search(mode="exhaustive", query="TODO", output_format="count")\` returns \`{total: 47}\` (not 47 full results)
8373
8516
 
8374
- ### Plans & Tasks
8517
+ ### \u{1F6A8} Plans & Tasks - USE CONTEXTSTREAM, NOT FILE-BASED PLANS \u{1F6A8}
8518
+
8519
+ **CRITICAL: When user requests planning, implementation plans, roadmaps, or task breakdowns:**
8520
+
8521
+ \u274C **DO NOT** use built-in plan mode (EnterPlanMode) or write plan files
8522
+ \u2705 **ALWAYS** use ContextStream's plan/task system
8375
8523
 
8376
- When user asks to create a plan or implementation roadmap:
8377
- 1. Create plan: \`session(action="capture_plan", title="Plan Title", description="...", goals=["goal1", "goal2"], steps=[{id: "1", title: "Step 1", order: 1}, ...])\`
8378
- 2. Get plan_id from response, then create tasks: \`memory(action="create_task", title="Task Title", plan_id="<plan_id>", priority="high|medium|low", description="...")\`
8524
+ **Trigger phrases (use ContextStream immediately):**
8525
+ - "plan", "roadmap", "milestones", "break down", "steps", "task list", "implementation strategy"
8379
8526
 
8380
- To manage existing plans/tasks:
8527
+ **Create plans in ContextStream:**
8528
+ 1. \`session(action="capture_plan", title="...", description="...", goals=[...], steps=[{id: "1", title: "Step 1", order: 1}, ...])\`
8529
+ 2. \`memory(action="create_task", title="...", plan_id="<plan_id>", priority="high|medium|low", description="...")\`
8530
+
8531
+ **Manage plans/tasks:**
8381
8532
  - List plans: \`session(action="list_plans")\`
8382
8533
  - Get plan with tasks: \`session(action="get_plan", plan_id="<uuid>", include_tasks=true)\`
8383
8534
  - List tasks: \`memory(action="list_tasks", plan_id="<uuid>")\` or \`memory(action="list_tasks")\` for all
8384
8535
  - Update task status: \`memory(action="update_task", task_id="<uuid>", task_status="pending|in_progress|completed|blocked")\`
8385
- - Link task to plan: \`memory(action="update_task", task_id="<uuid>", plan_id="<plan_uuid>")\`
8386
- - Unlink task from plan: \`memory(action="update_task", task_id="<uuid>", plan_id=null)\`
8387
- - Delete: \`memory(action="delete_task", task_id="<uuid>")\` or \`memory(action="delete_event", event_id="<plan_uuid>")\`
8536
+ - Delete: \`memory(action="delete_task", task_id="<uuid>")\`
8388
8537
 
8389
8538
  Full docs: https://contextstream.io/docs/mcp/tools
8390
8539
  `.trim();
@@ -8447,6 +8596,13 @@ ${rules}
8447
8596
  # Add ContextStream guidance to conventions
8448
8597
  conventions: |
8449
8598
  ${rules.split("\n").map((line) => " " + line).join("\n")}
8599
+ `
8600
+ },
8601
+ antigravity: {
8602
+ filename: "GEMINI.md",
8603
+ description: "Google Antigravity AI rules",
8604
+ build: (rules) => `# Antigravity Agent Rules
8605
+ ${rules}
8450
8606
  `
8451
8607
  }
8452
8608
  };
@@ -8596,6 +8752,12 @@ var TOOL_CATALOG = [
8596
8752
  { name: "tasks", hint: "breakdown" },
8597
8753
  { name: "embeddings", hint: "vectors" }
8598
8754
  ]
8755
+ },
8756
+ {
8757
+ name: "Notion",
8758
+ tools: [
8759
+ { name: "create_page", hint: "new-page" }
8760
+ ]
8599
8761
  }
8600
8762
  ];
8601
8763
  function generateToolCatalog(format = "grouped", category) {
@@ -9472,6 +9634,9 @@ var GITHUB_TOOLS = /* @__PURE__ */ new Set([
9472
9634
  "github_knowledge",
9473
9635
  "github_summary"
9474
9636
  ]);
9637
+ var NOTION_TOOLS = /* @__PURE__ */ new Set([
9638
+ "notion_create_page"
9639
+ ]);
9475
9640
  var CROSS_INTEGRATION_TOOLS = /* @__PURE__ */ new Set([
9476
9641
  "integrations_status",
9477
9642
  "integrations_search",
@@ -9481,6 +9646,7 @@ var CROSS_INTEGRATION_TOOLS = /* @__PURE__ */ new Set([
9481
9646
  var ALL_INTEGRATION_TOOLS = /* @__PURE__ */ new Set([
9482
9647
  ...SLACK_TOOLS,
9483
9648
  ...GITHUB_TOOLS,
9649
+ ...NOTION_TOOLS,
9484
9650
  ...CROSS_INTEGRATION_TOOLS
9485
9651
  ]);
9486
9652
  var AUTO_HIDE_INTEGRATIONS = process.env.CONTEXTSTREAM_AUTO_HIDE_INTEGRATIONS !== "false";
@@ -9663,7 +9829,7 @@ var TOOL_BUNDLES = {
9663
9829
  "reminders_complete",
9664
9830
  "reminders_dismiss"
9665
9831
  ]),
9666
- // Integrations bundle - Slack/GitHub tools (auto-hidden when not connected)
9832
+ // Integrations bundle - Slack/GitHub/Notion tools (auto-hidden when not connected)
9667
9833
  integrations: /* @__PURE__ */ new Set([
9668
9834
  "slack_stats",
9669
9835
  "slack_channels",
@@ -9682,6 +9848,7 @@ var TOOL_BUNDLES = {
9682
9848
  "github_contributors",
9683
9849
  "github_knowledge",
9684
9850
  "github_summary",
9851
+ "notion_create_page",
9685
9852
  "integrations_status",
9686
9853
  "integrations_search",
9687
9854
  "integrations_summary",
@@ -10159,7 +10326,9 @@ function registerTools(server, client, sessionManager) {
10159
10326
  "github_contributors",
10160
10327
  "github_activity",
10161
10328
  "github_issues",
10162
- "github_search"
10329
+ "github_search",
10330
+ // Notion integration tools
10331
+ "notion_create_page"
10163
10332
  ]);
10164
10333
  const proTools = (() => {
10165
10334
  const raw = process.env.CONTEXTSTREAM_PRO_TOOLS;
@@ -14142,6 +14311,57 @@ Example prompts:
14142
14311
  };
14143
14312
  }
14144
14313
  );
14314
+ registerTool(
14315
+ "notion_create_page",
14316
+ {
14317
+ title: "Create Notion page",
14318
+ description: `Create a new page in a connected Notion workspace.
14319
+ Returns: the created page ID, URL, title, and timestamps.
14320
+ Use this to save notes, documentation, or any content to Notion.
14321
+ Supports Markdown content which is automatically converted to Notion blocks.
14322
+
14323
+ Example prompts:
14324
+ - "Create a Notion page with today's meeting notes"
14325
+ - "Save this documentation to Notion"
14326
+ - "Create a new page in my Notion workspace"`,
14327
+ inputSchema: external_exports.object({
14328
+ workspace_id: external_exports.string().uuid().optional().describe("Workspace ID (uses session default if not provided)"),
14329
+ title: external_exports.string().describe("Page title"),
14330
+ content: external_exports.string().optional().describe("Page content in Markdown format"),
14331
+ parent_database_id: external_exports.string().optional().describe("Parent database ID to create page in"),
14332
+ parent_page_id: external_exports.string().optional().describe("Parent page ID to create page under")
14333
+ })
14334
+ },
14335
+ async (input) => {
14336
+ const workspaceId = resolveWorkspaceId(input.workspace_id);
14337
+ if (!workspaceId) {
14338
+ return errorResult(
14339
+ "Error: workspace_id is required. Please call session_init first or provide workspace_id explicitly."
14340
+ );
14341
+ }
14342
+ const result = await client.createNotionPage({
14343
+ workspace_id: workspaceId,
14344
+ title: input.title,
14345
+ content: input.content,
14346
+ parent_database_id: input.parent_database_id,
14347
+ parent_page_id: input.parent_page_id
14348
+ });
14349
+ return {
14350
+ content: [
14351
+ {
14352
+ type: "text",
14353
+ text: `Page created successfully!
14354
+
14355
+ Title: ${result.title}
14356
+ URL: ${result.url}
14357
+ ID: ${result.id}
14358
+ Created: ${result.created_time}`
14359
+ }
14360
+ ],
14361
+ structuredContent: toStructured(result)
14362
+ };
14363
+ }
14364
+ );
14145
14365
  registerTool(
14146
14366
  "integrations_search",
14147
14367
  {
@@ -17143,7 +17363,7 @@ function registerPrompts(server) {
17143
17363
  "First:",
17144
17364
  "- If you can infer the project folder path from the environment/IDE roots, use it.",
17145
17365
  "- Otherwise ask me for an absolute folder path.",
17146
- "- Ask which editor(s) (windsurf,cursor,cline,kilo,roo,claude,aider) or default to all.",
17366
+ "- Ask which editor(s) (codex,windsurf,cursor,cline,kilo,roo,claude,aider,antigravity) or default to all.",
17147
17367
  "",
17148
17368
  "Then call `generate_rules` and confirm which files were created/updated.",
17149
17369
  "Ask if the user also wants to apply rules globally (pass apply_global: true)."
@@ -17874,10 +18094,11 @@ var EDITOR_LABELS = {
17874
18094
  cline: "Cline",
17875
18095
  kilo: "Kilo Code",
17876
18096
  roo: "Roo Code",
17877
- aider: "Aider"
18097
+ aider: "Aider",
18098
+ antigravity: "Antigravity (Google)"
17878
18099
  };
17879
18100
  function supportsProjectMcpConfig(editor) {
17880
- return editor === "cursor" || editor === "claude" || editor === "kilo" || editor === "roo";
18101
+ return editor === "cursor" || editor === "claude" || editor === "kilo" || editor === "roo" || editor === "antigravity";
17881
18102
  }
17882
18103
  function normalizeInput(value) {
17883
18104
  return value.trim();
@@ -18100,6 +18321,8 @@ function globalRulesPathForEditor(editor) {
18100
18321
  return path6.join(home, ".roo", "rules", "contextstream.md");
18101
18322
  case "aider":
18102
18323
  return path6.join(home, ".aider.conf.yml");
18324
+ case "antigravity":
18325
+ return path6.join(home, ".gemini", "GEMINI.md");
18103
18326
  case "cursor":
18104
18327
  return null;
18105
18328
  default:
@@ -18202,6 +18425,29 @@ async function isCursorInstalled() {
18202
18425
  }
18203
18426
  return anyPathExists(candidates);
18204
18427
  }
18428
+ async function isAntigravityInstalled() {
18429
+ const home = homedir4();
18430
+ const candidates = [path6.join(home, ".gemini")];
18431
+ if (process.platform === "darwin") {
18432
+ candidates.push("/Applications/Antigravity.app");
18433
+ candidates.push(path6.join(home, "Applications", "Antigravity.app"));
18434
+ candidates.push(path6.join(home, "Library", "Application Support", "Antigravity"));
18435
+ } else if (process.platform === "win32") {
18436
+ const localApp = process.env.LOCALAPPDATA;
18437
+ const programFiles = process.env.ProgramFiles;
18438
+ const programFilesX86 = process.env["ProgramFiles(x86)"];
18439
+ if (localApp) candidates.push(path6.join(localApp, "Programs", "Antigravity", "Antigravity.exe"));
18440
+ if (localApp) candidates.push(path6.join(localApp, "Antigravity", "Antigravity.exe"));
18441
+ if (programFiles) candidates.push(path6.join(programFiles, "Antigravity", "Antigravity.exe"));
18442
+ if (programFilesX86) candidates.push(path6.join(programFilesX86, "Antigravity", "Antigravity.exe"));
18443
+ } else {
18444
+ candidates.push("/usr/bin/antigravity");
18445
+ candidates.push("/usr/local/bin/antigravity");
18446
+ candidates.push("/opt/Antigravity");
18447
+ candidates.push("/opt/antigravity");
18448
+ }
18449
+ return anyPathExists(candidates);
18450
+ }
18205
18451
  async function isEditorInstalled(editor) {
18206
18452
  switch (editor) {
18207
18453
  case "codex":
@@ -18220,6 +18466,8 @@ async function isEditorInstalled(editor) {
18220
18466
  return isRooInstalled();
18221
18467
  case "aider":
18222
18468
  return isAiderInstalled();
18469
+ case "antigravity":
18470
+ return isAntigravityInstalled();
18223
18471
  default:
18224
18472
  return false;
18225
18473
  }
@@ -18734,7 +18982,8 @@ Detected plan: ${planLabel} (graph: ${graphTierLabel})`);
18734
18982
  "cline",
18735
18983
  "kilo",
18736
18984
  "roo",
18737
- "aider"
18985
+ "aider",
18986
+ "antigravity"
18738
18987
  ];
18739
18988
  console.log('\nSelect editors to configure (comma-separated numbers, or "all"):');
18740
18989
  editors.forEach((e, i) => console.log(` ${i + 1}) ${EDITOR_LABELS[e]}`));
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.29",
4
+ "version": "0.4.31",
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",