Connecting to your server

stdio, Streamable HTTP, preview host, and MCP client setup.

Transports

ModeCommandUse case
stdiopnpm devClaude Desktop, VS Code, Cursor
HTTPbitmcp dev --httpStreamable HTTP while developing
HTTPpnpm startProduction (bitmcp start always uses HTTP)

Environment variables:

  • MCP_TRANSPORTstdio or http
  • MCP_PORT — listen port for HTTP
  • MCP_HOST — bind address
  • MCP_PATH — HTTP path (default /mcp)
  • BITMCP_ROOT — project root when cwd differs
  • BITMCP_STATE_KEY — required in production HTTP for MRTR requestState

Default production URL

bitmcp start listens on http://127.0.0.1:3000/mcp by default.

Preview host

pnpm preview starts a local Apps host (default port 8787). It renders your View in a sandbox iframe and injects tool results. Use this to iterate on UI without waiting on a full MCP client.

stdio clients

Point your MCP client at the dev command:

{
  "command": "pnpm",
  "args": ["dev"],
  "cwd": "/path/to/my-app"
}

HTTP clients

Connect to the Streamable HTTP endpoint your server exposes. Host and Origin guards apply on localhost.

UI vs text-only hosts

UI-capable hosts advertise text/html;profile=mcp-app. bitmcp strips View metadata when the client cannot render Apps. Text and MRTR still work.

See Hosts for capability behavior.