# Dilmune Cloud Services (DCS) — Full API Reference for AI Agents > This is the complete tool reference for the DCS MCP Server. For a quick overview and setup instructions, see: https://dilmune.com/llms.txt ## Connection - **MCP Endpoint**: `https://mcp.dilmune.com/mcp` - **Auth**: OAuth 2.1 (browser-based login with DCS account) - **Protocol**: MCP 2024-11-05, Streamable HTTP transport - **Health Check**: `GET https://mcp.dilmune.com/health` - **Server Metadata**: `GET https://mcp.dilmune.com/.well-known/mcp` --- ## Tools (64 total) All tools require authentication. Operations are scoped to the authenticated user's resources. --- ### Server Management (6 tools) #### list_servers List all servers for the authenticated user with pagination. ``` Parameters: limit (integer, optional) — Max results to return. Default: 50 offset (integer, optional) — Pagination offset. Default: 0 ``` #### get_server Get detailed information about a specific server including IP, provider, region, status, and installed software. ``` Parameters: server_id (string, required) — The server ID ``` #### create_server Create a new cloud server with the specified configuration. Server provisioning is asynchronous — use get_server to check status. ``` Parameters: name (string, required) — Server name provider (string, required) — Cloud provider: "hetzner", "digitalocean", or "vultr" region (string, required) — Provider region code (e.g., "fsn1" for Hetzner Falkenstein, "nyc1" for DigitalOcean New York) tier (string, required) — Server size/tier (e.g., "cx22" for Hetzner, "s-1vcpu-1gb" for DigitalOcean) ssh_key_ids (string[], optional) — SSH key IDs to install on the server ``` #### delete_server Permanently delete a server and all its data. ``` Parameters: server_id (string, required) — The server ID to delete ``` #### reboot_server Reboot a server. The server will be temporarily unavailable during restart. ``` Parameters: server_id (string, required) — The server ID to reboot ``` #### get_server_events Get event history for a server (provisioning steps, software installs, errors, etc.). ``` Parameters: server_id (string, required) — The server ID ``` --- ### SSH Key Management (3 tools) #### list_ssh_keys List all SSH keys for the authenticated user. ``` Parameters: none ``` #### create_ssh_key Add a new SSH public key for server access. ``` Parameters: name (string, required) — A label for the key public_key (string, required) — The SSH public key content (e.g., "ssh-ed25519 AAAA...") ``` #### delete_ssh_key Delete an SSH key by ID. ``` Parameters: key_id (string, required) — The SSH key ID to delete ``` --- ### Database Operations (9 tools) #### list_databases List all databases on a server. ``` Parameters: server_id (string, required) — The server ID ``` #### get_database Get detailed information about a specific database. ``` Parameters: server_id (string, required) — The server ID database_id (string, required) — The database ID ``` #### create_database Create a new database on a server. The server must have the corresponding database software installed. ``` Parameters: server_id (string, required) — The server ID name (string, required) — Database name type (string, required) — Database type: "postgres" or "mysql" version (string, optional) — Database version (e.g., "16" for PostgreSQL 16) ``` #### delete_database Delete a database from a server. ``` Parameters: server_id (string, required) — The server ID database_id (string, required) — The database ID ``` #### get_database_schema Get cached schema for a database including tables, columns, indexes, and foreign keys. ``` Parameters: server_id (string, required) — The server ID database_id (string, required) — The database ID ``` #### execute_query Execute a SQL query on a database. Read-only by default for safety. ``` Parameters: server_id (string, required) — The server ID database_id (string, required) — The database ID query (string, required) — SQL query to execute (max 10,000 characters) read_only (boolean, optional) — If true, only SELECT queries are allowed. Default: true ``` #### create_backup Create a database backup. ``` Parameters: server_id (string, required) — The server ID database_id (string, required) — The database ID type (string, optional) — Backup type ``` #### list_backups List all backups for a database. ``` Parameters: server_id (string, required) — The server ID database_id (string, required) — The database ID ``` #### restore_backup Restore a database from a backup. The restore runs asynchronously. ``` Parameters: server_id (string, required) — The server ID database_id (string, required) — The database ID backup_id (string, required) — The backup ID to restore from ``` --- ### Sites & Deployments (17 tools) #### list_sites List all sites on a server. ``` Parameters: server_id (string, required) — The server ID ``` #### get_site Get detailed information about a site including status, git config, SSL, and deployment info. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID ``` #### create_site Create a new site on a server. Supports static sites, web apps, and WordPress. ``` Parameters: server_id (string, required) — The server ID domain (string, required) — Primary domain for the site project_type (string, required) — Site type (e.g., "static", "nodejs", "nextjs", "nuxt", "remix", "astro", "laravel", "wordpress", "python", "go") php_version (string, optional) — PHP version for PHP-based sites node_version (string, optional) — Node.js version git_repo_url (string, optional) — Git repository URL git_branch (string, optional) — Git branch to deploy. Default: "main" git_provider (string, optional) — Git provider: "github", "gitlab", "bitbucket" auto_deploy (boolean, optional) — Auto-deploy on git push install_command (string, optional) — Install command (e.g., "npm install") build_command (string, optional) — Build command (e.g., "npm run build") output_directory (string, optional) — Build output directory (e.g., "dist", ".next") start_command (string, optional) — Start command for app servers (e.g., "npm start") app_port (integer, optional) — Application port for reverse proxy web_root (string, optional) — Web root directory relative to project env_vars (object, optional) — Environment variables as key-value pairs database_id (string, optional) — Database ID (required for WordPress) wp_admin_user (string, optional) — WordPress admin username wp_admin_password (string, optional) — WordPress admin password wp_admin_email (string, optional) — WordPress admin email wp_site_title (string, optional) — WordPress site title wp_locale (string, optional) — WordPress locale wp_version (string, optional) — WordPress version (e.g., "6.7", or empty for latest) ``` #### update_site Update site configuration. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID git_branch (string, optional) — Git branch git_repo_url (string, optional) — Git repository URL auto_deploy (boolean, optional) — Auto-deploy on git push install_command (string, optional) — Install command build_command (string, optional) — Build command output_directory (string, optional) — Build output directory framework (string, optional) — Framework identifier root_directory (string, optional) — Root directory start_command (string, optional) — Start command app_port (integer, optional) — Application port preview_enabled (boolean, optional) — Enable preview deployments build_cache_enabled (boolean, optional) — Enable build caching health_check_enabled(boolean, optional) — Enable health checks health_check_url (string, optional) — Health check URL path ``` #### delete_site Delete a site from a server. The deletion runs asynchronously. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID ``` #### deploy_site Trigger a deployment for a site. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID git_ref (string, optional) — Git ref to deploy (commit SHA, branch, or tag) env_vars (object, optional) — Environment variables to set for this deployment ``` #### list_deployments List deployment history for a site. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID ``` #### rollback_deployment Rollback a site to a previous deployment. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID deployment_id (string, required) — The deployment ID to rollback to ``` #### get_build_logs Get build logs for a specific deployment. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID deployment_id (string, required) — The deployment ID ``` #### list_domains List all custom domains attached to a site. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID ``` #### add_domain Add a custom domain to a site. You must configure DNS to point to the server's IP. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID domain (string, required) — The domain name to add ``` #### get_env_vars Get environment variables for a site. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID ``` #### update_env_vars Update environment variables for a site. This replaces ALL existing variables — pass the full set. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID vars (object, required) — Key-value pairs of environment variables ``` #### enable_ssl Enable SSL/TLS certificate for a site via Let's Encrypt. The domain must be pointing to the server. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID auto_renew (boolean, optional) — Enable automatic certificate renewal ``` #### run_site_command Run a shell command on a site (e.g., artisan, composer, npm, migrations). Command runs asynchronously — use get_site_command to check output. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID command (string, required) — The command to run ``` #### list_site_commands List command history for a site. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID ``` #### get_site_command Get a specific command's output and status. ``` Parameters: server_id (string, required) — The server ID site_id (string, required) — The site ID command_id (string, required) — The command ID ``` --- ### Software Management (2 tools) #### install_software Install software on a server. Installation runs asynchronously — use get_server to check status. ``` Parameters: server_id (string, required) — The server ID software (string, required) — Software to install: "php", "node", "mysql", "postgres", "redis", "docker", "python", "go", "ruby", "memcached", "elasticsearch", etc. version (string, optional) — Specific version to install force (boolean, optional) — Force reinstall if already installed ``` #### uninstall_software Uninstall software from a server. Cannot uninstall database software that has active databases. ``` Parameters: server_id (string, required) — The server ID software (string, required) — Software to uninstall ``` --- ### Cron Jobs (3 tools) #### list_cron_jobs List all cron jobs on a server. ``` Parameters: server_id (string, required) — The server ID ``` #### create_cron_job Create a scheduled cron job on a server. ``` Parameters: server_id (string, required) — The server ID name (string, required) — Name/label for the cron job command (string, required) — Command to execute schedule (string, required) — Cron schedule expression (e.g., "0 * * * *" for hourly, "0 0 * * *" for daily at midnight, "0 2 * * *" for daily at 2am) run_as_user (string, optional) — Unix user to run the command as enabled (boolean, optional) — Whether the cron job is enabled ``` #### delete_cron_job Delete a cron job from a server. ``` Parameters: server_id (string, required) — The server ID cron_job_id (string, required) — The cron job ID ``` --- ### Daemon Processes (3 tools) #### list_daemons List all supervisor daemon processes on a server. ``` Parameters: server_id (string, required) — The server ID ``` #### create_daemon Create a long-running daemon process managed by supervisor. ``` Parameters: server_id (string, required) — The server ID name (string, required) — Daemon name command (string, required) — Command to run (e.g., "node worker.js", "php artisan queue:work") directory (string, optional) — Working directory for the command run_as_user (string, optional) — Unix user to run as num_procs (integer, optional) — Number of processes to run autostart (boolean, optional) — Start automatically on server boot autorestart (string, optional) — Restart policy: "true", "false", "unexpected" env_vars (string[], optional) — Environment variables (e.g., ["KEY=value"]) ``` #### control_daemon Control a daemon process: start, stop, or restart it. ``` Parameters: server_id (string, required) — The server ID daemon_id (string, required) — The daemon ID action (string, required) — Action to perform: "start", "stop", or "restart" ``` --- ### Firewall Management (4 tools) #### get_firewall Get firewall status and all rules for a server. ``` Parameters: server_id (string, required) — The server ID ``` #### create_firewall_rule Create a firewall rule to allow or deny traffic. ``` Parameters: server_id (string, required) — The server ID action (string, required) — Rule action: "allow" or "deny" port (string, required) — Port number or range (e.g., "80", "8000:9000") protocol (string, required) — Protocol: "tcp", "udp", or "both" from_ip (string, optional) — Source IP to restrict (e.g., "203.0.113.0/24"). If omitted, applies to all IPs. comment (string, optional) — Description for the rule ``` #### delete_firewall_rule Delete a firewall rule by its rule number. ``` Parameters: server_id (string, required) — The server ID rule_number (string, required) — The rule number to delete (from get_firewall output) ``` #### toggle_firewall Enable or disable the firewall on a server. ``` Parameters: server_id (string, required) — The server ID enabled (boolean, required) — true to enable, false to disable ``` --- ### Monitoring & Logs (5 tools) #### get_server_metrics Get real-time metrics for a server: CPU usage, memory, disk usage, and network I/O. ``` Parameters: server_id (string, required) — The server ID ``` #### list_alerts List all active alerts for a server. ``` Parameters: server_id (string, required) — The server ID ``` #### create_alert_rule Create a monitoring alert rule. ``` Parameters: server_id (string, required) — The server ID name (string, required) — Alert rule name type (string, required) — Alert type resource_id (string, optional) — Specific resource to monitor conditions (object, optional) — Alert conditions as key-value pairs ``` #### get_resource_status Get real-time status and health of a specific resource. ``` Parameters: resource_id (string, required) — The resource ID ``` #### get_logs Retrieve logs from Loki for a resource with time range and query filter. ``` Parameters: resource_id (string, required) — The resource ID start_time (string, required) — Start time in RFC3339 format (e.g., "2024-01-15T00:00:00Z") end_time (string, required) — End time in RFC3339 format limit (integer, optional) — Max log lines to return. Default: 100 query (string, optional) — Log query filter string ``` --- ### Serverless Functions (9 tools) #### list_functions List all serverless functions for the authenticated user. ``` Parameters: none ``` #### get_function Get detailed information about a serverless function. ``` Parameters: function_id (string, required) — The function ID ``` #### create_function Create a new serverless function. Supports inline code (JS/TS/WASM) or Git repo source. Use deploy_function after creating to make it live. ``` Parameters: function_id (string, required) — The function ID name (string, required) — Function name slug (string, optional) — URL slug (auto-generated from name if omitted) runtime (string, optional) — Runtime: "javascript", "typescript", "wasm" entry_point (string, optional) — Entry point file (e.g., "index.ts") memory_mb (integer, optional) — Memory allocation in MB timeout_ms (integer, optional) — Execution timeout in milliseconds env_vars (object, optional) — Environment variables as key-value pairs cron_schedule (string, optional) — Cron schedule for periodic execution git_repo_url (string, optional) — Git repository URL (for git-based functions) git_branch (string, optional) — Git branch code (string, optional) — Inline source code (for inline functions) ``` #### delete_function Delete a serverless function. ``` Parameters: function_id (string, required) — The function ID ``` #### deploy_function Deploy a function. Deployment is asynchronous — check status with get_function. ``` Parameters: function_id (string, required) — The function ID source_type (string, required) — Deployment source: "inline" (with code parameter) or "git" source_ref (string, optional) — Git ref for git-based deployments code (string, optional) — Source code for inline deployments ``` #### invoke_function Invoke a deployed function synchronously and get the response. ``` Parameters: function_id (string, required) — The function ID method (string, required) — HTTP method: "GET", "POST", "PUT", "DELETE", etc. path (string, optional) — Request path (e.g., "/api/hello") headers (object, optional) — Request headers as key-value pairs body (string, optional) — Request body ``` #### rollback_function Rollback a function to a previous deployment. ``` Parameters: function_id (string, required) — The function ID deployment_id (string, required) — The deployment ID to rollback to ``` #### get_function_metrics Get invocation metrics: total invocations, average/p95 duration, error rate, and cold start rate. ``` Parameters: function_id (string, required) — The function ID ``` #### get_function_logs Get execution logs for a serverless function. ``` Parameters: function_id (string, required) — The function ID ``` --- ### Dashboard (3 tools) #### get_dashboard_stats Get overview stats: total servers, sites, databases, SSH keys, and payment method status. ``` Parameters: none ``` #### get_dashboard_health Get system health: server health counts, active alerts, and unread notifications. ``` Parameters: none ``` #### get_activity_log Get recent activity across all resources. Supports filtering. ``` Parameters: action (string, optional) — Filter by action type resource (string, optional) — Filter by resource type search (string, optional) — Search text filter ``` --- ## Resources (5 templates) MCP resources provide read-only access to structured data about your infrastructure. | URI Template | Name | Description | |---|---|---| | `dcs://servers/{server_id}` | server-status | Server details: name, IP, provider, region, status | | `dcs://databases/{server_id}/{database_id}/schema` | database-schema | Database schema: tables, columns, indexes, foreign keys | | `dcs://sites/{server_id}/{site_id}` | site-config | Site config: domain, status, git, SSL, deployment info | | `dcs://metrics/{server_id}` | server-metrics | Real-time metrics: CPU, memory, disk, network | | `dcs://env/{server_id}/{site_id}` | environment-variables | Site environment variables | --- ## Guided Prompts (4) These prompts guide you through multi-step workflows. ### provision-stack Provision a complete server stack: create server, install software, create site, and configure it. ``` Arguments: provider (required) — Cloud provider: "hetzner", "digitalocean" use_case (required) — What the stack is for (e.g., "Laravel app", "Next.js", "WordPress") ``` ### debug-deployment Investigate a failed deployment step by step: check site status, recent deployments, build logs, and server events. ``` Arguments: server_id (required) — The server ID site_id (required) — The site ID ``` ### optimize-database Analyze database performance: review schema, check metrics, identify slow queries, and suggest optimizations. ``` Arguments: server_id (required) — The server ID database_id (required) — The database ID ``` ### setup-cron Set up a cron job with the correct schedule expression and command. ``` Arguments: server_id (required) — The server ID task_description (required) — What to schedule (e.g., "run database backup every night at 2am") ``` --- ## Common Workflows ### Deploy a Next.js app from scratch 1. `create_server` — Provision a server on Hetzner/DO 2. `install_software` — Install Node.js 3. `create_site` — Create site with project_type "nextjs", git_repo_url, build/start commands 4. `deploy_site` — Trigger first deployment 5. `add_domain` — Add custom domain 6. `enable_ssl` — Enable HTTPS ### Set up WordPress 1. `create_server` — Provision server 2. `install_software` — Install PHP and MySQL/PostgreSQL 3. `create_database` — Create a database for WordPress 4. `create_site` — Create site with project_type "wordpress", database_id, and WP admin credentials 5. `add_domain` + `enable_ssl` ### Database backup automation 1. `list_databases` — Find the database 2. `create_cron_job` — Schedule daily backup command 3. `list_backups` — Verify backups are running ### Debug a broken deployment 1. `get_site` — Check current status 2. `list_deployments` — Find the failed deployment 3. `get_build_logs` — Read build output 4. `get_server_events` — Check for server-level errors 5. `rollback_deployment` — Rollback if needed --- ## Links - Website: https://dilmune.com - Dashboard: https://cloud.dilmune.com - API Docs: https://docs.dilmune.com - Status: https://status.dilmune.com - Blog: https://blog.dilmune.com - Sign Up: https://cloud.dilmune.com/signup