@contextstream/mcp-server 0.3.43 → 0.3.44
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 +82 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7606,6 +7606,8 @@ var CORE_TOOLSET = /* @__PURE__ */ new Set([
|
|
|
7606
7606
|
"generate_editor_rules",
|
|
7607
7607
|
"workspace_associate",
|
|
7608
7608
|
"workspace_bootstrap",
|
|
7609
|
+
"projects_create",
|
|
7610
|
+
"projects_list",
|
|
7609
7611
|
"auth_me",
|
|
7610
7612
|
"mcp_server_version"
|
|
7611
7613
|
]);
|
|
@@ -7956,16 +7958,82 @@ Upgrade: ${upgradeUrl}` : "";
|
|
|
7956
7958
|
"projects_create",
|
|
7957
7959
|
{
|
|
7958
7960
|
title: "Create project",
|
|
7959
|
-
description:
|
|
7961
|
+
description: `Create a new project within a workspace.
|
|
7962
|
+
Use this when you need to create a project for a specific folder/codebase.
|
|
7963
|
+
If workspace_id is not provided, uses the current session's workspace.
|
|
7964
|
+
Optionally associates a local folder and generates AI editor rules.
|
|
7965
|
+
|
|
7966
|
+
Access: Free`,
|
|
7960
7967
|
inputSchema: external_exports.object({
|
|
7961
|
-
name: external_exports.string(),
|
|
7962
|
-
description: external_exports.string().optional(),
|
|
7963
|
-
workspace_id: external_exports.string().uuid().optional()
|
|
7968
|
+
name: external_exports.string().describe("Project name"),
|
|
7969
|
+
description: external_exports.string().optional().describe("Project description"),
|
|
7970
|
+
workspace_id: external_exports.string().uuid().optional().describe("Workspace ID (uses current session workspace if not provided)"),
|
|
7971
|
+
folder_path: external_exports.string().optional().describe("Optional: Local folder path to associate with this project"),
|
|
7972
|
+
generate_editor_rules: external_exports.boolean().optional().describe("Generate AI editor rules in folder_path (requires folder_path)")
|
|
7964
7973
|
})
|
|
7965
7974
|
},
|
|
7966
7975
|
async (input) => {
|
|
7967
|
-
const
|
|
7968
|
-
|
|
7976
|
+
const workspaceId = resolveWorkspaceId(input.workspace_id);
|
|
7977
|
+
if (!workspaceId) {
|
|
7978
|
+
return errorResult("Error: workspace_id is required. Please call session_init first or provide workspace_id explicitly.");
|
|
7979
|
+
}
|
|
7980
|
+
const result = await client.createProject({
|
|
7981
|
+
name: input.name,
|
|
7982
|
+
description: input.description,
|
|
7983
|
+
workspace_id: workspaceId
|
|
7984
|
+
});
|
|
7985
|
+
const projectData = result;
|
|
7986
|
+
let rulesGenerated = [];
|
|
7987
|
+
if (input.folder_path && projectData.id) {
|
|
7988
|
+
try {
|
|
7989
|
+
const configDir = path4.join(input.folder_path, ".contextstream");
|
|
7990
|
+
const configPath = path4.join(configDir, "config.json");
|
|
7991
|
+
if (!fs3.existsSync(configDir)) {
|
|
7992
|
+
fs3.mkdirSync(configDir, { recursive: true });
|
|
7993
|
+
}
|
|
7994
|
+
const config = {
|
|
7995
|
+
workspace_id: workspaceId,
|
|
7996
|
+
project_id: projectData.id,
|
|
7997
|
+
project_name: input.name
|
|
7998
|
+
};
|
|
7999
|
+
fs3.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
8000
|
+
if (input.generate_editor_rules) {
|
|
8001
|
+
for (const editor of getAvailableEditors()) {
|
|
8002
|
+
const rule = generateRuleContent(editor, {
|
|
8003
|
+
workspaceId,
|
|
8004
|
+
projectName: input.name
|
|
8005
|
+
});
|
|
8006
|
+
if (rule) {
|
|
8007
|
+
const filePath = path4.join(input.folder_path, rule.filename);
|
|
8008
|
+
try {
|
|
8009
|
+
let existingContent = "";
|
|
8010
|
+
try {
|
|
8011
|
+
existingContent = fs3.readFileSync(filePath, "utf-8");
|
|
8012
|
+
} catch {
|
|
8013
|
+
}
|
|
8014
|
+
if (!existingContent) {
|
|
8015
|
+
fs3.writeFileSync(filePath, rule.content);
|
|
8016
|
+
rulesGenerated.push(rule.filename);
|
|
8017
|
+
} else if (!existingContent.includes("ContextStream")) {
|
|
8018
|
+
fs3.writeFileSync(filePath, existingContent + "\n\n" + rule.content);
|
|
8019
|
+
rulesGenerated.push(rule.filename + " (appended)");
|
|
8020
|
+
}
|
|
8021
|
+
} catch {
|
|
8022
|
+
}
|
|
8023
|
+
}
|
|
8024
|
+
}
|
|
8025
|
+
}
|
|
8026
|
+
} catch (err) {
|
|
8027
|
+
console.error("[ContextStream] Failed to write project config:", err);
|
|
8028
|
+
}
|
|
8029
|
+
}
|
|
8030
|
+
const response = {
|
|
8031
|
+
...result,
|
|
8032
|
+
folder_path: input.folder_path,
|
|
8033
|
+
config_written: input.folder_path ? true : void 0,
|
|
8034
|
+
editor_rules_generated: rulesGenerated.length > 0 ? rulesGenerated : void 0
|
|
8035
|
+
};
|
|
8036
|
+
return { content: [{ type: "text", text: formatContent(response) }], structuredContent: toStructured(response) };
|
|
7969
8037
|
}
|
|
7970
8038
|
);
|
|
7971
8039
|
registerTool(
|
|
@@ -10697,9 +10765,9 @@ var SessionManager = class {
|
|
|
10697
10765
|
};
|
|
10698
10766
|
|
|
10699
10767
|
// src/index.ts
|
|
10700
|
-
import { existsSync as
|
|
10768
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
10701
10769
|
import { homedir as homedir3 } from "os";
|
|
10702
|
-
import { join as
|
|
10770
|
+
import { join as join7 } from "path";
|
|
10703
10771
|
|
|
10704
10772
|
// src/setup.ts
|
|
10705
10773
|
import * as fs5 from "node:fs/promises";
|
|
@@ -11543,14 +11611,14 @@ Applying to ${projects.length} project(s)...`);
|
|
|
11543
11611
|
|
|
11544
11612
|
// src/index.ts
|
|
11545
11613
|
function showFirstRunMessage() {
|
|
11546
|
-
const configDir =
|
|
11547
|
-
const starShownFile =
|
|
11548
|
-
if (
|
|
11614
|
+
const configDir = join7(homedir3(), ".contextstream");
|
|
11615
|
+
const starShownFile = join7(configDir, ".star-shown");
|
|
11616
|
+
if (existsSync3(starShownFile)) {
|
|
11549
11617
|
return;
|
|
11550
11618
|
}
|
|
11551
|
-
if (!
|
|
11619
|
+
if (!existsSync3(configDir)) {
|
|
11552
11620
|
try {
|
|
11553
|
-
|
|
11621
|
+
mkdirSync3(configDir, { recursive: true });
|
|
11554
11622
|
} catch {
|
|
11555
11623
|
return;
|
|
11556
11624
|
}
|
|
@@ -11563,7 +11631,7 @@ function showFirstRunMessage() {
|
|
|
11563
11631
|
console.error("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501");
|
|
11564
11632
|
console.error("");
|
|
11565
11633
|
try {
|
|
11566
|
-
|
|
11634
|
+
writeFileSync3(starShownFile, (/* @__PURE__ */ new Date()).toISOString());
|
|
11567
11635
|
} catch {
|
|
11568
11636
|
}
|
|
11569
11637
|
}
|
package/package.json
CHANGED