@contextstream/mcp-server 0.4.30 → 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 (3) hide show
  1. package/README.md +460 -460
  2. package/dist/index.js +259 -46
  3. package/package.json +70 -70
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"
8227
8333
 
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="...")\`
8334
+ **When detected, immediately:**
8231
8335
 
8232
- To manage existing plans/tasks:
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
+ \`\`\`
8345
+
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
8352
+
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();
@@ -8603,6 +8752,12 @@ var TOOL_CATALOG = [
8603
8752
  { name: "tasks", hint: "breakdown" },
8604
8753
  { name: "embeddings", hint: "vectors" }
8605
8754
  ]
8755
+ },
8756
+ {
8757
+ name: "Notion",
8758
+ tools: [
8759
+ { name: "create_page", hint: "new-page" }
8760
+ ]
8606
8761
  }
8607
8762
  ];
8608
8763
  function generateToolCatalog(format = "grouped", category) {
@@ -9479,6 +9634,9 @@ var GITHUB_TOOLS = /* @__PURE__ */ new Set([
9479
9634
  "github_knowledge",
9480
9635
  "github_summary"
9481
9636
  ]);
9637
+ var NOTION_TOOLS = /* @__PURE__ */ new Set([
9638
+ "notion_create_page"
9639
+ ]);
9482
9640
  var CROSS_INTEGRATION_TOOLS = /* @__PURE__ */ new Set([
9483
9641
  "integrations_status",
9484
9642
  "integrations_search",
@@ -9488,6 +9646,7 @@ var CROSS_INTEGRATION_TOOLS = /* @__PURE__ */ new Set([
9488
9646
  var ALL_INTEGRATION_TOOLS = /* @__PURE__ */ new Set([
9489
9647
  ...SLACK_TOOLS,
9490
9648
  ...GITHUB_TOOLS,
9649
+ ...NOTION_TOOLS,
9491
9650
  ...CROSS_INTEGRATION_TOOLS
9492
9651
  ]);
9493
9652
  var AUTO_HIDE_INTEGRATIONS = process.env.CONTEXTSTREAM_AUTO_HIDE_INTEGRATIONS !== "false";
@@ -9670,7 +9829,7 @@ var TOOL_BUNDLES = {
9670
9829
  "reminders_complete",
9671
9830
  "reminders_dismiss"
9672
9831
  ]),
9673
- // Integrations bundle - Slack/GitHub tools (auto-hidden when not connected)
9832
+ // Integrations bundle - Slack/GitHub/Notion tools (auto-hidden when not connected)
9674
9833
  integrations: /* @__PURE__ */ new Set([
9675
9834
  "slack_stats",
9676
9835
  "slack_channels",
@@ -9689,6 +9848,7 @@ var TOOL_BUNDLES = {
9689
9848
  "github_contributors",
9690
9849
  "github_knowledge",
9691
9850
  "github_summary",
9851
+ "notion_create_page",
9692
9852
  "integrations_status",
9693
9853
  "integrations_search",
9694
9854
  "integrations_summary",
@@ -10166,7 +10326,9 @@ function registerTools(server, client, sessionManager) {
10166
10326
  "github_contributors",
10167
10327
  "github_activity",
10168
10328
  "github_issues",
10169
- "github_search"
10329
+ "github_search",
10330
+ // Notion integration tools
10331
+ "notion_create_page"
10170
10332
  ]);
10171
10333
  const proTools = (() => {
10172
10334
  const raw = process.env.CONTEXTSTREAM_PRO_TOOLS;
@@ -14149,6 +14311,57 @@ Example prompts:
14149
14311
  };
14150
14312
  }
14151
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
+ );
14152
14365
  registerTool(
14153
14366
  "integrations_search",
14154
14367
  {
@@ -17150,7 +17363,7 @@ function registerPrompts(server) {
17150
17363
  "First:",
17151
17364
  "- If you can infer the project folder path from the environment/IDE roots, use it.",
17152
17365
  "- Otherwise ask me for an absolute folder path.",
17153
- "- 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.",
17154
17367
  "",
17155
17368
  "Then call `generate_rules` and confirm which files were created/updated.",
17156
17369
  "Ask if the user also wants to apply rules globally (pass apply_global: true)."
package/package.json CHANGED
@@ -1,70 +1,70 @@
1
- {
2
- "name": "@contextstream/mcp-server",
3
- "mcpName": "io.github.contextstreamio/mcp-server",
4
- "version": "0.4.30",
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
- "type": "module",
7
- "license": "MIT",
8
- "main": "dist/index.js",
9
- "files": [
10
- "dist",
11
- "README.md"
12
- ],
13
- "bin": {
14
- "contextstream-mcp": "dist/index.js"
15
- },
16
- "scripts": {
17
- "dev": "tsx src/index.ts",
18
- "build": "esbuild src/index.ts --bundle --platform=node --target=node18 --outfile=dist/index.js --format=esm --external:@modelcontextprotocol/sdk --banner:js=\"#!/usr/bin/env node\" && esbuild src/test-server.ts --bundle --platform=node --target=node18 --outfile=dist/test-server.js --format=esm --external:@modelcontextprotocol/sdk",
19
- "start": "node dist/index.js",
20
- "test-server": "tsx src/test-server.ts",
21
- "test-server:start": "node dist/test-server.js",
22
- "typecheck": "tsc --noEmit",
23
- "test": "vitest run",
24
- "test:watch": "vitest",
25
- "lint": "eslint src/",
26
- "lint:fix": "eslint src/ --fix",
27
- "format": "prettier --write src/",
28
- "format:check": "prettier --check src/"
29
- },
30
- "dependencies": {
31
- "@modelcontextprotocol/sdk": "^1.25.1",
32
- "zod": "^3.23.8"
33
- },
34
- "devDependencies": {
35
- "@eslint/js": "^9.39.2",
36
- "@types/node": "^20.10.0",
37
- "@typescript-eslint/eslint-plugin": "^8.52.0",
38
- "@typescript-eslint/parser": "^8.52.0",
39
- "esbuild": "^0.27.0",
40
- "eslint": "^9.39.2",
41
- "prettier": "^3.7.4",
42
- "tsx": "^4.15.4",
43
- "typescript": "^5.6.3",
44
- "typescript-eslint": "^8.52.0",
45
- "vitest": "^4.0.16"
46
- },
47
- "engines": {
48
- "node": ">=18"
49
- },
50
- "keywords": [
51
- "mcp",
52
- "model-context-protocol",
53
- "contextstream",
54
- "ai",
55
- "code-context",
56
- "memory",
57
- "knowledge-graph"
58
- ],
59
- "repository": {
60
- "type": "git",
61
- "url": "git+https://github.com/contextstream/mcp-server.git"
62
- },
63
- "homepage": "https://contextstream.io/docs/mcp",
64
- "bugs": {
65
- "url": "https://github.com/contextstream/mcp-server/issues"
66
- },
67
- "overrides": {
68
- "qs": "6.14.1"
69
- }
70
- }
1
+ {
2
+ "name": "@contextstream/mcp-server",
3
+ "mcpName": "io.github.contextstreamio/mcp-server",
4
+ "version": "0.4.31",
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
+ "type": "module",
7
+ "license": "MIT",
8
+ "main": "dist/index.js",
9
+ "files": [
10
+ "dist",
11
+ "README.md"
12
+ ],
13
+ "bin": {
14
+ "contextstream-mcp": "dist/index.js"
15
+ },
16
+ "scripts": {
17
+ "dev": "tsx src/index.ts",
18
+ "build": "esbuild src/index.ts --bundle --platform=node --target=node18 --outfile=dist/index.js --format=esm --external:@modelcontextprotocol/sdk --banner:js=\"#!/usr/bin/env node\" && esbuild src/test-server.ts --bundle --platform=node --target=node18 --outfile=dist/test-server.js --format=esm --external:@modelcontextprotocol/sdk",
19
+ "start": "node dist/index.js",
20
+ "test-server": "tsx src/test-server.ts",
21
+ "test-server:start": "node dist/test-server.js",
22
+ "typecheck": "tsc --noEmit",
23
+ "test": "vitest run",
24
+ "test:watch": "vitest",
25
+ "lint": "eslint src/",
26
+ "lint:fix": "eslint src/ --fix",
27
+ "format": "prettier --write src/",
28
+ "format:check": "prettier --check src/"
29
+ },
30
+ "dependencies": {
31
+ "@modelcontextprotocol/sdk": "^1.25.1",
32
+ "zod": "^3.23.8"
33
+ },
34
+ "devDependencies": {
35
+ "@eslint/js": "^9.39.2",
36
+ "@types/node": "^20.10.0",
37
+ "@typescript-eslint/eslint-plugin": "^8.52.0",
38
+ "@typescript-eslint/parser": "^8.52.0",
39
+ "esbuild": "^0.27.0",
40
+ "eslint": "^9.39.2",
41
+ "prettier": "^3.7.4",
42
+ "tsx": "^4.15.4",
43
+ "typescript": "^5.6.3",
44
+ "typescript-eslint": "^8.52.0",
45
+ "vitest": "^4.0.16"
46
+ },
47
+ "engines": {
48
+ "node": ">=18"
49
+ },
50
+ "keywords": [
51
+ "mcp",
52
+ "model-context-protocol",
53
+ "contextstream",
54
+ "ai",
55
+ "code-context",
56
+ "memory",
57
+ "knowledge-graph"
58
+ ],
59
+ "repository": {
60
+ "type": "git",
61
+ "url": "git+https://github.com/contextstream/mcp-server.git"
62
+ },
63
+ "homepage": "https://contextstream.io/docs/mcp",
64
+ "bugs": {
65
+ "url": "https://github.com/contextstream/mcp-server/issues"
66
+ },
67
+ "overrides": {
68
+ "qs": "6.14.1"
69
+ }
70
+ }