The Hacker News MCP server allows you to fetch stories, comments, search results, and user information from Hacker News through the Model Context Protocol. This integration enables AI assistants to retrieve real-time data from Hacker News when responding to your queries.
To install and use the Hacker News MCP server with Claude Desktop:
uvx
and mcp-hn
packages are installed on your systemOn MacOS:
# Edit the configuration file
nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows:
# Edit the configuration file
notepad %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"mcp-hn": {
"command": "uvx",
"args": ["mcp-hn"]
}
}
}
The Hacker News MCP server provides the following tools:
You can interact with the Hacker News MCP server using natural language queries:
To get today's top stories:
What are the top stories on Hacker News today?
To fetch story details and comments:
Show me the details and comments for the story about AI that's trending today
To search for stories by topic:
What does Hacker News say about careers in AI?
To get information about a user:
What has the user 'pg' been up to lately?
You can combine the Hacker News MCP server with other MCP servers like puppeteer:
Can you use the puppeteer tool to read the top AI article on Hacker News today, and then use the Hacker News tool to get the comments and summarize the main points of discussion?
This command will:
get_stories
to find the top AI articleget_story_info
to retrieve the commentsFor effective use, try to clearly specify which HN section (top, new, ask_hn, show_hn) you want to access and provide specific search terms when using the search functionality.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.