#!/usr/bin/env node
/**
* CLI entry point for Hacker News MCP server
*/
import { startStdioServer } from './mcp-server.js';
async function main() {
const args = process.argv.slice(2);
if (args.includes('--help') || args.includes('-h')) {
console.log(`
Hacker News MCP Server v1.0.0
Usage: hacker-news-mcp [options]
Options:
--help, -h Show this help message
--version, -v Show version information
Environment Variables:
HN_MCP_NO_CACHE=true Disable caching
Examples:
# Start the server for Claude Desktop
hacker-news-mcp
# Start with no cache
HN_MCP_NO_CACHE=true hacker-news-mcp
`);
process.exit(0);
}
if (args.includes('--version') || args.includes('-v')) {
console.log('Hacker News MCP Server v1.0.0');
process.exit(0);
}
try {
await startStdioServer();
} catch (error) {
console.error('Failed to start server:', error);
process.exit(1);
}
}
main().catch((error) => {
console.error('Unhandled error:', error);
process.exit(1);
});