#!/usr/bin/env node
/**
* Verification script to check Cursor MCP setup
*/
import { existsSync, readFileSync } from "fs";
import { join } from "path";
import { homedir } from "os";
console.log("🔍 Verifying Cursor MCP Setup\n");
// Check Cursor config file
const os = process.platform;
let cursorConfigPath;
switch (os) {
case "win32":
cursorConfigPath = join(
homedir(),
"AppData",
"Roaming",
"Cursor",
"User",
"globalStorage",
"cursor.mcp"
);
break;
case "darwin":
cursorConfigPath = join(
homedir(),
"Library",
"Application Support",
"Cursor",
"User",
"globalStorage",
"cursor.mcp"
);
break;
case "linux":
cursorConfigPath = join(
homedir(),
".config",
"Cursor",
"User",
"globalStorage",
"cursor.mcp"
);
break;
default:
console.error("❌ Unsupported OS:", os);
process.exit(1);
}
const configFilePath = join(cursorConfigPath, "config.json");
console.log("📂 Config directory:", cursorConfigPath);
console.log("📄 Config file:", configFilePath);
// Check if config file exists
if (!existsSync(configFilePath)) {
console.error("❌ Cursor MCP config file not found!");
console.log("Run: npm run setup-cursor");
process.exit(1);
}
// Read and validate config
try {
const configContent = readFileSync(configFilePath, "utf8");
const config = JSON.parse(configContent);
console.log("✅ Config file found and valid");
// Check for GitHub MCP server
if (config.mcpServers && config.mcpServers["github-mcp"]) {
const server = config.mcpServers["github-mcp"];
console.log("✅ GitHub MCP server configured");
console.log("📋 Server details:");
console.log(" • Command:", server.command);
console.log(" • Args:", server.args.join(" "));
console.log(" • Working Directory:", server.cwd);
console.log(
" • GitHub Token:",
server.env?.GITHUB_TOKEN ? "✅ Set" : "❌ Missing"
);
console.log(
" • GitHub Username:",
server.env?.GITHUB_USERNAME || "Not set"
);
// Check if server file exists
const serverPath = server.args[0];
if (existsSync(serverPath)) {
console.log("✅ Server file exists");
} else {
console.error("❌ Server file not found:", serverPath);
console.log("Run: npm run build");
}
} else {
console.error("❌ GitHub MCP server not found in config");
console.log("Run: npm run setup-cursor");
}
} catch (error) {
console.error("❌ Invalid config file:", error.message);
}
console.log("\n🎯 Next Steps:");
console.log("1. Restart Cursor IDE");
console.log("2. Look for MCP panel or GitHub integration");
console.log("3. Try asking: 'Show me my GitHub profile'");
console.log("\n🛠️ Troubleshooting:");
console.log("• If server not working: npm run simple-test");
console.log("• If config issues: npm run setup-cursor");
console.log("• For manual setup: see cursor-setup.md");