Simple MCP Server logo

Simple MCP Server

by logesh-kumar

This is a simple Model Context Protocol (MCP) server and client implementation. It demonstrates how to expose and access weather information using JSON-RPC 2.0 over stdio.

View on GitHub

Last updated: N/A

What is Simple MCP Server?

This is a simple MCP server and client that communicate using JSON-RPC 2.0 over stdio. The server exposes weather information for different cities, and the client can access this information through resources, tools, and prompts.

How to use Simple MCP Server?

To use the server and client, first clone the repository. Then, start the client using node client.js, which will automatically start the server. Alternatively, you can start the server independently using node server.js.

Key features of Simple MCP Server

  • Exposes weather information for cities

  • Implements MCP using JSON-RPC 2.0

  • Uses stdio for communication

  • Provides resources, tools, and prompts

  • Includes a client to interact with the server

Use cases of Simple MCP Server

  • Demonstrating MCP server-client communication

  • Exposing and accessing data through a defined protocol

  • Learning about JSON-RPC 2.0

  • Building simple APIs

  • Understanding stdio-based communication

FAQ from Simple MCP Server

What is MCP?

MCP stands for Model Context Protocol. It's a protocol for communication between a client and a server.

What is JSON-RPC 2.0?

JSON-RPC 2.0 is a stateless, light-weight remote procedure call (RPC) protocol encoded in JSON.

How does the client communicate with the server?

The client and server communicate using JSON-RPC 2.0 over stdio (standard input/output).

What resources are available on the server?

The server provides resources for city://NewYork, city://London, and city://Tokyo.

What tools are available on the server?

The server provides a get-weather tool to get weather forecasts for a city.