Skip to content
HostStack Docs

MCP Server

Connect Claude, Cursor, and any other MCP-capable agent to your HostStack team. 113 tools cover projects, services and dev boxes, deploys, environments, databases (incl. provisioning, read-only SQL and HA cluster ops), volumes, resource links, your own enrolled machines, domains and authoritative DNS records, env vars, cron, notification channels, alert events, runtime and build logs, and the team activity audit.

Dev boxes use a different tool. create_environment with type:"development" makes a project deploy target (alongside production/staging), not a cloud terminal. For an AI Dev Environment there are three, by where the box comes from: create_dev_environment (a bare box inside a project), create_standalone_dev_environment (one in the team's Development home, from a repo or blank, with optional companion databases), and spin_up_dev_environment (a running clone of an existing service, its env vars and its database) — see the Dev Environments guide.

Two ways to run it

Hosted — point your client at https://hoststack.dev/api/mcp with a Bearer API key. Nothing to install.

Local stdio npx -y @hoststack.dev/mcp runs the same server on your machine and talks JSON-RPC over stdin/stdout. Identical tool surface; no telemetry sent back.

Get an API key

Open /dashboard/settings/api-keys and create a key with full_access permission. The key is bound to a single team, so agents never need to pass teamId — every tool call operates on that team automatically.

Wire it into your client

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{
  "mcpServers": {
    "hoststack": {
      "command": "npx",
      "args": ["-y", "@hoststack.dev/mcp"],
      "env": {
        "HOSTSTACK_API_KEY": "hs_live_..."
      }
    }
  }
}

Cursor

Edit ~/.cursor/mcp.json or use Settings → MCP:

json
{
  "hoststack": {
    "command": "npx",
    "args": ["-y", "@hoststack.dev/mcp"],
    "env": {
      "HOSTSTACK_API_KEY": "hs_live_..."
    }
  }
}

Claude Code

claude mcp add hoststack --env HOSTSTACK_API_KEY=hs_live_... -- npx -y @hoststack.dev/mcp

Hosted (any client)

POST https://hoststack.dev/api/mcp
Authorization: Bearer hs_live_...
Content-Type: application/json

The endpoint speaks the streamable-HTTP MCP transport. Stateless — every request is independent; no session bookkeeping.

Generate config snippets

The CLI knows the shape each client expects, so you don't have to memorise it:

npx @hoststack.dev/mcp --print-config claude-desktop
npx @hoststack.dev/mcp --print-config cursor
npx @hoststack.dev/mcp --print-config claude-code

If HOSTSTACK_API_KEY is set in your shell, it gets baked into the snippet; otherwise you'll see a placeholder.

Tool inventory

projects
read: list_projects, get_project
write: create_project, update_project
No delete_project — the cascade takes every service, database and domain under it with it.
services
read: list_services, get_service, get_service_metrics, get_service_metrics_history, list_dev_environments, list_templates
write: create_service, create_dev_environment, create_standalone_dev_environment, spin_up_dev_environment, resize_dev_environment, delete_dev_environment, update_service, update_service_config, suspend_service, resume_service, delete_service
logs
read: get_service_logs, get_service_logs_bulk
write:
deploys
read: list_deploys, get_deploy, get_deploy_logs, diagnose_deploy
write: trigger_deploy, cancel_deploy
environments
read: list_environments
write: create_environment, update_environment, delete_environment, promote_deploy
databases
read: list_databases, get_database, get_database_cluster, list_database_backups, query_database
write: create_database, update_database, delete_database, suspend_database, resume_database, restart_database, upgrade_database_to_ha, upgrade_database_version
Credentials stay in the dashboard — query_database runs read-only SQL without ever handing the password to the agent. The nightly off-site dump is a SCHEDULE; list_database_backups is the evidence, and a database whose upload has failed every night looks identical from the outside to one backed up every night.
volumes
read: list_volumes, list_volume_backups
write: create_volume, update_volume, delete_volume, restore_volume
backupEnabled (on update_volume) says backups are being TAKEN; list_volume_backups says which ones EXIST. A volume backup is a block-level tar of a live disk — crash consistent, not application consistent — so a container running its own database wants a dump as well.
resource-links
read: list_managed_resources, list_service_resources
write: link_resource_to_service, unlink_resource_from_service
The middle step of the managed-database flow: create_database → link_resource_to_service → trigger_deploy. A link injects DATABASE_URL and friends on the NEXT deploy.
machines
read: list_machines, get_machine
write:
Enrolment is the dashboard or `hoststack machines add` — it needs a terminal on the machine itself.
domains
read: list_domains
write: add_domain, verify_domain, update_domain, remove_domain
dns
read: list_dns_zones, list_dns_records, get_dns_record, check_dns_delegation
write: create_dns_record, update_dns_record, delete_dns_record, resync_dns_record
check_dns_delegation answers the question a zone's own status cannot: whether the parent registry actually sends anyone here. A zone can be "active", signed and full of correct records while the registry still points the domain at its previous host — authoritative for nobody. Check it first when a zone looks healthy but the site is not live, a domain will not verify, or a certificate will not issue.
env-vars
read: list_env_vars
write: set_env_var, delete_env_var, bulk_set_env_vars
list_env_vars masks secret values.
cron
read: list_cron_executions, get_cron_execution
write:
alerts
read: list_alerts, list_notification_channels
write: create_notification_channel, update_notification_channel, delete_notification_channel, test_notification_channel
errors
read: list_error_issues, get_error_issue, list_ingest_keys
write: update_error_issue, fix_error_in_dev_box, create_ingest_key, delete_ingest_key
fix_error_in_dev_box turns a grouped exception into a briefed agent task in the project’s dev box.
uptime
read: get_uptime_check
write: set_uptime_check, delete_uptime_check
Not the deploy-time health check — this one requests the public URL from outside.
analytics
read: list_analytics_sites, check_analytics_site, get_analytics_summary, get_analytics_overview, get_site_uptime_check
write: create_analytics_site, update_analytics_site, verify_site_domain, set_site_uptime_check
Reading traffic, not recording it — events are posted to a public, write-only site key that never goes through this server. Check `visitorsAreSummedDailies` before quoting a 90d or 12mo visitor number.
dev-tasks
read: list_dev_tasks, get_dev_task
write: create_dev_task, update_dev_task
The dev box’s own backlog — what an agent running in a box has been asked to do, and what it has finished. Queue work for a box from outside it, or read back what it did.
activity-log
read: list_activity_log
write:
github
read: list_github_repos
write: sync_github_repos
A repo’s `github_repo_id` is a HostStack row id, not GitHub’s — `list_github_repos` is the only place to read it, and `create_service` also takes the `owner/name` form directly.
support
read:
write: report_issue
For a fault in the PLATFORM that you cannot act on from where you stand — not for a bug in your own code. Diagnostic context is attached server-side: pass `serviceId` and the service, its latest deploy and that deploy’s last 40 log lines go with the report. Opens a ticket the user can see and reply to.
meta
read: get_me, describe_mcp
write:

Design notes

  • Key-based env-var ops. set_env_var and delete_env_var take a key, not an ID — the MCP looks up the existing var by key first, then patches or deletes.
  • Secret values stay masked. list_env_vars returns •••••• for any row stored as a secret. Masking happens on the API server, so secrets never reach the agent.
  • Logs are snapshots. get_service_logs and get_deploy_logs return a tail (default 200 lines, max 1000); re-call to get newer entries. For live tails, use the dashboard's logs page.
  • One deliberate gap: the project cascade. There is no delete_project — deleting a project takes every service, database, domain and volume under it with it, and that is a confirmation a person should give in the dashboard. Everything one level down an agent can do: delete_service, delete_database, delete_volume and delete_environment are all registered, so an agent asked to tear down what it created can.

Telemetry

When you use the hosted transport, we record one row per tool call: tool name, duration, ok/error, and a non-reversible hash of the input args — never the args themselves. Used for the analytics page and on-call alerts on tool error spikes. Retained 30 days, then deleted by a daily cron.

The local stdio install records nothing on our side. Set HOSTSTACK_MCP_TRACE=1 to emit NDJSON traces to your own stderr for local debugging.

Environment variables

HOSTSTACK_API_KEY — required. hs_live_… for prod, hs_test_… for the test team.
HOSTSTACK_BASE_URL — optional override. Default https://hoststack.dev.
HOSTSTACK_MCP_TRACE — set to 1 for NDJSON per-tool-call traces on stderr (local only, never sent to HostStack).

Essential cookies only — for login sessions. No tracking. Details