MCP Server Configuration: Environment Variables and Settings
MCP Server Configuration
Section titled “MCP Server Configuration”The Xplorr MCP server is configured through environment variables. There are only three, and only one is required.
Environment Variables
Section titled “Environment Variables”| Variable | Required | Default | Description |
|---|---|---|---|
XPLORR_API_TOKEN | Yes* | — | Your xplorr_ prefixed API token |
XPLORR_API_URL | No | https://api.xplorr.io | Override if self-hosting the Xplorr backend |
PORT | No | 3005 | Port 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.
Getting an API Token
Section titled “Getting an API Token”- Log in to console.xplorr.io
- Go to Settings > API Tokens
- Click Create Token and give it a name
- Copy the token (starts with
xplorr_)
Example .env File
Section titled “Example .env File”# Required — your Xplorr API tokenXPLORR_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=3005Pointing at a Self-Hosted Backend
Section titled “Pointing at a Self-Hosted Backend”If you run the Xplorr platform on your own infrastructure, set XPLORR_API_URL to your backend’s base URL:
XPLORR_API_TOKEN=xplorr_sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6XPLORR_API_URL=https://api.your-company.comThe 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.
Health Check Endpoint
Section titled “Health Check Endpoint”The server exposes a health endpoint at GET /health:
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 vs Multi-Tenant Mode
Section titled “Single-Tenant vs Multi-Tenant Mode”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-Tenant | Multi-Tenant | |
|---|---|---|
XPLORR_API_TOKEN env var | Set | Not set |
| Auth header from client | Not required | Required |
| Best for | Personal use, on-prem | Hosted 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.
Related Guides
Section titled “Related Guides”- MCP Overview — Deployment options and architecture
- Hosted MCP — Zero-setup hosted endpoint
- Self-Host with Docker — Run in a container
- Self-Host with Node.js — Run directly with Node
- API Authentication — Token creation and management