mcp-client-server
If you are the rightful owner of mcp-client-server 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.
A simple MCP server and client implementation for weather information.
This implementation demonstrates a Model Context Protocol (MCP) server and client setup that provides weather information for specific cities. The server, implemented in `server.js`, offers resources for cities like New York, London, and Tokyo, and includes tools for fetching weather forecasts. The client, implemented in `client.js`, connects to the server to list resources, read city data, call weather tools, and get weather advice. Communication between the client and server is handled using JSON-RPC 2.0, which facilitates method calls, parameter passing, and response handling. The server and client communicate via stdio, with the client capable of starting the server as a child process. This setup is useful for understanding MCP and JSON-RPC protocols, and for developing applications that require structured data exchange.
Features
- Provides weather information for specific cities.
- Uses JSON-RPC 2.0 for communication between client and server.
- Includes tools for fetching weather forecasts.
- Offers prompts for travel advice based on weather conditions.
- Utilizes stdio as the transport mechanism for client-server communication.
Tools
get-weather
Get weather forecast for a city with parameters for city name and number of days.