mcp-news-server
The MCP News Server is a wrapper around the Hacker News API, showcasing the implementation of the Modular Contract Protocol (MCP). It is designed to convert traditional REST APIs into MCP-compliant servers, facilitating easy discovery and interaction by tools such as LLM agents.
📰 MCP News Server
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.
🌐 Live Demo
Deployed at: https://mcp-news-server.onrender.com
Try It Now
- GET /api/listTopStories
- GET /api/getStory/8863
- GET /openapi.json
🚀 What is This?
This project demonstrates how to transform an existing REST API into an MCP-compliant server. It wraps the Hacker News API using modular components with contracts, resolvers, handlers, and OpenAPI integration for LLM function calling.
💡 Why Use MCP Instead of Raw REST Calls?
Traditional REST APIs:
- No contracts
- Inconsistent formats
- Not LLM friendly
MCP APIs:
- Contract-driven (with Zod)
- Composable and self-descriptive
- LLM-ready (via OpenAPI and function schemas)
🔧 Tech Stack
- Node.js + Express
- TypeScript
- Zod +
zod-openapi
- Axios
- Deployed on Render
🧠 How LLMs Can Use This
Each MCP endpoint is strictly typed, schema-bound with Zod, and self-documenting via OpenAPI, making it ideal for LLM agents, LangChain tools, and ai-agent-flow pipelines.
📜 License
MIT