Get the FREE Ultimate OpenClaw Setup Guide →

mcp -demo

TS-based MCP Serevr demo supporting STDIO, SSE and StreamableHttp transports.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio isboyjc-mcp-server-demo node build/index.js sse --port 3000

How to use

This MCP Server Demo showcases a multi-transport MCP (Model Context Protocol) server built with TypeScript and Node.js. It supports three transports: STDIO for command-line integrations, SSE for real-time web communications, and StreamableHttp for REST-like streaming interactions. The server includes a built-in addition tool to demonstrate how MCP tools are registered and invoked. To use it, run the appropriate transport entry and interact with the endpoints or tools as described in the README. For example, the SSE transport exposes endpoints such as /sse for events, /message for sending messages, /health for health checks, and /info for service information. The StreamableHttp transport exposes the /mcp endpoint for tool calls and supports streaming responses.

You can explore the built-in tools by connecting via SSE or StreamableHttp and issuing tool calls (e.g., list tools or call add). The project uses the MCP SDK to register tools and provides example code showing how to add new tools under src/tools and register them in src/index.ts. This enables easy extension of the server capabilities to fit your needs.

How to install

Prerequisites:

  • Node.js (v14+ recommended; Node 18 LTS is fine)
  • pnpm (preferred) or npm/yarn
  1. Clone the repository:
git clone https://github.com/isboyjc-mcp-server-demo.git
cd isboyjc-mcp-server-demo
  1. Install dependencies:
pnpm install
# or if you prefer npm:
npm install
  1. Build the project:
pnpm run build
# or if you prefer npm:
npm run build
  1. Run the server (choose transport):
# STDIO
node build/index.js stdio

# SSE (default port 3000; you can override with --port)
node build/index.js sse --port 3000

# StreamableHttp
node build/index.js http --port 3000
  1. Optional: run in production with Docker or PM2 as shown in the deployment notes (not included here).

Additional notes

Tips and notes:

  • The server exposes health and info endpoints for monitoring and discovery. Check health at /health and info at /info for current configuration and endpoints.
  • When using SSE, ensure CORS is allowed if you access it from a different origin. The demo includes CORS considerations in its configuration.
  • For graceful shutdown, use the built-in shutdown path or terminate the process; the server is designed to shut down without dropping in-flight messages.
  • To extend functionality, add new tool modules under src/tools and register them in src/index.ts by calling server.registerTool with a unique name and schema.
  • If you modify the code, remember to rebuild before testing changes (pnpm run build).
  • The default port for web transports is 3000; you can override it with --port when starting the server.
  • If you plan to deploy with Docker, you can reuse the provided Dockerfile and update the CMD to start with your preferred transport (e.g., sse).

Related MCP Servers

Sponsor this space

Reach thousands of developers