@contextstream/mcp-server 0.3.24 → 0.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +45 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6504,6 +6504,20 @@ ${options.workspaceId ? `# Workspace ID: ${options.workspaceId}` : ""}
|
|
|
6504
6504
|
};
|
|
6505
6505
|
}
|
|
6506
6506
|
|
|
6507
|
+
// src/version.ts
|
|
6508
|
+
import { createRequire } from "module";
|
|
6509
|
+
function getVersion() {
|
|
6510
|
+
try {
|
|
6511
|
+
const require2 = createRequire(import.meta.url);
|
|
6512
|
+
const pkg = require2("../package.json");
|
|
6513
|
+
const version = pkg?.version;
|
|
6514
|
+
if (typeof version === "string" && version.trim()) return version.trim();
|
|
6515
|
+
} catch {
|
|
6516
|
+
}
|
|
6517
|
+
return "unknown";
|
|
6518
|
+
}
|
|
6519
|
+
var VERSION = getVersion();
|
|
6520
|
+
|
|
6507
6521
|
// src/tools.ts
|
|
6508
6522
|
function formatContent(data) {
|
|
6509
6523
|
return JSON.stringify(data, null, 2);
|
|
@@ -6624,6 +6638,18 @@ Upgrade: ${upgradeUrl2}` : "";
|
|
|
6624
6638
|
const ctx = sessionManager?.getContext();
|
|
6625
6639
|
return typeof ctx?.project_id === "string" ? ctx.project_id : void 0;
|
|
6626
6640
|
}
|
|
6641
|
+
registerTool(
|
|
6642
|
+
"mcp_server_version",
|
|
6643
|
+
{
|
|
6644
|
+
title: "Get MCP server version",
|
|
6645
|
+
description: "Return the running ContextStream MCP server package version",
|
|
6646
|
+
inputSchema: external_exports.object({})
|
|
6647
|
+
},
|
|
6648
|
+
async () => {
|
|
6649
|
+
const result = { name: "contextstream-mcp", version: VERSION };
|
|
6650
|
+
return { content: [{ type: "text", text: formatContent(result) }], structuredContent: toStructured(result) };
|
|
6651
|
+
}
|
|
6652
|
+
);
|
|
6627
6653
|
registerTool(
|
|
6628
6654
|
"auth_me",
|
|
6629
6655
|
{
|
|
@@ -7557,9 +7583,12 @@ This does semantic search on the first message. You only need context_smart on s
|
|
|
7557
7583
|
const folderPath = typeof result.folder_path === "string" ? result.folder_path : typeof input.folder_path === "string" ? input.folder_path : "";
|
|
7558
7584
|
text = [
|
|
7559
7585
|
"Action required: no workspaces found for this account.",
|
|
7560
|
-
"Ask the user for a name for the new workspace, then run `workspace_bootstrap`.",
|
|
7586
|
+
"Ask the user for a name for the new workspace (recommended), then run `workspace_bootstrap`.",
|
|
7561
7587
|
folderPath ? `Recommended: workspace_bootstrap(workspace_name: "<name>", folder_path: "${folderPath}")` : 'Recommended: workspace_bootstrap(workspace_name: "<name>", folder_path: "<your repo folder>")',
|
|
7562
7588
|
"",
|
|
7589
|
+
"If you want to continue without a workspace for now, re-run:",
|
|
7590
|
+
folderPath ? ` session_init(folder_path: "${folderPath}", allow_no_workspace: true)` : ' session_init(folder_path: "<your repo folder>", allow_no_workspace: true)',
|
|
7591
|
+
"",
|
|
7563
7592
|
"--- Raw Response ---",
|
|
7564
7593
|
"",
|
|
7565
7594
|
formatContent(result)
|
|
@@ -7582,6 +7611,13 @@ This does semantic search on the first message. You only need context_smart on s
|
|
|
7582
7611
|
lines.push("");
|
|
7583
7612
|
lines.push("Then run `workspace_associate` with the selected workspace_id and your folder_path.");
|
|
7584
7613
|
lines.push("");
|
|
7614
|
+
lines.push("If you want to continue without a workspace for now, re-run:");
|
|
7615
|
+
if (typeof input.folder_path === "string" && input.folder_path) {
|
|
7616
|
+
lines.push(` session_init(folder_path: "${input.folder_path}", allow_no_workspace: true)`);
|
|
7617
|
+
} else {
|
|
7618
|
+
lines.push(' session_init(folder_path: "<your repo folder>", allow_no_workspace: true)');
|
|
7619
|
+
}
|
|
7620
|
+
lines.push("");
|
|
7585
7621
|
lines.push("--- Raw Response ---");
|
|
7586
7622
|
lines.push("");
|
|
7587
7623
|
lines.push(formatContent(result));
|
|
@@ -9413,7 +9449,7 @@ var SessionManager = class {
|
|
|
9413
9449
|
parts.push("\u26A0\uFE0F NO WORKSPACE FOUND");
|
|
9414
9450
|
parts.push(`Folder: ${context.folder_name || "unknown"}`);
|
|
9415
9451
|
parts.push("");
|
|
9416
|
-
parts.push("Please ask the user for a name for the new workspace.");
|
|
9452
|
+
parts.push("Please ask the user for a name for the new workspace (recommended).");
|
|
9417
9453
|
parts.push("Then create a project for this folder.");
|
|
9418
9454
|
parts.push("");
|
|
9419
9455
|
parts.push("Recommended: call `workspace_bootstrap` with:");
|
|
@@ -9424,6 +9460,9 @@ var SessionManager = class {
|
|
|
9424
9460
|
}
|
|
9425
9461
|
parts.push(' - workspace_name: "<user-provided name>"');
|
|
9426
9462
|
parts.push("");
|
|
9463
|
+
parts.push("To continue without a workspace for now:");
|
|
9464
|
+
parts.push(" - call `session_init` again with `allow_no_workspace: true`");
|
|
9465
|
+
parts.push("");
|
|
9427
9466
|
parts.push("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550");
|
|
9428
9467
|
return parts.join("\n");
|
|
9429
9468
|
}
|
|
@@ -9442,6 +9481,9 @@ var SessionManager = class {
|
|
|
9442
9481
|
parts.push(" \u2022 Or create a new workspace");
|
|
9443
9482
|
parts.push("");
|
|
9444
9483
|
parts.push("Use workspace_associate tool after user selects.");
|
|
9484
|
+
parts.push("");
|
|
9485
|
+
parts.push("To continue without a workspace for now:");
|
|
9486
|
+
parts.push(" - call `session_init` again with `allow_no_workspace: true`");
|
|
9445
9487
|
parts.push("\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550");
|
|
9446
9488
|
return parts.join("\n");
|
|
9447
9489
|
}
|
|
@@ -9521,7 +9563,6 @@ var SessionManager = class {
|
|
|
9521
9563
|
import { existsSync as existsSync2, mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
9522
9564
|
import { homedir } from "os";
|
|
9523
9565
|
import { join as join3 } from "path";
|
|
9524
|
-
var VERSION = "0.3.4";
|
|
9525
9566
|
function showFirstRunMessage() {
|
|
9526
9567
|
const configDir = join3(homedir(), ".contextstream");
|
|
9527
9568
|
const starShownFile = join3(configDir, ".star-shown");
|
|
@@ -9593,7 +9634,7 @@ async function main() {
|
|
|
9593
9634
|
registerTools(server, client, sessionManager);
|
|
9594
9635
|
registerResources(server, client, config.apiUrl);
|
|
9595
9636
|
registerPrompts(server);
|
|
9596
|
-
console.error(`ContextStream MCP server starting...`);
|
|
9637
|
+
console.error(`ContextStream MCP server v${VERSION} starting...`);
|
|
9597
9638
|
console.error(`API URL: ${config.apiUrl}`);
|
|
9598
9639
|
console.error(`Auth: ${config.apiKey ? "API Key" : config.jwt ? "JWT" : "None"}`);
|
|
9599
9640
|
console.error(`Auto-Context: ENABLED (context loads on first tool call)`);
|
package/package.json
CHANGED