genjo-mcp-server 1.0.7 → 1.0.8
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/index.js +46 -17
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -30606,36 +30606,65 @@ async function install() {
|
|
|
30606
30606
|
}
|
|
30607
30607
|
} else {
|
|
30608
30608
|
console.warn(` \u26A0\uFE0F Claude Desktop configuration directory not found.`);
|
|
30609
|
-
|
|
30609
|
+
}
|
|
30610
|
+
const cursorMcpPath = path.join(homeDir, ".cursor", "mcp.json");
|
|
30611
|
+
console.log(`
|
|
30612
|
+
Checking Cursor MCP configuration at: ${cursorMcpPath}`);
|
|
30613
|
+
try {
|
|
30614
|
+
let cursorConfig = { mcpServers: {} };
|
|
30615
|
+
if (fs.existsSync(cursorMcpPath)) {
|
|
30616
|
+
const content = fs.readFileSync(cursorMcpPath, "utf-8");
|
|
30617
|
+
try {
|
|
30618
|
+
cursorConfig = JSON.parse(content);
|
|
30619
|
+
} catch (e) {
|
|
30620
|
+
console.warn(" \u26A0\uFE0F Existing Cursor config is invalid JSON.");
|
|
30621
|
+
}
|
|
30622
|
+
} else {
|
|
30623
|
+
fs.mkdirSync(path.dirname(cursorMcpPath), { recursive: true });
|
|
30624
|
+
}
|
|
30625
|
+
cursorConfig.mcpServers = cursorConfig.mcpServers || {};
|
|
30626
|
+
cursorConfig.mcpServers["genjo"] = {
|
|
30627
|
+
type: "command",
|
|
30628
|
+
command: "npx -y genjo-mcp-server",
|
|
30629
|
+
env: {
|
|
30630
|
+
GENJO_API_BASE_URL: process.env.GENJO_API_BASE_URL || "https://api.gen-jo.com"
|
|
30631
|
+
}
|
|
30632
|
+
};
|
|
30633
|
+
if (process.env.GENJO_API_KEY) {
|
|
30634
|
+
cursorConfig.mcpServers["genjo"].env["GENJO_API_KEY"] = process.env.GENJO_API_KEY;
|
|
30635
|
+
}
|
|
30636
|
+
fs.writeFileSync(cursorMcpPath, JSON.stringify(cursorConfig, null, 2));
|
|
30637
|
+
console.log(" \u2705 Successfully updated Cursor MCP configuration.");
|
|
30638
|
+
} catch (error48) {
|
|
30639
|
+
console.error(` \u274C Failed to update Cursor config: ${error48.message}`);
|
|
30610
30640
|
}
|
|
30611
30641
|
let sourceSkillsDir = path.join(__dirname, "genjo-news-skill");
|
|
30612
30642
|
if (!fs.existsSync(sourceSkillsDir)) {
|
|
30613
30643
|
sourceSkillsDir = path.join(process.cwd(), "src", "mcp", "genjo-news-skill");
|
|
30614
30644
|
}
|
|
30615
30645
|
const targetSkillsDir = path.join(process.cwd(), ".claude", "skills", "genjo-news-skill");
|
|
30616
|
-
|
|
30617
|
-
Installing Agent Skills to: ${targetSkillsDir}`);
|
|
30646
|
+
const targetRulesDir = path.join(process.cwd(), ".cursor", "rules");
|
|
30618
30647
|
if (fs.existsSync(sourceSkillsDir)) {
|
|
30619
30648
|
try {
|
|
30620
|
-
|
|
30621
|
-
|
|
30622
|
-
|
|
30623
|
-
|
|
30624
|
-
|
|
30625
|
-
|
|
30626
|
-
|
|
30649
|
+
fs.mkdirSync(path.dirname(targetSkillsDir), { recursive: true });
|
|
30650
|
+
fs.cpSync(sourceSkillsDir, targetSkillsDir, { recursive: true });
|
|
30651
|
+
console.log(`
|
|
30652
|
+
\u2705 Installed Agent Skills to .claude/skills/`);
|
|
30653
|
+
fs.mkdirSync(targetRulesDir, { recursive: true });
|
|
30654
|
+
fs.copyFileSync(
|
|
30655
|
+
path.join(sourceSkillsDir, "SKILL.md"),
|
|
30656
|
+
path.join(targetRulesDir, "genjo-ai-news.md")
|
|
30657
|
+
);
|
|
30658
|
+
console.log(`\u2705 Installed Cursor Rule to .cursor/rules/genjo-ai-news.md`);
|
|
30627
30659
|
} catch (error48) {
|
|
30628
|
-
console.error(` \u274C Failed to copy skills: ${error48.message}`);
|
|
30660
|
+
console.error(` \u274C Failed to copy skills/rules: ${error48.message}`);
|
|
30629
30661
|
}
|
|
30630
|
-
} else {
|
|
30631
|
-
console.warn(" \u26A0\uFE0F Could not locate source skills directory.");
|
|
30632
|
-
console.warn(` Checked: ${sourceSkillsDir}`);
|
|
30633
30662
|
}
|
|
30634
30663
|
console.log("\n--------------------------------");
|
|
30635
30664
|
console.log("\u{1F389} Setup complete!");
|
|
30636
|
-
console.log("1. Restart Claude Desktop to apply MCP settings.");
|
|
30637
|
-
console.log("2. Use 'Genjo' tools in
|
|
30638
|
-
console.log("3.
|
|
30665
|
+
console.log("1. Restart Claude Desktop / Cursor to apply MCP settings.");
|
|
30666
|
+
console.log("2. Use 'Genjo' tools in your chat!");
|
|
30667
|
+
console.log("3. Cursor Rule is now active in .cursor/rules/.");
|
|
30639
30668
|
}
|
|
30640
30669
|
async function main() {
|
|
30641
30670
|
const args = process.argv.slice(2);
|