Get the FREE Ultimate OpenClaw Setup Guide →

remote -node

The example of MCP server.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio partychen-remote-mcp-server-node node dist/index.js \
  --env PORT="Port to run the server (default 3000)"

How to use

This MCP server is a Node.js implementation of a remote Model Context Protocol (MCP) server. It exposes both Server-Sent Events (SSE) and streamable HTTP transports, enabling MCP clients to establish a session, exchange messages, and invoke MCP tools. The server is built with Express and TypeScript, and it reads configuration from a .env file (notably the PORT). You can connect to the MCP endpoint via GET /sse for an SSE stream, POST /messages?sessionId=... to send messages to an active SSE session, and ALL /mcp to interact with the MCP transport over a streamable HTTP channel. A sample MCP tool (for example, say-greeting) is registered and can be invoked by sending a JSON-RPC style request to /mcp, making this server suitable for testing and integration with MCP clients like VS Code’s MCP extension.

How to install

Prerequisites:

  • Node.js v14 or higher
  • npm (or yarn)

Install and run locally:

  1. Clone the repository: git clone <your-repo-url> cd remote-mcp-server-nodejs

  2. Install dependencies: npm install

  3. Create a .env file in the project root (example provided is PORT): PORT=3000

  4. Build the TypeScript source (optional if running via ts-node or prebuilt dist): npm run build

  5. Start the server: npm start

  6. Verify the server is running:

Additional notes

Tips and common considerations:

  • The server uses a .env file for configuration; ensure PORT is set if you don’t want the default 3000.
  • SSE connections at /sse will remain open for real-time MCP message streaming; make sure your MCP client supports SSE.
  • The /mcp endpoint supports streamable HTTP for MCP requests; this can be used by MCP clients that prefer streaming semantics over a single request/response cycle.
  • If you modify the code, run npm run build to transpile TypeScript to JavaScript in dist/ before starting the server.
  • Ensure your firewall/security groups allow inbound connections on the configured PORT.
  • If you encounter port conflicts, change PORT in .env or via environment variable when launching: PORT=4000 npm start

Related MCP Servers

Sponsor this space

Reach thousands of developers