hacker-news
Allows searching Hacker News stories by keyword through the HN Algolia search API, with input validation, result limits, and trimmed story data for AI use.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@hacker-news search Hacker News for stories about MCP from this year"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
api-to-mcp
Turn any REST API into an MCP server, about 10 lines per endpoint. The example wraps the public Hacker News API (no key needed), so you can ask Claude, Cursor or any MCP app things like "What did HN think about MCP this year?"
Built in the video "Turn Any API Into an MCP Server in 15 Minutes" from The Build Receipt.
The pattern
export const searchStories: ApiTool<typeof SEARCH_SHAPE> = {
name: "hn_search",
description: "Search Hacker News stories by keyword…", // the AI reads this to decide when to call it
input: { query: z.string().min(1), limit: z.number().int().max(20).default(5) },
url: ({ query, limit }) => `https://hn.algolia.com/api/v1/search?…&query=${encodeURIComponent(query)}`,
map: (json) => /* trim the response to what the AI needs */,
};registerApiTool(server, searchStories) does the rest: input validation, a 10-second timeout, and errors returned to the AI instead of crashing the server.
The map function is the important part. Raw API responses are full of fields the AI doesn't need, and every extra field costs context. Trim them.
Related MCP server: GNews API MCP Server
Run it
npm install
npm test # 6 unit tests against saved real API responses (offline)
npm run live # starts the server like an AI app would and calls the live APIConnect it
npm run build
claude mcp add hacker-news -- node "$(pwd)/dist/src/server.js"Or in Claude Desktop / Cursor's MCP config:
{ "mcpServers": { "hacker-news": { "command": "node", "args": ["/ABSOLUTE/PATH/dist/src/server.js"] } } }Wrap your own API
Copy
src/hn.tstosrc/yourapi.ts.One
ApiToolobject per endpoint.Register it in
src/server.ts.If the API needs a key, read it from an environment variable in
urlor add a header infetchJson. Never hard-code it.
MIT License
Available Tools
2 toolsTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: hn_search is keyword-based discovery, while hn_story is a direct fetch by id. An agent can easily choose between them based on whether it has an id or a query.
Both tools use the same hn_ prefix followed by a short noun/verb (search, story). The pattern is predictable and consistent.
Two tools is very thin for a Hacker News integration; only keyword search and single-story fetch are exposed. Whole categories of common operations are absent, making the surface feel under-scoped.
Core reading is covered (search + fetch a story), but there is no way to retrieve comments, list top/new/best stories, or look up users. These are significant gaps for the stated Hacker News domain, leaving agents with dead ends.
Maintenance
Related MCP Connectors
Give your AI assistant access to the world’s news. Search articles in any language, track coverage over time, and research companies and events.
Worldwide news search by keyword and date, Hacker News, and any RSS or Atom feed as JSON
Get access to real-time and historical news data including top headlines from global sources
Search worldwide online news in 65+ languages through the official GDELT API. No API key.
1
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides access to the Mediastack News API, enabling users to fetch the latest news stories and browse news sources with filtering options by keywords, countries, languages, and categories.1MIT
- AlicenseAqualityDmaintenanceProvides access to global news articles from over 60,000 sources through the GNews API. Supports keyword search, category browsing, and language customization.22 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search news articles, get top headlines, and browse sources via the NewsAPI.org service.MIT
- AlicenseNot gradedqualityBmaintenanceWraps the NewsData.io global news API, enabling AI agents to access and query global news data through natural language.119 npmMIT