@posthog/wizard
Version:
The PostHog wizard helps you to configure your project
45 lines • 2.27 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.runMCPRemove = exports.runMCPInstall = void 0;
const chalk_1 = __importDefault(require("chalk"));
const add_mcp_server_to_clients_1 = require("./steps/add-mcp-server-to-clients");
const clack_1 = __importDefault(require("./utils/clack"));
const debug_1 = require("./utils/debug");
const runMCPInstall = async (options) => {
if (options.debug) {
(0, debug_1.enableDebugLogs)();
}
clack_1.default.intro(chalk_1.default.bgGreenBright(`Installing the PostHog MCP server ${options.local && '(local)'}`));
await (0, add_mcp_server_to_clients_1.addMCPServerToClientsStep)({
cloudRegion: options.region,
askPermission: false,
local: options.local,
});
clack_1.default.log.message(`${chalk_1.default.greenBright('You might need to restart your MCP clients to see the changes.')}`);
clack_1.default.log.message(`You'll be prompted to log in to PostHog when you first use the MCP.`);
clack_1.default.log.message(`Get started with some prompts like:
- What feature flags do I have active?
- Add a new feature flag for our homepage redesign
- What are my most common errors?`);
clack_1.default.log.message(`Check out our MCP Server documentation:
${chalk_1.default.blueBright(`https://posthog.com/docs/model-context-protocol`)}`);
};
exports.runMCPInstall = runMCPInstall;
const runMCPRemove = async (options) => {
clack_1.default.intro(chalk_1.default.bgRed('Removing the PostHog MCP server'));
const results = await (0, add_mcp_server_to_clients_1.removeMCPServerFromClientsStep)({
local: options?.local,
});
if (results.length === 0) {
clack_1.default.outro(`No PostHog MCP servers found to remove.`);
return;
}
clack_1.default.log.success(`PostHog MCP server removed from:`);
results.map((c) => clack_1.default.log.message(`- ${c}`));
clack_1.default.outro(`${chalk_1.default.green('You might need to restart your MCP clients to see the changes.\n\n')}`);
};
exports.runMCPRemove = runMCPRemove;
//# sourceMappingURL=mcp.js.map