mcp-server-client

mcp-server-client

2

This project illustrates how to implement the Model Context Protocol (MCP) using a TypeScript SDK, featuring separate server and client applications that communicate via stdio transport. It offers functionalities for listing and reading resources with basic error handling.

Overview

This project demonstrates a basic implementation of the Model Context Protocol (MCP) using the TypeScript SDK. It includes:

  • An MCP server that provides access to resources
  • An MCP client that connects to the server and requests resources
  • Basic resource listing and reading functionality

Prerequisites

  • Node.js (v16 or higher)
  • npm

Installation

Clone the repository and install dependencies with npm.

Running the Example

  1. Start the server.
  2. Start the client in a new terminal. The client will connect to the server, request a list of available resources, and read the content of an example resource.

Server Capabilities

  • Resource listing
  • Resource reading
  • Basic error handling

Available Resources

  • Access to file:///example.txt, a simple text resource.