MCP.so
Sign In

A Simple MCP Server and Client

@logesh-kumar

Basic information

Category

Other

Last updated

Transports

stdio

Author

logesh-kumar

About A Simple MCP Server and Client

A simple MCP example with client and server

A Simple MCP Server and Client config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "mcp-client-server-logesh-kumar": {
      "command": "node",
      "args": [
        "client.js"
      ]
    }
  }
}

A Simple MCP Server and Client tools

Tool list not available yet

This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is A Simple MCP Server and Client?

This is a Model Context Protocol (MCP) server and client implementation that demonstrates how to expose and access weather information. It is intended for developers learning about MCP.

How to use A Simple MCP Server and Client?

Start the client with node client.js, which automatically starts the server as a child process. To run the server independently, use node server.js.

Key features of A Simple MCP Server and Client

  • Provides city resources (NewYork, London, Tokyo)
  • Offers a get-weather tool with parameters
  • Includes a weather-advice prompt
  • Uses JSON-RPC 2.0 for communication
  • Implements stdio transport between client and server
  • Logs exchanged messages in human-readable format

Use cases of A Simple MCP Server and Client

  • Learning how to build an MCP server and client
  • Demonstrating resource, tool, and prompt capabilities
  • Understanding JSON-RPC communication patterns
  • Prototyping weather-related MCP integrations

Frequently asked questions

1

What protocol does this server use?

It uses JSON-RPC 2.0 as the underlying communication protocol between client and server.

2

What transport mechanism is used?

This example uses stdio (standard input/output) transport. The client spawns the server as a child process and communicates through stdin/stdout streams.

3

How do I run the server and client?

Start the client with `node client.js`; it automatically starts the server. To run the server independently, use `node server.js`.

4

What resources are available?

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

5

What if resource or prompt requests time out?

Check the server implementation. The example includes direct message handling to work around limitations in the current SDK version.

Comments

More Other MCP servers