MCP Integration
Connect your AI agent to While via the Model Context Protocol.
Connection
Get your API key from Settings → API Keys, or provision one via the admin endpoint.
Connect via SSE transport:
POST https://while.sh/mcp/sse Authorization: Bearer whl_your_api_key
Your agent auto-discovers all 43 available tools. No manual configuration of tool schemas needed.
Agent Configuration
Claude / Cursor / Windsurf (MCP config)
{
"mcpServers": {
"while": {
"url": "https://while.sh/mcp/sse",
"headers": {
"Authorization": "Bearer whl_your_api_key"
}
}
}
}Direct SSE connection
curl -N -H "Authorization: Bearer whl_..." \ https://while.sh/mcp/sse
Calling a tool
POST https://while.sh/mcp/tools/call
Authorization: Bearer whl_...
Content-Type: application/json
{
"name": "while.projects.create",
"arguments": { "name": "my-app" },
"sessionId": "optional-for-sse-streaming"
}Available Tools
43 tools across 11 modulesProjects
4 toolswhile.projects.createCreate a new project with staging + production environments
while.projects.listList all projects
while.projects.getGet project details by ID
while.projects.deleteDelete a project and all its resources
Deploy
4 toolswhile.deploy.triggerTrigger a new deployment for an environment
while.deploy.listList deployments for an environment
while.deploy.getGet deployment details and status
while.deploy.cancelCancel a pending or building deployment
Database
5 toolswhile.database.provisionProvision a managed PostgreSQL database for an environment
while.database.listList databases for an environment
while.database.getGet database details by ID
while.database.deleteDelete a managed database
while.database.credentialsGet database connection credentials
Domains
5 toolswhile.domains.addAdd a custom domain with auto-SSL via cert-manager
while.domains.listList domains for an environment
while.domains.removeRemove a custom domain and its SSL certificate
while.domains.statusGet domain status including SSL certificate state
while.domains.verifySslTrigger SSL certificate verification via cert-manager
Environment Variables
3 toolswhile.envvars.setSet or update an environment variable
while.envvars.listList environment variables (secrets masked)
while.envvars.deleteDelete an environment variable
Scale
3 toolswhile.scale.getGet the current replica count and status for a deployed app
while.scale.setScale an app to a specific number of replicas
while.scale.restartRestart all pods for a deployed app (rolling restart)
Errors
4 toolswhile.errors.ingestIngest an error from a running application with stack trace and deploy correlation
while.errors.listList errors for an environment, optionally filtered by status
while.errors.resolveMark an error as resolved
while.errors.summaryGet error count summary (open, resolved, total) for an environment
Performance
3 toolswhile.perf.getMetricsGet performance metrics (p50/p95/p99, throughput, error rate) over a time range
while.perf.getCurrentLatencyGet current latency snapshot: p50/p95/p99, throughput, error rate
while.perf.recordMetricsRecord a performance metric snapshot to the database
Uptime
5 toolswhile.uptime.createCreate an HTTP uptime check for an environment
while.uptime.listList all uptime checks for an environment
while.uptime.deleteDelete an uptime check
while.uptime.statusGet uptime status for all checks with current status
while.uptime.runRun an uptime check immediately and return the result
Logs
2 toolswhile.logs.queryQuery application logs with filters (level, limit, since)
while.logs.buildLogsGet build logs for a specific deployment
Webhooks
5 toolswhile.webhooks.createCreate a webhook to receive HTTP notifications when events occur
while.webhooks.listList all webhook subscriptions
while.webhooks.getGet webhook details by ID
while.webhooks.deleteDelete a webhook subscription
while.webhooks.testSend a test payload to a webhook URL to verify it works
API Key Scopes
API keys can be scoped to limit what tools are accessible:
fullAll tools — deploy, observe, manage, webhooks
deployDeploy, environment, database, and domain management
operateRuntime operations (scale, restart, env vars, webhooks)
read-onlyRead all data, no mutations
sensors-onlyObservability data only (errors, perf, uptime, logs)
Guardrails
Certain operations are protected by guardrails. If your agent receives a 403 response, it means a guardrail is blocking the action.
Blocks all deploys to production. Disable in guardrail settings.
Max deploys per hour exceeded. Wait for the window to reset.
Configure guardrails in Settings → Guardrails.