Get the FREE Ultimate OpenClaw Setup Guide →

MCP-Client -Project-using-NodeJS

A minimal Model Context Protocol (MCP) implementation built with Node.js and TypeScript. This project demonstrates client–server communication over stdio, structured message handling, and local data access, developed with VS Code and GitHub Copilot to explore modern AI tool integration workflows.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio dyneth02-mcp-client-server-project-using-nodejs node build/server.js

How to use

This MCP server implements a simple client–server pattern using Node.js and TypeScript, communicating over standard input and output (stdio) rather than HTTP. The server reads requests from stdio, uses a local users.json data source, and responds with structured MCP-style messages. It’s designed to be educational, showing how a protocol-driven context provider can be built and tested locally. The accompanying client (client.ts) demonstrates how to format requests and handle responses, making it a practical sandbox for experimenting with MCP-style workflows and AI tool integrations.

To use it, run the server as part of your MCP setup. The project expects the server to be started via the build/server.js entry point, which is produced by the build step. The client can be run in the same environment to send structured requests and observe the server’s responses. This setup mirrors how AI tools query external context providers: through a well-defined protocol, not a traditional REST API, and with deterministic request/response serialization.

How to install

Prerequisites:

  • Node.js (and npm) installed on your system
  • Basic TypeScript/Node.js tooling familiarity

Installation steps:

  1. Clone the repository or download the project files.
  2. Install dependencies:
    • npm install
  3. Build the TypeScript sources to JavaScript:
    • npm run build
  4. Run the MCP server (via Node.js entry):
    • node build/server.js
  5. (Optional) Run a local client to test interactions, typically by executing client.ts or a provided test harness that writes to and reads from stdio.

Additional notes

Tips and considerations:

  • The server operates over stdio, so it’s ideal for local testing or integrating with a harness that injects and captures messages via pipes.
  • The data source is a local users.json file; you can extend the server to query additional JSON files or replace the data source with a mock database for richer testing.
  • If you modify TypeScript sources, remember to re-run npm run build to emit updated JS in build/.
  • Ensure your environment has sufficient permissions for reading files like users.json when the server starts.
  • This project is intentionally lightweight and educational; consider adding authentication, error handling improvements, and unit tests if you plan to extend it for more serious experimentation.

Related MCP Servers

Sponsor this space

Reach thousands of developers