Get the FREE Ultimate OpenClaw Setup Guide →

mcp -client

MCP server from JoeBuildsStuff/mcp-server-client

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio joebuildsstuff-mcp-server-client node src/index.ts

How to use

This repository provides a minimal MCP (Model Context Protocol) server and client example implemented in TypeScript. The server exposes resource listing and resource reading capabilities, and the client connects over a stdio transport to request the available resources and read their contents. This setup is useful for understanding how an MCP server and client can communicate, and for experimenting with common MCP patterns such as listing resources and fetching resource data. To use it, start the server in one terminal and then run the client in another terminal to observe the interaction and the flow of requests and responses between the client and server.

How to install

Prerequisites:

  • Node.js v16 or higher
  • npm

Installation steps:

  1. Clone the repository to your local machine.
  2. Navigate into the project folder.
  3. Install dependencies:
npm install
  1. Start the MCP server:
npm run start:server
  1. In a separate terminal, start the MCP client:
npm run start:client
  1. Observe the client connecting to the server, listing resources, and reading a resource content.

Additional notes

  • The MCP server and client communicate over stdio as described in the README, so run them in separate terminals.
  • The example currently exposes a single resource at file:///example.txt as a demonstration of listing and reading resources.
  • If you want to add more resources, modify the ListResourcesRequestSchema handler in src/index.ts as shown in the documentation.
  • Ensure you have TypeScript support in your environment if you run or edit TypeScript files directly; the project relies on ts-node or a build step depending on your setup.
  • This is a minimal example intended for learning and experimentation; for production usage, consider proper error handling, authentication, and resource management.
  • If you encounter transport issues, verify that the server and client are started in separate shells and that their stdio streams are not redirected.

Related MCP Servers

Sponsor this space

Reach thousands of developers