@ai-mapping/mcp-nextjs-dev
Version:
MCP server for managing Next.js development processes with AI tools
64 lines (59 loc) • 1.85 kB
JavaScript
import { startServer } from './server.js';
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);
});
const args = process.argv.slice(2);
const debugMode = args.includes('--debug') || process.env['DEBUG'] === '1';
export const isDebugMode = debugMode;
if (debugMode) {
console.error('[DEBUG] Starting Next.js Development MCP Server in debug mode');
console.error('[DEBUG] Node.js version:', process.version);
console.error('[DEBUG] Working directory:', process.cwd());
console.error('[DEBUG] Command line args:', args);
}
if (args.includes('--version') || args.includes('-v')) {
console.log('@ai-mapping/mcp-nextjs-dev v1.0.0');
process.exit(0);
}
else if (args.includes('--help') || args.includes('-h')) {
console.log(`
@ai-mapping/mcp-nextjs-dev - MCP server for Next.js development
Usage:
mcp-nextjs-dev [options]
Options:
--debug Enable debug logging
--version Show version information
--help Show this help message
Environment Variables:
DEBUG=1 Enable debug logging
Example Usage with Claude Desktop:
Add to claude_desktop_config.json:
{
"mcpServers": {
"nextjs-dev": {
"command": "npx",
"args": ["@ai-mapping/mcp-nextjs-dev"]
}
}
}
For more information, visit:
https://github.com/ai-mapping/mcp-nextjs-dev
`);
process.exit(0);
}
else {
startServer().catch((error) => {
console.error('Failed to start MCP server:', error.message);
if (debugMode) {
console.error('Stack trace:', error.stack);
}
process.exit(1);
});
}
//# sourceMappingURL=cli.js.map