Skip to content

MCP Server Configuration: Environment Variables and Settings

The Xplorr MCP server is configured through environment variables. There are only three, and only one is required.

VariableRequiredDefaultDescription
XPLORR_API_TOKENYes*Your xplorr_ prefixed API token
XPLORR_API_URLNohttps://api.xplorr.ioOverride if self-hosting the Xplorr backend
PORTNo3005Port the MCP HTTP server listens on

*Required in single-tenant (self-hosted) mode. In multi-tenant mode (hosted), the token is passed per-request via Authorization: Bearer xplorr_... headers.

  1. Log in to console.xplorr.io
  2. Go to Settings > API Tokens
  3. Click Create Token and give it a name
  4. Copy the token (starts with xplorr_)
Terminal window
# Required — your Xplorr API token
XPLORR_API_TOKEN=xplorr_sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
# Optional — override for on-prem Xplorr deployments
# XPLORR_API_URL=https://api.your-company.com
# Optional — change the listen port (default: 3005)
# PORT=3005

If you run the Xplorr platform on your own infrastructure, set XPLORR_API_URL to your backend’s base URL:

Terminal window
XPLORR_API_TOKEN=xplorr_sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
XPLORR_API_URL=https://api.your-company.com

The MCP server appends /api/v1/... to this URL for all API calls. Make sure the backend is reachable from the machine running the MCP server.

The server exposes a health endpoint at GET /health:

Terminal window
curl http://localhost:3005/health
{
"status": "ok",
"service": "xplorr-mcp",
"tools": 26,
"mode": "single-tenant"
}

Use this for container health checks, load balancer probes, or just verifying the server is running.

Single-tenant mode activates when XPLORR_API_TOKEN is set as an environment variable. All requests use that token. This is how self-hosted deployments work — one token, one org.

Multi-tenant mode activates when XPLORR_API_TOKEN is NOT set. The server expects each incoming request to include an Authorization: Bearer xplorr_... header. This is how the hosted endpoint at https://mcp.xplorr.io/mcp works — each user sends their own token.

Single-TenantMulti-Tenant
XPLORR_API_TOKEN env varSetNot set
Auth header from clientNot requiredRequired
Best forPersonal use, on-premHosted endpoint, multi-user

Can I run multiple instances with different tokens? Yes. Each instance is independent. Run one per org or per user if needed.

What happens if the token is invalid? The MCP server returns an error on the first tool call. It validates the token during the exchange flow, not at startup.

Can I change the port in the hosted version? No. The hosted endpoint at https://mcp.xplorr.io/mcp is fixed. You only control the port when self-hosting.