Server Demo

•

Showcases a minimal, functional implementation of the Model Context Protocol, exposing registered tools as versatile HTTP APIs.

This project serves as a minimal, yet fully functional, demonstration of the Model Context Protocol (MCP). It illustrates how to establish an MCP Server, launch it via standard I/O, and register a collection of utility tools. A dedicated client acts as an HTTP API gateway, maintaining a persistent connection with the MCP Server and subsequently exposing all registered tools as accessible HTTP endpoints. The demo includes practical examples such as a `helloTool` for basic greetings, a `weatherTool` for fetching city weather data, and a robust `networkTool` capable of making various HTTP requests, handling different body types, and providing detailed response information. This setup facilitates understanding the protocol's architecture and how tools can be integrated and consumed.

主要功能

01Features a comprehensive `networkTool` for advanced HTTP requests with configurable parameters like method, timeout, body handling, and headers.
02Includes `helloTool` for basic text output.
03Provides `weatherTool` for fetching city-specific weather information.
04Demonstrates Model Context Protocol (MCP) server setup via stdio.
050 GitHub stars
06Exposes registered tools as HTTP API endpoints through a dedicated gateway client.

使用案例

01Building a gateway to expose internal services or utilities as HTTP APIs.
02Learning and experimenting with the Model Context Protocol.
03Developing and testing custom tools compatible with the MCP ecosystem.