@contextstream/mcp-server 0.3.26 → 0.3.27

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 +20 -10
  2. package/dist/index.js +4 -722
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,25 @@
2
2
 
3
3
  Persistent memory, semantic search, and code intelligence for any MCP-compatible AI tool.
4
4
 
5
- ContextStream is a shared brain for your AI workflows. It stores decisions, preferences, and lessons, and lets your AI tools search and analyze your codebase with consistent context across sessions.
5
+ ContextStream is a shared "brain" for your AI workflows. It stores decisions, preferences, and lessons, and lets your AI tools search and analyze your codebase with consistent context across sessions.
6
+
7
+ ## Just Ask
8
+
9
+ **You don't need to memorize tool names.** Just describe what you want and your AI uses the right ContextStream tools automatically:
10
+
11
+ | You say... | ContextStream does... |
12
+ |------------|----------------------|
13
+ | "session summary" | Gets a summary of your workspace context |
14
+ | "what did we decide about auth?" | Recalls past decisions about authentication |
15
+ | "remember we're using PostgreSQL" | Saves this to memory for future sessions |
16
+ | "search for payment code" | Searches your codebase semantically |
17
+ | "what depends on UserService?" | Analyzes code dependencies |
18
+
19
+ No special syntax. No commands to learn. Just ask.
20
+
21
+ > **Tip:** For best results, add the [recommended editor rules](https://contextstream.io/docs/quickstart) so your AI consistently calls `session_init` / `context_smart` automatically.
22
+
23
+ ![ContextStream in action](mcp.gif.gif)
6
24
 
7
25
  ## Features
8
26
 
@@ -111,13 +129,6 @@ If your account has no workspaces, ContextStream will prompt your AI assistant t
111
129
  - The current folder is created as a project inside that workspace
112
130
  - Recommended: call `workspace_bootstrap(workspace_name="...", folder_path="...")`
113
131
 
114
- ### Slash commands (prompts)
115
-
116
- Most MCP clients expose ContextStream prompts as `/contextstream:...` slash commands.
117
-
118
- - Prompts are parameter-free: selecting a command should immediately insert the template.
119
- - Templates avoid asking for workspace/project IDs and instead rely on `session_init` + session defaults.
120
-
121
132
  ## Free vs PRO tools
122
133
 
123
134
  Tools are labeled as `(Free)` or `(PRO)` in the MCP tool list.
@@ -128,8 +139,7 @@ Tools are labeled as `(Free)` or `(PRO)` in the MCP tool list.
128
139
 
129
140
  ## Troubleshooting
130
141
 
131
- - Prompts/tools not appearing: restart the client after editing MCP config; confirm Node 18+ is available to the client runtime.
132
- - Slash commands do nothing: update to the latest `@contextstream/mcp-server` and restart your MCP client (prompts are parameter-free and should insert immediately).
142
+ - Tools not appearing: restart the client after editing MCP config; confirm Node 18+ is available to the client runtime.
133
143
  - Unauthorized errors: verify `CONTEXTSTREAM_API_URL` and `CONTEXTSTREAM_API_KEY` (or `CONTEXTSTREAM_JWT`).
134
144
  - Wrong workspace/project: use `workspace_associate` to map the current repo folder to the correct workspace.
135
145
 
package/dist/index.js CHANGED
@@ -6529,7 +6529,7 @@ function toStructured(data) {
6529
6529
  return void 0;
6530
6530
  }
6531
6531
  function registerTools(server, client, sessionManager) {
6532
- const upgradeUrl2 = process.env.CONTEXTSTREAM_UPGRADE_URL || "https://contextstream.io/pricing";
6532
+ const upgradeUrl = process.env.CONTEXTSTREAM_UPGRADE_URL || "https://contextstream.io/pricing";
6533
6533
  const defaultProTools = /* @__PURE__ */ new Set([
6534
6534
  // AI endpoints (typically paid/credit-metered)
6535
6535
  "ai_context",
@@ -6558,7 +6558,7 @@ function registerTools(server, client, sessionManager) {
6558
6558
  return errorResult(
6559
6559
  [
6560
6560
  `Access denied: \`${toolName}\` requires ContextStream PRO.`,
6561
- `Upgrade: ${upgradeUrl2}`
6561
+ `Upgrade: ${upgradeUrl}`
6562
6562
  ].join("\n")
6563
6563
  );
6564
6564
  }
@@ -6596,7 +6596,7 @@ function registerTools(server, client, sessionManager) {
6596
6596
  title: `${config.title} (${accessLabel})`,
6597
6597
  description: `${config.description}
6598
6598
 
6599
- Access: ${accessLabel}${accessLabel === "PRO" ? ` (upgrade: ${upgradeUrl2})` : ""}`
6599
+ Access: ${accessLabel}${accessLabel === "PRO" ? ` (upgrade: ${upgradeUrl})` : ""}`
6600
6600
  };
6601
6601
  const safeHandler = async (input) => {
6602
6602
  try {
@@ -6609,7 +6609,7 @@ Access: ${accessLabel}${accessLabel === "PRO" ? ` (upgrade: ${upgradeUrl2})` : "
6609
6609
  const errorCode = error?.code || error?.status || "UNKNOWN_ERROR";
6610
6610
  const isPlanLimit = String(errorCode).toUpperCase() === "FORBIDDEN" && String(errorMessage).toLowerCase().includes("plan limit reached");
6611
6611
  const upgradeHint = isPlanLimit ? `
6612
- Upgrade: ${upgradeUrl2}` : "";
6612
+ Upgrade: ${upgradeUrl}` : "";
6613
6613
  const serializedError = new Error(
6614
6614
  `[${errorCode}] ${errorMessage}${upgradeHint}${errorDetails ? `: ${JSON.stringify(errorDetails)}` : ""}`
6615
6615
  );
@@ -8554,723 +8554,6 @@ function registerResources(server, client, apiUrl) {
8554
8554
  );
8555
8555
  }
8556
8556
 
8557
- // src/prompts.ts
8558
- var ID_NOTES = [
8559
- "Notes:",
8560
- "- If ContextStream is not initialized in this conversation, call `session_init` first (omit ids).",
8561
- "- Do not ask me for `workspace_id`/`project_id` \u2014 use session defaults or IDs returned by `session_init`.",
8562
- "- Prefer omitting IDs in tool calls when the tool supports defaults."
8563
- ];
8564
- var upgradeUrl = process.env.CONTEXTSTREAM_UPGRADE_URL || "https://contextstream.io/pricing";
8565
- var proPrompts = /* @__PURE__ */ new Set([
8566
- "build-context",
8567
- "generate-plan",
8568
- "generate-tasks",
8569
- "token-budget-context"
8570
- ]);
8571
- function promptAccessLabel(promptName) {
8572
- return proPrompts.has(promptName) ? "PRO" : "Free";
8573
- }
8574
- function registerPrompts(server) {
8575
- server.registerPrompt(
8576
- "explore-codebase",
8577
- {
8578
- title: `Explore Codebase (${promptAccessLabel("explore-codebase")})`,
8579
- description: "Get an overview of a project codebase structure and key components"
8580
- },
8581
- async () => ({
8582
- messages: [
8583
- {
8584
- role: "user",
8585
- content: {
8586
- type: "text",
8587
- text: [
8588
- "I want to understand the current codebase.",
8589
- "",
8590
- ...ID_NOTES,
8591
- "",
8592
- "Please help me by:",
8593
- "1. Use `projects_overview` to get a project summary (use session defaults; only pass `project_id` if required).",
8594
- "2. Use `projects_files` to identify key entry points.",
8595
- "3. If a focus area is clear from our conversation, prioritize it; otherwise ask me what to focus on.",
8596
- "4. Use `search_semantic` (and optionally `search_hybrid`) to find the most relevant files.",
8597
- "5. Summarize the architecture, major modules, and where to start editing."
8598
- ].join("\n")
8599
- }
8600
- }
8601
- ]
8602
- })
8603
- );
8604
- server.registerPrompt(
8605
- "capture-decision",
8606
- {
8607
- title: `Capture Decision (${promptAccessLabel("capture-decision")})`,
8608
- description: "Document an architectural or technical decision in workspace memory"
8609
- },
8610
- async () => ({
8611
- messages: [
8612
- {
8613
- role: "user",
8614
- content: {
8615
- type: "text",
8616
- text: [
8617
- "Please capture an architectural/technical decision in ContextStream memory.",
8618
- "",
8619
- ...ID_NOTES,
8620
- "",
8621
- "Instructions:",
8622
- "- If the decision is already described in this conversation, extract: title, context, decision, consequences/tradeoffs.",
8623
- "- If anything is missing, ask me 1\u20133 quick questions to fill the gaps.",
8624
- "- Then call `session_capture` with:",
8625
- ' - event_type: "decision"',
8626
- " - title: (short ADR title)",
8627
- " - content: a well-formatted ADR (Context, Decision, Consequences)",
8628
- ' - tags: include relevant tags (e.g., "adr", "architecture")',
8629
- ' - importance: "high"',
8630
- "",
8631
- "After capturing, confirm what was saved."
8632
- ].join("\n")
8633
- }
8634
- }
8635
- ]
8636
- })
8637
- );
8638
- server.registerPrompt(
8639
- "review-context",
8640
- {
8641
- title: `Code Review Context (${promptAccessLabel("review-context")})`,
8642
- description: "Build context for reviewing code changes"
8643
- },
8644
- async () => ({
8645
- messages: [
8646
- {
8647
- role: "user",
8648
- content: {
8649
- type: "text",
8650
- text: [
8651
- "I need context to review a set of code changes.",
8652
- "",
8653
- ...ID_NOTES,
8654
- "",
8655
- "First:",
8656
- "- If file paths and a short change description are not already in this conversation, ask me for them.",
8657
- "",
8658
- "Then build review context by:",
8659
- "1. Using `graph_dependencies` to find what depends on the changed areas.",
8660
- "2. Using `graph_impact` to assess potential blast radius.",
8661
- "3. Using `memory_search` to find related decisions/notes.",
8662
- "4. Using `search_semantic` to find related code patterns.",
8663
- "",
8664
- "Provide:",
8665
- "- What the files/components do",
8666
- "- What might be affected",
8667
- "- Relevant prior decisions/lessons",
8668
- "- Review checklist + risks to focus on"
8669
- ].join("\n")
8670
- }
8671
- }
8672
- ]
8673
- })
8674
- );
8675
- server.registerPrompt(
8676
- "investigate-bug",
8677
- {
8678
- title: `Investigate Bug (${promptAccessLabel("investigate-bug")})`,
8679
- description: "Build context for debugging an issue"
8680
- },
8681
- async () => ({
8682
- messages: [
8683
- {
8684
- role: "user",
8685
- content: {
8686
- type: "text",
8687
- text: [
8688
- "I want help investigating a bug.",
8689
- "",
8690
- ...ID_NOTES,
8691
- "",
8692
- "First:",
8693
- "- If the error/symptom is not already stated, ask me for the exact error message and what I expected vs what happened.",
8694
- "- If an affected area/component is not known, ask me where I noticed it.",
8695
- "",
8696
- "Then:",
8697
- "1. Use `search_semantic` to find code related to the error/symptom.",
8698
- "2. Use `search_pattern` to locate where similar errors are thrown or logged.",
8699
- "3. If you identify key functions, use `graph_call_path` to trace call flows.",
8700
- "4. Use `memory_search` to check if we have prior notes/bugs about this area.",
8701
- "",
8702
- "Return:",
8703
- "- Likely origin locations",
8704
- "- Call flow (if found)",
8705
- "- Related past context",
8706
- "- Suggested debugging steps"
8707
- ].join("\n")
8708
- }
8709
- }
8710
- ]
8711
- })
8712
- );
8713
- server.registerPrompt(
8714
- "explore-knowledge",
8715
- {
8716
- title: `Explore Knowledge Graph (${promptAccessLabel("explore-knowledge")})`,
8717
- description: "Navigate and understand the knowledge graph for a workspace"
8718
- },
8719
- async () => ({
8720
- messages: [
8721
- {
8722
- role: "user",
8723
- content: {
8724
- type: "text",
8725
- text: [
8726
- "Help me explore the knowledge captured in this workspace.",
8727
- "",
8728
- ...ID_NOTES,
8729
- "",
8730
- "Approach:",
8731
- "1. Use `memory_summary` for a high-level overview.",
8732
- "2. Use `memory_decisions` to see decision history (titles + a few key details).",
8733
- "3. Use `memory_list_nodes` to see available knowledge nodes.",
8734
- "4. If a starting topic is clear from the conversation, use `memory_search` for it.",
8735
- "5. Use `graph_related` on the most relevant nodes to expand connections.",
8736
- "",
8737
- "Provide:",
8738
- "- Key themes and topics",
8739
- "- Important decisions + rationale",
8740
- "- Suggested \u201Cnext nodes\u201D to explore"
8741
- ].join("\n")
8742
- }
8743
- }
8744
- ]
8745
- })
8746
- );
8747
- server.registerPrompt(
8748
- "onboard-to-project",
8749
- {
8750
- title: `Project Onboarding (${promptAccessLabel("onboard-to-project")})`,
8751
- description: "Generate onboarding context for a new team member"
8752
- },
8753
- async () => ({
8754
- messages: [
8755
- {
8756
- role: "user",
8757
- content: {
8758
- type: "text",
8759
- text: [
8760
- "Create an onboarding guide for a new team member joining this project.",
8761
- "",
8762
- ...ID_NOTES,
8763
- "",
8764
- "First:",
8765
- "- If the role is not specified, ask me what role they are onboarding into (backend, frontend, fullstack, etc.).",
8766
- "",
8767
- "Gather context:",
8768
- "1. Use `projects_overview` and `projects_statistics` for project summary.",
8769
- "2. Use `projects_files` to identify key entry points.",
8770
- "3. Use `memory_timeline` and `memory_decisions` to understand recent changes and architectural choices.",
8771
- "4. Use `search_semantic` to find READMEs/docs/setup instructions.",
8772
- "",
8773
- "Output:",
8774
- "- Project overview and purpose",
8775
- "- Tech stack + architecture map",
8776
- "- Key files/entry points relevant to the role",
8777
- "- Important decisions + rationale",
8778
- "- Recent changes/current focus",
8779
- "- Step-by-step getting started"
8780
- ].join("\n")
8781
- }
8782
- }
8783
- ]
8784
- })
8785
- );
8786
- server.registerPrompt(
8787
- "analyze-refactoring",
8788
- {
8789
- title: `Refactoring Analysis (${promptAccessLabel("analyze-refactoring")})`,
8790
- description: "Analyze a codebase for refactoring opportunities"
8791
- },
8792
- async () => ({
8793
- messages: [
8794
- {
8795
- role: "user",
8796
- content: {
8797
- type: "text",
8798
- text: [
8799
- "Analyze the codebase for refactoring opportunities.",
8800
- "",
8801
- ...ID_NOTES,
8802
- "",
8803
- "If a target area is obvious from our conversation, focus there; otherwise ask me what area to analyze.",
8804
- "",
8805
- "Please investigate:",
8806
- "1. `graph_circular_dependencies` (circular deps to break)",
8807
- "2. `graph_unused_code` (dead code to remove)",
8808
- "3. `search_pattern` (duplication patterns)",
8809
- "4. `projects_statistics` (high complexity hotspots)",
8810
- "",
8811
- "Provide a prioritized list with quick wins vs deeper refactors."
8812
- ].join("\n")
8813
- }
8814
- }
8815
- ]
8816
- })
8817
- );
8818
- server.registerPrompt(
8819
- "build-context",
8820
- {
8821
- title: `Build LLM Context (${promptAccessLabel("build-context")})`,
8822
- description: "Build comprehensive context for an LLM task"
8823
- },
8824
- async () => ({
8825
- messages: [
8826
- {
8827
- role: "user",
8828
- content: {
8829
- type: "text",
8830
- text: [
8831
- "Build comprehensive context for the task we are working on.",
8832
- "",
8833
- `Access: ${promptAccessLabel("build-context")}${promptAccessLabel("build-context") === "PRO" ? ` (upgrade: ${upgradeUrl})` : ""}`,
8834
- "",
8835
- ...ID_NOTES,
8836
- "",
8837
- "First:",
8838
- "- If the \u201Cquery\u201D is clear from the latest user request, use that.",
8839
- "- Otherwise ask me: \u201CWhat do you need context for?\u201D",
8840
- "",
8841
- "Then:",
8842
- "- Call `ai_enhanced_context` with include_code=true, include_docs=true, include_memory=true (omit IDs unless required).",
8843
- "- Synthesize the returned context into a short briefing with links/file paths and key decisions/risks."
8844
- ].join("\n")
8845
- }
8846
- }
8847
- ]
8848
- })
8849
- );
8850
- server.registerPrompt(
8851
- "smart-search",
8852
- {
8853
- title: `Smart Search (${promptAccessLabel("smart-search")})`,
8854
- description: "Search across memory, decisions, and code for a query"
8855
- },
8856
- async () => ({
8857
- messages: [
8858
- {
8859
- role: "user",
8860
- content: {
8861
- type: "text",
8862
- text: [
8863
- "Find the most relevant context for what I am asking about.",
8864
- "",
8865
- ...ID_NOTES,
8866
- "",
8867
- "First:",
8868
- "- If a query is clear from the conversation, use it.",
8869
- "- Otherwise ask me what I want to find.",
8870
- "",
8871
- "Then:",
8872
- "1. Use `session_smart_search` for the query.",
8873
- "2. If results are thin, follow up with `search_hybrid` and `memory_search`.",
8874
- "3. Return the top results with file paths/links and a short synthesis."
8875
- ].join("\n")
8876
- }
8877
- }
8878
- ]
8879
- })
8880
- );
8881
- server.registerPrompt(
8882
- "recall-context",
8883
- {
8884
- title: `Recall Context (${promptAccessLabel("recall-context")})`,
8885
- description: "Retrieve relevant past decisions and memory for a query"
8886
- },
8887
- async () => ({
8888
- messages: [
8889
- {
8890
- role: "user",
8891
- content: {
8892
- type: "text",
8893
- text: [
8894
- "Recall relevant past context (decisions, notes, lessons) for what I am asking about.",
8895
- "",
8896
- ...ID_NOTES,
8897
- "",
8898
- "First:",
8899
- "- If a recall query is clear from the conversation, use it.",
8900
- "- Otherwise ask me what topic I want to recall.",
8901
- "",
8902
- "Then:",
8903
- "- Use `session_recall` with the query (omit IDs unless required).",
8904
- "- Summarize the key points and any relevant decisions/lessons."
8905
- ].join("\n")
8906
- }
8907
- }
8908
- ]
8909
- })
8910
- );
8911
- server.registerPrompt(
8912
- "session-summary",
8913
- {
8914
- title: `Session Summary (${promptAccessLabel("session-summary")})`,
8915
- description: "Get a compact summary of workspace/project context"
8916
- },
8917
- async () => ({
8918
- messages: [
8919
- {
8920
- role: "user",
8921
- content: {
8922
- type: "text",
8923
- text: [
8924
- "Generate a compact, token-efficient summary of the current workspace/project context.",
8925
- "",
8926
- ...ID_NOTES,
8927
- "",
8928
- "Use `session_summary` (default max_tokens=500 unless I specify otherwise).",
8929
- "Then list:",
8930
- "- Top decisions (titles only)",
8931
- "- Any high-priority lessons to watch for"
8932
- ].join("\n")
8933
- }
8934
- }
8935
- ]
8936
- })
8937
- );
8938
- server.registerPrompt(
8939
- "capture-lesson",
8940
- {
8941
- title: `Capture Lesson (${promptAccessLabel("capture-lesson")})`,
8942
- description: "Record a lesson learned from an error or correction"
8943
- },
8944
- async () => ({
8945
- messages: [
8946
- {
8947
- role: "user",
8948
- content: {
8949
- type: "text",
8950
- text: [
8951
- "Capture a lesson learned so it is surfaced in future sessions.",
8952
- "",
8953
- ...ID_NOTES,
8954
- "",
8955
- "If the lesson details are not fully present in the conversation, ask me for:",
8956
- "- title (what to remember)",
8957
- "- severity (low|medium|high|critical, default medium)",
8958
- "- category (workflow|code_quality|verification|communication|project_specific)",
8959
- "- trigger (what caused it)",
8960
- "- impact (what went wrong)",
8961
- "- prevention (how to prevent it)",
8962
- "- keywords (optional)",
8963
- "",
8964
- "Then call `session_capture_lesson` with those fields and confirm it was saved."
8965
- ].join("\n")
8966
- }
8967
- }
8968
- ]
8969
- })
8970
- );
8971
- server.registerPrompt(
8972
- "capture-preference",
8973
- {
8974
- title: `Capture Preference (${promptAccessLabel("capture-preference")})`,
8975
- description: "Save a user preference to memory"
8976
- },
8977
- async () => ({
8978
- messages: [
8979
- {
8980
- role: "user",
8981
- content: {
8982
- type: "text",
8983
- text: [
8984
- "Save a user preference to ContextStream memory.",
8985
- "",
8986
- ...ID_NOTES,
8987
- "",
8988
- "If the preference is not explicit in the conversation, ask me what to remember.",
8989
- "",
8990
- "Then call `session_capture` with:",
8991
- '- event_type: "preference"',
8992
- "- title: (short title)",
8993
- "- content: (preference text)",
8994
- '- importance: "medium"'
8995
- ].join("\n")
8996
- }
8997
- }
8998
- ]
8999
- })
9000
- );
9001
- server.registerPrompt(
9002
- "capture-task",
9003
- {
9004
- title: `Capture Task (${promptAccessLabel("capture-task")})`,
9005
- description: "Capture an action item into memory"
9006
- },
9007
- async () => ({
9008
- messages: [
9009
- {
9010
- role: "user",
9011
- content: {
9012
- type: "text",
9013
- text: [
9014
- "Capture an action item into ContextStream memory.",
9015
- "",
9016
- ...ID_NOTES,
9017
- "",
9018
- "If the task is not explicit in the conversation, ask me what to capture.",
9019
- "",
9020
- "Then call `session_capture` with:",
9021
- '- event_type: "task"',
9022
- "- title: (short title)",
9023
- "- content: (task details)",
9024
- '- importance: "medium"'
9025
- ].join("\n")
9026
- }
9027
- }
9028
- ]
9029
- })
9030
- );
9031
- server.registerPrompt(
9032
- "capture-bug",
9033
- {
9034
- title: `Capture Bug (${promptAccessLabel("capture-bug")})`,
9035
- description: "Capture a bug report into workspace memory"
9036
- },
9037
- async () => ({
9038
- messages: [
9039
- {
9040
- role: "user",
9041
- content: {
9042
- type: "text",
9043
- text: [
9044
- "Capture a bug report in ContextStream memory.",
9045
- "",
9046
- ...ID_NOTES,
9047
- "",
9048
- "If details are missing, ask me for:",
9049
- "- title",
9050
- "- description",
9051
- "- steps to reproduce (optional)",
9052
- "- expected behavior (optional)",
9053
- "- actual behavior (optional)",
9054
- "",
9055
- "Then call `session_capture` with:",
9056
- '- event_type: "bug"',
9057
- "- title: (bug title)",
9058
- "- content: a well-formatted bug report (include all provided details)",
9059
- "- tags: component/area tags",
9060
- '- importance: "high"'
9061
- ].join("\n")
9062
- }
9063
- }
9064
- ]
9065
- })
9066
- );
9067
- server.registerPrompt(
9068
- "capture-feature",
9069
- {
9070
- title: `Capture Feature (${promptAccessLabel("capture-feature")})`,
9071
- description: "Capture a feature request into workspace memory"
9072
- },
9073
- async () => ({
9074
- messages: [
9075
- {
9076
- role: "user",
9077
- content: {
9078
- type: "text",
9079
- text: [
9080
- "Capture a feature request in ContextStream memory.",
9081
- "",
9082
- ...ID_NOTES,
9083
- "",
9084
- "If details are missing, ask me for:",
9085
- "- title",
9086
- "- description",
9087
- "- rationale (optional)",
9088
- "- acceptance criteria (optional)",
9089
- "",
9090
- "Then call `session_capture` with:",
9091
- '- event_type: "feature"',
9092
- "- title: (feature title)",
9093
- "- content: a well-formatted feature request",
9094
- "- tags: component/area tags",
9095
- '- importance: "medium"'
9096
- ].join("\n")
9097
- }
9098
- }
9099
- ]
9100
- })
9101
- );
9102
- server.registerPrompt(
9103
- "generate-plan",
9104
- {
9105
- title: `Generate Plan (${promptAccessLabel("generate-plan")})`,
9106
- description: "Generate a development plan from a description"
9107
- },
9108
- async () => ({
9109
- messages: [
9110
- {
9111
- role: "user",
9112
- content: {
9113
- type: "text",
9114
- text: [
9115
- "Generate a development plan for what I am trying to build/fix.",
9116
- "",
9117
- `Access: ${promptAccessLabel("generate-plan")}${promptAccessLabel("generate-plan") === "PRO" ? ` (upgrade: ${upgradeUrl})` : ""}`,
9118
- "",
9119
- ...ID_NOTES,
9120
- "",
9121
- "Use the most recent user request as the plan description. If unclear, ask me for a one-paragraph description.",
9122
- "",
9123
- "Then call `ai_plan` and present the plan as an ordered list with milestones and risks."
9124
- ].join("\n")
9125
- }
9126
- }
9127
- ]
9128
- })
9129
- );
9130
- server.registerPrompt(
9131
- "generate-tasks",
9132
- {
9133
- title: `Generate Tasks (${promptAccessLabel("generate-tasks")})`,
9134
- description: "Generate actionable tasks from a plan or description"
9135
- },
9136
- async () => ({
9137
- messages: [
9138
- {
9139
- role: "user",
9140
- content: {
9141
- type: "text",
9142
- text: [
9143
- "Generate actionable tasks for the work we are discussing.",
9144
- "",
9145
- `Access: ${promptAccessLabel("generate-tasks")}${promptAccessLabel("generate-tasks") === "PRO" ? ` (upgrade: ${upgradeUrl})` : ""}`,
9146
- "",
9147
- ...ID_NOTES,
9148
- "",
9149
- "If a plan_id exists in the conversation, use it. Otherwise use the latest user request as the description.",
9150
- "If granularity is not specified, default to medium.",
9151
- "",
9152
- "Call `ai_tasks` and return a checklist of tasks with acceptance criteria for each."
9153
- ].join("\n")
9154
- }
9155
- }
9156
- ]
9157
- })
9158
- );
9159
- server.registerPrompt(
9160
- "token-budget-context",
9161
- {
9162
- title: `Token-Budget Context (${promptAccessLabel("token-budget-context")})`,
9163
- description: "Get the most relevant context that fits within a token budget"
9164
- },
9165
- async () => ({
9166
- messages: [
9167
- {
9168
- role: "user",
9169
- content: {
9170
- type: "text",
9171
- text: [
9172
- "Build the most relevant context that fits within a token budget.",
9173
- "",
9174
- `Access: ${promptAccessLabel("token-budget-context")}${promptAccessLabel("token-budget-context") === "PRO" ? ` (upgrade: ${upgradeUrl})` : ""}`,
9175
- "",
9176
- ...ID_NOTES,
9177
- "",
9178
- "First:",
9179
- "- If a query is clear from the conversation, use it; otherwise ask me for a query.",
9180
- "- If max_tokens is not specified, ask me for a token budget (e.g., 500/1000/2000).",
9181
- "",
9182
- "Then call `ai_context_budget` and return the packed context plus a short note about what was included/excluded."
9183
- ].join("\n")
9184
- }
9185
- }
9186
- ]
9187
- })
9188
- );
9189
- server.registerPrompt(
9190
- "find-todos",
9191
- {
9192
- title: `Find TODOs (${promptAccessLabel("find-todos")})`,
9193
- description: "Scan the codebase for TODO/FIXME/HACK notes and summarize"
9194
- },
9195
- async () => ({
9196
- messages: [
9197
- {
9198
- role: "user",
9199
- content: {
9200
- type: "text",
9201
- text: [
9202
- "Scan the codebase for TODO/FIXME/HACK notes and summarize them.",
9203
- "",
9204
- ...ID_NOTES,
9205
- "",
9206
- "Use `search_pattern` with query `TODO|FIXME|HACK` (or a pattern inferred from the conversation).",
9207
- "Group results by file path, summarize themes, and propose a small prioritized cleanup list."
9208
- ].join("\n")
9209
- }
9210
- }
9211
- ]
9212
- })
9213
- );
9214
- server.registerPrompt(
9215
- "generate-editor-rules",
9216
- {
9217
- title: `Generate Editor Rules (${promptAccessLabel("generate-editor-rules")})`,
9218
- description: "Generate ContextStream AI rule files for your editor"
9219
- },
9220
- async () => ({
9221
- messages: [
9222
- {
9223
- role: "user",
9224
- content: {
9225
- type: "text",
9226
- text: [
9227
- "Generate ContextStream AI rule files for my editor.",
9228
- "",
9229
- ...ID_NOTES,
9230
- "",
9231
- "First:",
9232
- "- If you can infer the project folder path from the environment/IDE roots, use it.",
9233
- "- Otherwise ask me for an absolute folder path.",
9234
- "- Ask which editor(s) (windsurf,cursor,cline,kilo,roo,claude,aider) or default to all.",
9235
- "",
9236
- "Then call `generate_editor_rules` and confirm which files were created/updated."
9237
- ].join("\n")
9238
- }
9239
- }
9240
- ]
9241
- })
9242
- );
9243
- server.registerPrompt(
9244
- "index-local-repo",
9245
- {
9246
- title: `Index Local Repo (${promptAccessLabel("index-local-repo")})`,
9247
- description: "Ingest local files into ContextStream for indexing/search"
9248
- },
9249
- async () => ({
9250
- messages: [
9251
- {
9252
- role: "user",
9253
- content: {
9254
- type: "text",
9255
- text: [
9256
- "Ingest local files into ContextStream for indexing/search.",
9257
- "",
9258
- ...ID_NOTES,
9259
- "",
9260
- "First:",
9261
- "- Ask me for the local directory path to ingest if it is not already specified.",
9262
- "",
9263
- "Then:",
9264
- "- Call `projects_ingest_local` with the path (use session defaults for project, or the `project_id` returned by `session_init`).",
9265
- "- Explain how to monitor progress via `projects_index_status`."
9266
- ].join("\n")
9267
- }
9268
- }
9269
- ]
9270
- })
9271
- );
9272
- }
9273
-
9274
8557
  // src/session-manager.ts
9275
8558
  var SessionManager = class {
9276
8559
  constructor(server, client) {
@@ -9633,7 +8916,6 @@ async function main() {
9633
8916
  const sessionManager = new SessionManager(server, client);
9634
8917
  registerTools(server, client, sessionManager);
9635
8918
  registerResources(server, client, config.apiUrl);
9636
- registerPrompts(server);
9637
8919
  console.error(`ContextStream MCP server v${VERSION} starting...`);
9638
8920
  console.error(`API URL: ${config.apiUrl}`);
9639
8921
  console.error(`Auth: ${config.apiKey ? "API Key" : config.jwt ? "JWT" : "None"}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contextstream/mcp-server",
3
- "version": "0.3.26",
3
+ "version": "0.3.27",
4
4
  "description": "MCP server exposing ContextStream public API - code context, memory, search, and AI tools for developers",
5
5
  "type": "module",
6
6
  "license": "MIT",