Documentation
¶
Overview ¶
Command levelrail-mcp is an MCP (Model Context Protocol) server that lets an AI agent manage a control plane deployment through the same versioned REST API (internal/api, mounted at /api/v1) cmd/levelrail-cli already drives: see internal/apiclient's own doc comment, and internal/store/tokens.go's APIToken doc comment on why a bearer token was always meant to authenticate "a CLI, an MCP server, or a third-party integration" alike. Every tool below is a thin wrapper around one REST call; there is no special internal access, and a token scoped to fewer abilities than a tool needs gets back the same 403 the REST API itself would return (internal/api/router.go's own comment on why the scoped-ability token system exists).
Configuring an MCP client ¶
Add this to Claude Desktop's/Claude Code's MCP server config, using an API token minted via "levelrail-cli auth login" or "levelrail-cli tokens create":
{
"mcpServers": {
"levelrail": {
"command": "levelrail-mcp",
"args": [],
"env": {
"APP_API_TOKEN": "<your API token>",
"APP_API_URL": "http://localhost:8080"
}
}
}
}
If levelrail-cli has already been configured on the same machine (its own "auth login" writes ~/.config/levelrail-cli/credentials), this server picks up the same token and URL automatically and the env block above can be omitted entirely; --token/--api-url flags and the APP_API_TOKEN/APP_API_URL env vars still take precedence when set, exactly like the CLI's own resolution order.
Source Files
¶
- config.go
- main.go
- tools_alerts.go
- tools_app_config.go
- tools_apps.go
- tools_audit.go
- tools_backup_targets.go
- tools_backups.go
- tools_certificates.go
- tools_cloudflare.go
- tools_databases.go
- tools_deploy_compare.go
- tools_diagnose.go
- tools_domains.go
- tools_environments.go
- tools_flags.go
- tools_iam.go
- tools_log_drains.go
- tools_metrics.go
- tools_nodes.go
- tools_notifications.go
- tools_orgs.go
- tools_previews.go
- tools_promote.go
- tools_registry.go
- tools_resource_recommendation.go
- tools_scheduled_tasks.go
- tools_settings.go
- tools_system.go
- tools_templates.go
- tools_volume_backups.go
- tools_webhooks.go