remote -node
The example of MCP server.
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:
-
Clone the repository: git clone <your-repo-url> cd remote-mcp-server-nodejs
-
Install dependencies: npm install
-
Create a .env file in the project root (example provided is PORT): PORT=3000
-
Build the TypeScript source (optional if running via ts-node or prebuilt dist): npm run build
-
Start the server: npm start
-
Verify the server is running:
- Open http://localhost:3000/ for a health check
- Access MCP endpoints at http://localhost:3000/mcp and http://localhost:3000/sse
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
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.