Skip to content

Direct Node.js — Streamable HTTP

The direct Node.js service defaults to loopback and exposes Streamable HTTP at POST /mcp plus a small health endpoint at GET /health.

Direct Node.js — Streamable HTTP on loopback
git clone https://github.com/enthouan/simplelogin-mcp.git
cd simplelogin-mcp
corepack enable
pnpm install --filter simplelogin-mcp --frozen-lockfile
cp .env.example .env
# Keep TRANSPORT=http, HOST=127.0.0.1, and PORT=3000; set SL_API_KEY in .env
${EDITOR:-vi} .env
grep -Eq '^SL_API_KEY=.+$' .env || { echo 'Set SL_API_KEY in .env before starting.' >&2; exit 1; }
pnpm build
# Load the file without putting the key in shell history or the parent shell
(
set -a
. ./.env
set +a
pnpm start
)

Connect to POST http://127.0.0.1:3000/mcp. A direct loopback run does not require MCP_AUTH_TOKEN. The server refuses a wider bind without it unless the explicit unsafe override is enabled; supported wider deployments use the token and TLS.

  1. Start on loopback. Keep HOST=127.0.0.1 for same-machine access. Set any tool selection in the server’s environment before launch. The selection applies to every client of this endpoint.
  2. Verify health. Request http://127.0.0.1:3000/health.
  3. Register the endpoint. Point a Streamable HTTP client at http://127.0.0.1:3000/mcp.
  4. Add authorization when configured. Send Authorization: Bearer <token> whenever MCP_AUTH_TOKEN is set.

Browser requests to POST /mcp must come from loopback or an exact origin listed in MCP_ALLOWED_ORIGINS. This allowlist protects the MCP route from hostile browser origins. It does not add CORS response headers, handle preflight requests, or replace authentication.

The health endpoint checks the HTTP process. Use MCP discovery to verify which tools it exposes.

Verify it works

Connect your client to initialize the server, then open its tool list. InMCP Inspector, connect with the same stdio command and environment or the same HTTP URL and bearer token. OpenTools to see the names returned by tools/list. TheProtocol tab shows the response in the server's order.

Compare the returned names with your configured selection. For the alias inspection example, expect exactly alias_list, alias_get, and alias_activity_list, in that order. Discovery makes no SimpleLogin API request.

Use Operations for process inspection, credential rotation, upgrades, rollback, and shutdown.