Get the FREE Ultimate OpenClaw Setup Guide →

hello-world

Demostrate simple mcp server with typescript.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio jageenshukla-hello-world-mcp-server node dist/server.js \
  --env PORT="4000"

How to use

The Hello World MCP Server demonstrates a minimal MCP implementation using the MCP SDK with Express to expose endpoints for server-sent events (SSE) and message handling. It registers a set of MCP tools and prompts that allow clients to interact with the server, inspect its capabilities, and send messages or queries through the configured endpoints. You can use the MCP Inspector to quickly test and verify that the server’s tools and prompts are wired up correctly, ensuring that the server responds as expected to prompts, tool invocations, and SSE streams.

To operate the server, run it and connect with the MCP ecosystem as described in the project blog. The server exposes HTTP endpoints via Express for SSE streams and message exchange, enabling clients to subscribe to event streams, send messages, and receive structured responses generated by the server’s tools and prompts. The included inspector tooling helps you validate tool registrations and prompt configurations in an interactive way.

How to install

Prerequisites:

  • Node.js v16 or higher
  • npm (comes with Node.js) or yarn

Step-by-step installation:

  1. Clone the repository: git clone https://github.com/your-username/hello-world-mcp-server.git cd hello-world-mcp-server

  2. Install dependencies: npm install

    or if you prefer yarn

    yarn install

  3. Configure environment:

    • Copy the example environment file and adjust as needed: cp .env.example .env
    • Edit .env to set PORT (default 4000).
  4. Build the project (TypeScript to JavaScript): npm run build

    or

    yarn build

  5. Run the server: npm start

    or for development with live reload

    npm run dev

Additional notes

Environment and configuration tips:

  • The server reads configuration from a .env file. Common variables include PORT to expose the HTTP server. If PORT is in use, change it in .env.
  • If you encounter TypeScript errors after pulling changes, ensure dependencies are installed and run a clean build (delete dist if necessary and reinstall).
  • The MCP Inspector command (npx @modelcontextprotocol/inspector ./dist/server.js) can help you verify registered tools and prompts.
  • Ensure your Node.js version matches the project’s expected range (v16+). If using npm, npm ci can help lock down dependencies for CI environments.

Common issues:

  • Port already in use: update PORT in .env and restart.
  • Build failures: verify TypeScript config (tsconfig.json) and that dependencies install correctly.

Related MCP Servers

Sponsor this space

Reach thousands of developers