Get the FREE Ultimate OpenClaw Setup Guide →

demo -client-implementation

A demo implementation of a MCP server (consuming a dummy API) and basic 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 mschwarzmueller-demo-mcp-server-client-implementation node server/server.js \
  --env OPENAI_API_KEY="your-openai-api-key"

How to use

This repository contains three integrated parts: a service (backend API), an MCP server, and an MCP client (an AI chatbot). The MCP server exposes the service data in a standardized MCP format so clients can interact with it in a uniform way. The client demonstrates how an MCP-enabled application can consume that data and use the backend service behind the scenes to store and retrieve information. The client uses OpenAI as its underlying AI model through the provided API key, enabling a simple conversational interface that leverages the backend service for enhanced context.

To use the server, first ensure Node.js 23.x or higher is installed. Start the MCP server by running the server in its own terminal, then run the client in another terminal. The server and client communicate through the MCP protocol, allowing the client to query the service, store context, and retrieve results in a consistent manner across MCP-enabled applications.

How to install

Prerequisites:

  • Node.js 23.x or higher
  • npm (bundled with Node.js)
  • Git

Steps:

  1. Clone the repository
git clone <repository-url>
cd <repository-directory>
  1. Install dependencies in all three parts
cd service
npm install
cd ../server
npm install
cd ../client
npm install
  1. Configure environment
  • In client/.env, set OPENAI_API_KEY to your OpenAI key as described in the README:
OPENAI_API_KEY=<your-open-ai-key>
  1. Run each part in its own terminal
# In service folder
npm run dev

# In server folder
npm run dev

# In client folder
npm run dev
  1. Access the client interface (as demonstrated by the example) and interact with the MCP-enabled chat.

Additional notes

Notes and tips:

  • The client relies on OpenAI; set OPENAI_API_KEY in client/.env to enable the chatbot.
  • This is a demo implementation intended to illustrate MCP integration; bugs may occur and the setup is intentionally lightweight.
  • Ensure you run the three parts (service, server, client) concurrently in separate terminals to fully exercise the MCP workflow.
  • If you modify environment variables or endpoints, update the server or client configuration accordingly.
  • If you encounter port conflicts, adjust any port settings in the server or client configurations.
  • For troubleshooting, check logs in each respective folder to identify which part is failing (service, server, or client).

Related MCP Servers

Sponsor this space

Reach thousands of developers