MCP ExplorerExplorer

Demo Mcp Server Client Implementation

@mschwarzmuelleron a year ago
24 MIT
FreeCommunity
AI Systems
A demo implementation of a MCP server (consuming a dummy API) and basic client.

Overview

What is Demo Mcp Server Client Implementation

demo-mcp-server-client-implementation is a demonstration project that showcases a basic implementation of a MCP server, which consumes a dummy API and provides a standardized interface for MCP clients. It includes a backend service, a MCP server, and a simple AI chatbot client.

Use cases

Use cases for this implementation include developing AI chat applications that require backend data storage and retrieval, experimenting with MCP architecture, and learning about integrating APIs with Node.js.

How to use

To use the demo, ensure you have Node.js version 23.x or higher installed. Create a .env file in the client folder with your OpenAI API key. Install the required dependencies by running ‘npm install’ in each of the service, server, and client folders. Then, run ‘npm run dev’ in each folder to start the service, MCP server, and client.

Key features

Key features include a simple AI chatbot client that utilizes OpenAI, a backend service that can store and retrieve information, and a standardized MCP server that connects the client and service.

Where to use

undefined

Content

Example MCP Server + Client Implementation

I wrote an article and created a video about MCPs and why they’re useful in my opinion.

This demo project contains a backend service / API that’s consumed by a MCP server which exposes it in a standardized way to MCP clients - like the example MCP client (a very simple AI chatbot) that’s also part of this project.

Important: All three parts (service, server, client) rely on Node.js being able to execute TypeScript without a compilation step. Yes, modern Node.js can do that! Make sure you have Node.js 23.x or higher installed!

Configuration

Add a .env file inside the client folder (next to the package.json file there) and add the following content to it:

OPENAI_API_KEY=<your-open-ai-key>

In each folder (service, server, client) run npm install to install required dependencies.

Running Service, MCP Server & MCP Client

For each part, navigate into the respective folder (service, server and client) and run npm run dev (with Node.js 23+). Keep each process running.

The “client” process is a simply AI chatbot using OpenAI behind the scenes. This chatbot has the custom MCP server “installed” - therefore, this AI chat application is able to store and retrieve custom information via the backend service created in the “service” folder.

Bugs are possible - it’s just a basic demo implementation :-)

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers