https://github.com/mschwarzmueller/demo-mcp-server-client-implementation
A demo implementation of a MCP server (consuming a dummy API) and basic client.
https://github.com/mschwarzmueller/demo-mcp-server-client-implementation
Last synced: 6 months ago
JSON representation
A demo implementation of a MCP server (consuming a dummy API) and basic client.
- Host: GitHub
- URL: https://github.com/mschwarzmueller/demo-mcp-server-client-implementation
- Owner: mschwarzmueller
- License: mit
- Created: 2025-03-18T06:37:41.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-03-18T08:22:41.000Z (8 months ago)
- Last Synced: 2025-03-18T09:31:10.815Z (8 months ago)
- Language: TypeScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-mcp-servers - **demo-mcp-server-client-implementation** - A demo implementation of a MCP server (consuming a dummy API) and basic client. `typescript` `mcp` `server` `api` `npm install mschwarzmueller/demo-mcp-server-client-implementation` (🌐 Web Development)
README
# Example MCP Server + Client Implementation
I [wrote an article](https://maximilian-schwarzmueller.com/articles/whats-the-mcp-model-context-protocol-hype-all-about) and [created a video](https://youtu.be/sVC4DL2secQ) 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!](https://maximilian-schwarzmueller.com/articles/modern-nodejs-can-do-that/#built-in-typescript-support) **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=
```
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 :-)