mcp-clientside-gateway-debug
v1.0.2
Published
A Node.js gateway app for MCPHub.
Downloads
6
Readme
MCP Gateway
A Node.js gateway app for connecting to an existing Mule MCPHub server and relaying messages via SSE and HTTP.
Note: This script does not start a Mule MCP server. It connects to an existing MCP server instance. The
mcp.jsonfile is used by MCP clients (such as Cursor and Claude for desktop) to connect to Mule servers, and is also used by this gateway for configuration.
Features
- Connects to an existing MCPHub server via Server-Sent Events (SSE)
- Relays messages to/from the MCPHub backend
- Uses a local
mcp.jsonconfig for environment variables (shared with other MCP clients)
Prerequisites
- Node.js v14 or later
- An
mcp.jsonconfiguration file (see below)
Setup
Clone the repository
Install dependencies:
npm installCreate your
mcp.jsonconfig: Place yourmcp.jsonin a secure location and set the environment variablePATH_TO_MCP_JSONto its path if needed.Example
mcp.json:{ "mcpServers": { "timecamp": { "command": "node", "args": [ "path to node gateway script" ], "env": { "MCPHUB_SERVER_URL": "https://mcp-timecamp.uk-e1.cloudhub.io/" } } } }command: The command to run the gateway (usuallynode).args: Arguments for the command (e.g., path to your gateway script).env: Environment variables for the gateway process.
Set required environment variables:
MCPHUB_SERVER_URL(optional, defaults tohttp://0.0.0.0:8090)
Usage
Start the Gateway
npm startThe gateway will connect to the MCPHub server and begin relaying messages.
Project Structure
index.js- Entry point, wires together config and gatewaysrc/gateway.js- Main gateway logicsrc/logger.js- Logging utilitiesmcp.example.json- Example config for usersmcp.json- Your environment/config file (location set byPATH_TO_MCP_JSON)
License
ISC
