UNPKG

@porkbunllc/mcp-server

Version:

Official Porkbun MCP server, built and maintained by Porkbun — exposes the Porkbun v3 API as tools for AI agents (ChatGPT, Claude, Cursor, etc.)

25 lines (24 loc) • 901 B
#!/usr/bin/env node import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { loadConfig } from "./api.js"; import { buildServer } from "./server.js"; // Local (stdio) entry point: Claude Desktop, Cursor, Claude Code with an API // key in the environment. The hosted connector is http.ts. // Defer config loading until the first tool call. tools/list works without // credentials so MCP clients can still discover what's available. let cachedConfig = null; function getConfig() { if (!cachedConfig) cachedConfig = loadConfig(); return cachedConfig; } async function main() { const server = buildServer(getConfig); const transport = new StdioServerTransport(); await server.connect(transport); // Errors during transport are already logged by the SDK. } main().catch((err) => { console.error("Fatal:", err); process.exit(1); });