
Hacker News
STDIOMCP server providing tools to fetch and interact with real-time Hacker News content.
MCP server providing tools to fetch and interact with real-time Hacker News content.
A Model Context Protocol (MCP) server that provides tools to fetch and interact with Hacker News content. This server enables AI assistants to access real-time Hacker News data including top stories, story details, comments, and search functionality.
get_top_stories
- Fetch the latest top stories from Hacker News
get_story_details
- Get detailed information about a specific story
get_story_comments
- Retrieve popular comments for a story
search_stories
- Search recent stories by keywords
git clone https://github.com/yourusername/hackernews-mcp.git cd hackernews-mcp
npm install
npm run build
Add the server to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{ "mcpServers": { "hackernews-mcp": { "command": "node", "args": ["/path/to/hackernews-mcp/build/index.js"] } } }
The server communicates via stdio and can be used with any MCP-compatible client:
node build/index.js
Once connected, you can ask your AI assistant things like:
npm run build
npm run watch
npm run lint npm run format
For debugging and testing:
npm run inspector
This will start the MCP Inspector, providing a web interface to test the server's tools and inspect the communication.
git checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)npm run lint
and npm run format
before pushinggit push origin feature/amazing-feature
){ count?: number; // Number of stories (1-100, default: 30) include_text?: boolean; // Include story text content (default: false) }
{ story_id: number; // Required: HN story ID include_comments?: boolean; // Include comments (default: false) include_markdown?: boolean; // Extract article as markdown (default: false) }
{ story_id: number; // Required: HN story ID min_score?: number; // Minimum comment score (default: 1) max_depth?: number; // Max thread depth (1-10, default: 3) limit?: number; // Max comments (1-100, default: 20) }
{ query: string; // Required: Search keywords limit?: number; // Max results (1-50, default: 20) time_range_hours?: number; // Hours to search back (1-168, default: 24) }
The server is built with:
src/index.ts
- Main server implementation with tool handlerssrc/fetcher.ts
- Utility class for fetching and converting web contentbuild/
- Compiled JavaScript output (auto-generated)This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
npm run inspector
Made with ❤️ for the MCP community