{"id":28520261,"url":"https://github.com/rajeshdh/mcp-news-server","last_synced_at":"2026-04-11T14:33:12.536Z","repository":{"id":294269657,"uuid":"986393382","full_name":"rajeshdh/mcp-news-server","owner":"rajeshdh","description":"🧠 A clean MCP wrapper around the Hacker News API with OpenAPI support and LLM-ready contracts using Zod + TypeScript.","archived":false,"fork":false,"pushed_at":"2025-05-19T17:48:54.000Z","size":81,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-24T20:23:06.576Z","etag":null,"topics":["ai-tools","api-wrapper","express","hacker-news","llm","mcp","openapi","typescript","zod","zod-openapi"],"latest_commit_sha":null,"homepage":"https://mcp-news-server.onrender.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rajeshdh.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-19T14:39:41.000Z","updated_at":"2025-05-29T16:59:02.000Z","dependencies_parsed_at":"2025-05-19T17:34:07.879Z","dependency_job_id":"1725ed8d-62af-4fba-b0c3-1bed55f75f1d","html_url":"https://github.com/rajeshdh/mcp-news-server","commit_stats":null,"previous_names":["rajeshdh/mcp-news-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rajeshdh/mcp-news-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajeshdh%2Fmcp-news-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajeshdh%2Fmcp-news-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajeshdh%2Fmcp-news-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajeshdh%2Fmcp-news-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rajeshdh","download_url":"https://codeload.github.com/rajeshdh/mcp-news-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rajeshdh%2Fmcp-news-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31684525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-tools","api-wrapper","express","hacker-news","llm","mcp","openapi","typescript","zod","zod-openapi"],"created_at":"2025-06-09T07:01:19.057Z","updated_at":"2026-04-11T14:33:12.528Z","avatar_url":"https://github.com/rajeshdh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📰 MCP News Server\n\n\u003e A clean, minimal MCP wrapper around the Hacker News API — built to showcase the Modular Contract Protocol (MCP) structure, typed contracts, and LLM-compatible interface.\n\n## 🌐 Live Demo\n\n🟢 Deployed at: [https://mcp-news-server.onrender.com](https://mcp-news-server.onrender.com)\n\n### Try It Now\n\n- [GET /api/listTopStories](https://mcp-news-server.onrender.com/api/listTopStories)\n- [GET /api/getStory/8863](https://mcp-news-server.onrender.com/api/getStory/8863)\n- [GET /openapi.json](https://mcp-news-server.onrender.com/openapi.json)\n\n---\n\n## 🚀 What is This?\n\nThis project demonstrates how to transform an existing REST API into an **MCP-compliant server**. It wraps the [Hacker News API](https://github.com/HackerNews/API) using modular components:\n\n- **Contracts** defined with `zod` and `zod-openapi` for typed and documented inputs/outputs\n- **Resolvers** for business logic\n- **Handlers** for HTTP routing\n- **OpenAPI integration** for LLM function calling\n\nMy goal with this wrapper is to **learn and demonstrate the full MCP process**, and prepare APIs for the **MCP marketplace** — where tools and agents can discover and use them programmatically.\n\n---\n\n## 💡 Why Use MCP Instead of Raw REST Calls?\n\nTraditional REST APIs:\n\n- ❌ No contracts\n- ❌ Inconsistent formats\n- ❌ Not LLM friendly\n\nMCP APIs:\n\n- ✅ Contract-driven (with Zod)\n- ✅ Composable and self-descriptive\n- ✅ LLM-ready (via OpenAPI and function schemas)\n\n---\n\n## 🔧 Tech Stack\n\n- Node.js + Express\n- TypeScript\n- Zod + `zod-openapi`\n- Axios\n- Deployed on Render\n\n---\n\n## 📁 Project Structure\n\n```\nsrc/\n├── contracts/                # Zod + OpenAPI metadata\n├── resolvers/                # Business logic\n├── handlers/                 # Express routes\n├── utils/                    # Hacker News client\n├── docs/openapi.ts           # OpenAPI spec generator (zod-openapi)\n├── setup/zod-openapi-init.ts # Shared zod setup with OpenAPI support\n└── server.ts                 # Main entry point\n```\n\n---\n\n## 🗂️ Endpoints\n\n### 1. `GET /api/listTopStories`\n\nReturns a list of top Hacker News story IDs.\n\n#### Example:\n\n```bash\ncurl https://mcp-news-server.onrender.com/api/listTopStories\n```\n\n#### Response:\n\n```json\n[38643, 38642, 38641]\n```\n\n---\n\n### 2. `GET /api/getStory/:id`\n\nReturns full story data for a given story ID.\n\n#### Example:\n\n```bash\ncurl https://mcp-news-server.onrender.com/api/getStory/8863\n```\n\n#### Response:\n\n```json\n{\n  \"id\": 8863,\n  \"title\": \"My YC app: Dropbox - Throw away your USB drive\",\n  \"url\": \"http://www.getdropbox.com/u/2/screencast.html\",\n  \"score\": 111,\n  \"by\": \"dhouston\",\n  \"time\": 1175714200,\n  \"type\": \"story\"\n}\n```\n\n---\n\n## 🧠 How LLMs Can Use This\n\nEach MCP endpoint is:\n\n- Strictly typed\n- Schema-bound with Zod\n- Self-documenting via OpenAPI\n\nThis makes it ideal for:\n\n- LLM agents (OpenAI, Claude)\n- LangChain tools\n- ai-agent-flow pipelines\n\n---\n\n## 🤖 Function Calling Example (OpenAI / Claude)\n\n```json\n{\n  \"name\": \"getStory\",\n  \"description\": \"Retrieve story details by ID from Hacker News\",\n  \"parameters\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"id\": {\n        \"type\": \"string\",\n        \"description\": \"The numeric ID of the Hacker News story\"\n      }\n    },\n    \"required\": [\"id\"]\n  }\n}\n```\n\n➡️ Point to:\n`GET https://mcp-news-server.onrender.com/api/getStory/:id`\n\n---\n\n## 📄 OpenAPI Schema\n\n```bash\ncurl https://mcp-news-server.onrender.com/openapi.json\n```\n\nThis endpoint can be used in:\n\n- Swagger UI\n- API clients (Postman, Insomnia)\n- LLM frameworks for function discovery\n\n---\n\n## 🛠️ Local Setup\n\n```bash\ngit clone https://github.com/rajeshdh/mcp-news-server\ncd mcp-news-server\nnpm install\nnpm run dev\n```\n\n---\n\n## ✨ What You Can Build with This\n\n- A summarizer tool for top HN stories\n- A GPT agent that fetches and ranks HN stories\n- A fact-checking or news validation agent\n- Your own open MCP marketplace entry!\n\n---\n\n## 📜 License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajeshdh%2Fmcp-news-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajeshdh%2Fmcp-news-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajeshdh%2Fmcp-news-server/lists"}