FastAPI Server

•

Provides a minimalist FastAPI server implementation designed to mimic a subset of the Model Context Protocol (MCP) functionality.

This project offers a lightweight FastAPI server that emulates key aspects of the Model Context Protocol (MCP). It features both a straightforward RESTful echo endpoint and a robust JSON-RPC 2.0 interface. The RPC endpoint supports discovering available tools (`mcp.list_tools`) and executing them (`mcp.call_tool`), demonstrating functionality with built-in examples like `echo`, `uppercase`, `query_manse` for database interaction, and `calc_daewoon` for date calculations. Complete with Pydantic models for structured data handling, basic logging, and comprehensive tests, it serves as an excellent starting point for building or integrating with MCP-style services.

Key Features

01Echo-style REST endpoint returning structured responses
02JSON-RPC 2.0 endpoint supporting tool listing and execution
03Includes example tools for text manipulation, database query, and date calculations
04Uses Pydantic models for request and response validation
05Includes basic logging and pytest for comprehensive testing
060 GitHub stars

Use Cases

01Learning FastAPI server implementation with structured RPC and database integration patterns
02Exposing internal Python functions or microservices via a standardized JSON-RPC API
03Developing and testing services compatible with the Model Context Protocol