UNPKG

@phqb/mcp-server

Version:

PHQB MCP Payment Server - AI-powered payment processing for Claude and other AI assistants

55 lines 1.91 kB
#!/usr/bin/env node "use strict"; // PHQB MCP 服务器主入口 Object.defineProperty(exports, "__esModule", { value: true }); const server_1 = require("./server"); async function main() { // 从环境变量获取配置 const apiKey = process.env.PHQB_API_KEY; const baseURL = process.env.PHQB_API_URL || 'https://www.phqb.com'; if (!apiKey) { console.error('❌ Error: PHQB_API_KEY environment variable is required'); console.error(''); console.error('Please set your PHQB API Key:'); console.error(' export PHQB_API_KEY="your-api-key-here"'); console.error(''); console.error('You can get your API Key from: https://www.phqb.com/dashboard?tab=apikey'); process.exit(1); } try { console.log('🚀 Starting PHQB MCP Server...'); console.log(`📡 API URL: ${baseURL}`); console.log(`🔑 API Key: ${apiKey.substring(0, 8)}...`); console.log(''); const server = new server_1.PHQBMCPServer(apiKey, baseURL); await server.initialize(); await server.run(); } catch (error) { console.error('❌ Failed to start PHQB MCP Server:', error); process.exit(1); } } // 处理未捕获的异常 process.on('uncaughtException', (error) => { console.error('❌ Uncaught Exception:', error); process.exit(1); }); process.on('unhandledRejection', (reason, promise) => { console.error('❌ Unhandled Rejection at:', promise, 'reason:', reason); process.exit(1); }); // 优雅关闭 process.on('SIGINT', () => { console.log('\n👋 PHQB MCP Server shutting down...'); process.exit(0); }); process.on('SIGTERM', () => { console.log('\n👋 PHQB MCP Server shutting down...'); process.exit(0); }); main().catch((error) => { console.error('❌ Fatal error:', error); process.exit(1); }); //# sourceMappingURL=index.js.map