Home
Docs / Configuration

Configuration

Point the generated server at your application, control its tools, and connect an MCP client.

Environment

Set values in .hive/mcp/.env, not in your application's public environment. The generated .env.example is the starting point.

.hive/mcp/.env
HIVE_APP_BASE_URL=http://localhost:3000
HIVE_MCP_PORT=3333

HIVE_APP_BASE_URL points to the app whose existing APIs the tools call. The MCP server listens on loopback at port 3333 by default.

HIVE_APP_BASE_URLHTTP(S) origin of your application. Default http://localhost:3000.
HIVE_MCP_PORTLoopback port for the MCP server. Default 3333.
HIVE_APP_BEARER_TOKENExisting bearer credential for your app's APIs.
HIVE_APP_COOKIEExisting session cookie for your app's APIs.
HIVE_FORWARD_AUTHSet to true to forward incoming Authorization or Cookie headers to the app.
HIVE_MCP_TOKENOptional bearer credential protecting the MCP endpoint. Never forwarded to the app.
HIVE_HTTP_TIMEOUT_MSTimeout for calls to your app, 1–120000 ms. Default 15000.
HIVE_ALLOWED_HOSTSExtra accepted Host values, such as a tunnel hostname. Requires a 24+ character HIVE_MCP_TOKEN.
HIVE_ALLOWED_ORIGINSExtra accepted browser Origins (exact match).
HIVE_LOGSet to off to disable the action log.
HIVE_LOG_ARGSSet to off to log calls without their arguments.

Application auth

If your app's APIs require authentication, configure an existing bearer token with HIVE_APP_BEARER_TOKEN or an existing cookie with HIVE_APP_COOKIE. Set HIVE_FORWARD_AUTH=true only when you intend to forward incoming Authorization or Cookie headers to the app. HIVE_MCP_TOKEN optionally protects the MCP endpoint and is never forwarded to the app.

Keep credential values out of source control and shared logs.

Connect a client

Run your app and the generated server, then configure a local MCP client with Streamable HTTP at:

MCP endpoint
http://127.0.0.1:3333/mcp

Only capabilities approved during review appear as tools. To use them from Claude or ChatGPT, host the server with deploy below.

Host on Vercel

To use the server from Claude or ChatGPT, host it on your own Vercel account with deploy. Everything about hosting, from the checks it runs to connecting each chat app, is on Deploy on Vercel.

terminal
npx @usehive/cli deploy --app-url https://myapp.com

Permissions

.hive/policy.json controls which tools the server offers. It holds a server mode (all, read-only, or off) and per-tool allow and deny entries. Regeneration never touches it, so commit it with your app.

terminal
npx @usehive/cli tools
npx @usehive/cli tools disable create_contact
npx @usehive/cli tools mode read-only

The HTTP server re-reads the policy on every request, so changes apply without a restart: disabled tools disappear from the tool list and calls to them are refused. Long-running stdio clients keep their tool list until restarted, but are still refused at call time. If the policy file cannot be parsed, every tool is disabled until you fix it.

Action log

Every tool call the server handles is appended to .hive/logs/actions.jsonl, which is git-ignored and rotated at 10 MB. Each entry records the time, tool, risk, outcome (ok, app_error, failed, or denied), your app's HTTP status, duration, transport, and User-Agent.

terminal
npx @usehive/cli logs --errors --since 2h

Arguments are logged with values under secret-looking keys, such as token, password, cookie, or API key, replaced by [redacted], and long strings truncated. Set HIVE_LOG_ARGS=off to log calls without arguments, or HIVE_LOG=off to turn the log off.

Remote access

The local server always binds to 127.0.0.1. For private testing without deploying, you can reach it through a tunnel instead. To do that, set the tunnel hostname and a random token of at least 24 characters. The server refuses to start with a host and no such token.

.hive/mcp/.env
HIVE_ALLOWED_HOSTS=your-tunnel.example.com
HIVE_MCP_TOKEN=<output of: openssl rand -hex 24>

Clients must send Authorization: Bearer <token>. This is one shared token for private testing, not per-user OAuth.

Check the setup

terminal
npx @usehive/cli doctor
npx @usehive/cli doctor --network

doctor checks the local project, generated files, dependencies, and manifest consistency. Add --network to also check that your app and the MCP server answer. It does not verify every application credential or API response.