MCP.so
ログイン

A Simple MCP Server and Client

@logesh-kumar

基本情報

カテゴリ

その他

トランスポート

stdio

作者

logesh-kumar

A Simple MCP Server and Client について

A simple MCP example with client and server

A Simple MCP Server and Client の設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

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

A Simple MCP Server and Client のツール

ツール一覧はまだありません

この掲載には表示できるツール一覧がまだありません。サーバーにツールがないという意味ではありません。対応機能はプロジェクトのドキュメントをご確認ください。

ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。

概要

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

よくある質問

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.

コメント

「その他」の他のコンテンツ