Configuration
bitmcp.config.ts, HTTP options, and environment variables.
bitmcp.config.ts
import { defineConfig } from "bitmcp";
export default defineConfig({
name: "bitmcp-app",
version: "0.0.1",
deploy: "node",
cacheTtlMs: 60_000,
stateKeyEnv: "BITMCP_STATE_KEY",
requireStateKey: undefined,
http: {
path: "/mcp",
cors: true,
allowedHosts: ["example.com"],
allowedOrigins: ["https://example.com"],
},
vite: {
resolve: { alias: { "@app": "./src" } },
},
});Name and version can also come from package.json when omitted.
requireStateKey defaults to true when NODE_ENV=production.
deploy defaults to "node". "vercel" makes bitmcp build write api/mcp.js. "cloudflare" uses dist/server.js as the Worker entry. Scaffold with create-bitmcp --deploy vercel or --deploy cloudflare so the matching vercel.json or wrangler.jsonc is created.
Environment variables
| Variable | Description |
|---|---|
BITMCP_ROOT | Project root for CLI runtime |
BITMCP_STATE_KEY | Shared HMAC key for MRTR requestState |
MCP_TRANSPORT | stdio or http |
MCP_PORT | HTTP listen port |
MCP_HOST | HTTP bind host |
MCP_PATH | HTTP path (must match exactly, default /mcp) |
NODE_ENV | production requires a state key unless overridden |
Defaults
Production HTTP listens on 127.0.0.1:3000/mcp.
Preview listens on port 8787 by default.