Repository navigation
HTTP Transport
This page describes the HTTP transport modes supported by the TP-Link Omada MCP server and how they map to MCP protocol versions.
The server can run:
- Over stdio (default)
- Over HTTP, with either:
-
Streamable HTTP (
MCP_HTTP_TRANSPORT=stream, default) -
HTTP+SSE (legacy) (
MCP_HTTP_TRANSPORT=sse)
-
Streamable HTTP (
The implementation uses @modelcontextprotocol/sdk/server/mcp.js and adheres to the official MCP specifications.
Set:
export MCP_SERVER_USE_HTTP=true
npm run dev # or: npm startBy default, the server will:
- Listen on
127.0.0.1:3000 - Use Streamable HTTP (
MCP_HTTP_TRANSPORT=stream) - Expose:
- MCP endpoint at
/mcp - Healthcheck at
/healthz
- MCP endpoint at
You can customize these via environment variables detailed in Configuration.
MCP protocol version: 2025-03-26
Transport spec: MCP HTTP with SSE (Stream)
From the project README:
- Single endpoint for all operations (GET, POST, DELETE)
- Server-Sent Events for streaming responses
- Built-in session management with cryptographic session IDs
- Optional stateless mode (when
MCP_SERVER_STATEFUL=false)
By default (can be changed via MCP_HTTP_PATH):
-
GET /mcp– establish SSE stream and initialize a session -
POST /mcp– send JSON-RPC messages (MCP requests) -
DELETE /mcp– terminate the session
export MCP_SERVER_USE_HTTP=true
export MCP_HTTP_TRANSPORT=stream
export MCP_HTTP_PORT=3000
export MCP_HTTP_PATH=/mcp
npm run devYour MCP client then:
- Makes a
GET /mcprequest to open the SSE stream. - Sends JSON-RPC payloads to
POST /mcp. - Optionally sends
DELETE /mcpto close the session.
MCP protocol version: 2024-11-05
Transport spec: MCP HTTP with SSE (legacy)
This mode is provided for backward compatibility with older MCP clients.
- Uses separate endpoints for streaming and messages:
-
GET /sse– SSE connection -
POST /messages– JSON-RPC messages
-
- Does not use the combined
/mcpendpoint.
export MCP_SERVER_USE_HTTP=true
export MCP_HTTP_TRANSPORT=sse
npm run devBy default:
- Event stream:
GET /sse - Message endpoint:
POST /messages
MCP_HTTP_PATH can be used to customize these paths (see implementation in src/server/sse.ts).
Both transports implement protections against DNS rebinding and unauthorized cross-origin access.
The server validates the Origin header on incoming HTTP requests.
Configure allowed origins with:
-
MCP_HTTP_ALLOWED_ORIGINS– defaults to127.0.0.1, localhost.
You can set:
MCP_HTTP_ALLOWED_ORIGINS=127.0.0.1, localhost, myhost.localFor development, you can use * to allow all origins (not recommended for production):
MCP_HTTP_ALLOWED_ORIGINS=*By default, the server listens on 127.0.0.1:
MCP_HTTP_BIND_ADDR=127.0.0.1To expose the server on your network, you can set:
MCP_HTTP_BIND_ADDR=0.0.0.0This should be combined with proper firewalling and possibly an additional authentication layer, as the Omada MCP server itself assumes local/trusted deployment.
If MCP_HTTP_ENABLE_HEALTHCHECK=true (default), the server exposes a healthcheck endpoint:
-
GET /healthzby default, configurable viaMCP_HTTP_HEALTHCHECK_PATH.
Example:
curl http://127.0.0.1:3000/healthzUse this for monitoring and readiness checks in container orchestrators.
You can expose the HTTP MCP server to the Internet using ngrok.
Set:
export MCP_HTTP_NGROK_ENABLED=true
export MCP_HTTP_NGROK_AUTH_TOKEN=your-ngrok-auth-token
npm run devThe server will automatically open a tunnel and log the public URL.
Alternatively, run:
ngrok http 3000This forwards a public HTTPS URL to http://localhost:3000.
Note: Some intermediaries may strip custom headers like
Mcp-Session-Id. If that happens, setMCP_SERVER_STATEFUL=falseto disable server-managed sessions and allow stateless operation.
If MCP_SERVER_USE_HTTP is not set or false, the server runs over stdio:
npm startAn MCP client (such as Claude Desktop) can then be configured with:
- Command:
npm start(or an equivalent containerized wrapper) - Environment: your
.envfile with Omada and server settings
For dev mode (auto-reload):
npm run devFor details on tools exposed over any transport, see Tools.