kikmak42/openapi-mcp-server-demo
If you are the rightful owner of openapi-mcp-server-demo and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This is a Model Context Protocol (MCP) server for the Cat Facts API, designed to provide cat facts and breed information through a structured protocol.
Cat Facts MCP Server Demo
This a MCP server generated by AI for Cat Facts API https://catfact.ninja/
The idea over here to understand what functionalities and aditional logic is need to be written for an MCP server on top of a API Spec so that the LLM Model understands and leverages the MCP Server
Features
Three main tools:
-
get_random_fact - Fetches a single random cat fact
- Optional
max_length
parameter to limit fact length
- Optional
-
get_facts - Fetches paginated list of cat facts
limit
parameter (1-100 facts per page)max_length
parameter to filter by fact lengthpage
parameter for pagination
-
get_breeds - Fetches paginated list of cat breeds
limit
parameter (1-100 breeds per page)page
parameter for pagination
Key Implementation Details
- Type Safety: Full TypeScript interfaces for all API responses
- Error Handling: Comprehensive error handling for network failures and API errors
- Parameter Validation: Input schema validation for all parameters
- Clean Response Format: Structured JSON responses with pagination info separated from data
- MCP Compliance: Follows MCP server standards with proper tool registration and handlers
Usage
To use this server:
- Install dependencies:
npm install
- Compile:
npm run build
- Run:
npm start
- Test:
npx @modelcontextprotocol/inspector node dist/catfacts-server.js
The server connects via stdio
and provides access to the Cat Facts API through the MCP protocol, making it easy to integrate cat facts and breed information into any MCP-compatible application.