Skip to content

MCP server

Let Claude, Cursor, Codex or any other MCP client manage your HostStack team — deploy, read logs, add databases and domains — with the same permissions as an API key.

How it works

The HostStack MCP server exposes 132 tools over the Model Context Protocol. Every tool call goes through the same API routes as the dashboard, the CLI and the SDK, so permissions, rate limits and the activity log apply the same way.

You can run it two ways, with the same tools either way:

HostedLocal
Wherehttps://hoststack.dev/api/mcpnpx -y @hoststack.dev/mcp
TransportStreamable HTTP, statelessstdio
AuthAuthorization: Bearer hs_live_... headerHOSTSTACK_API_KEY environment variable
InstallNothingNode.js 18 or later

The API key decides everything: it is bound to one team, so no tool takes a team id, and a tool can only do what the key is allowed to do.

Connect a client

  1. Create an API key

    In the dashboard, open Settings → API keys and create a key with Full Access permission. The default, Deploy Only, is refused by the tools that need full access, with This endpoint requires an API key with full_access permission.

  2. Add the server to your client

    Pick your client. The local tabs run the server on your machine with npx; the hosted tab needs nothing installed.

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

    Claude Desktop reads ~/Library/Application Support/Claude/claude_desktop_config.json on macOS and %APPDATA%\Claude\claude_desktop_config.json on Windows. Cursor reads ~/.cursor/mcp.json. Restart the client after editing either.

  3. Check the connection

    Ask the agent which HostStack team it is connected to. It calls get_me and answers with your team’s name.

Generate a config snippet

The package prints the config for three clients, so you don’t have to type it. If HOSTSTACK_API_KEY is set in your shell it goes into the snippet; otherwise you get a placeholder to replace.

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

claude-code prints a claude mcp add command and claude-desktop a whole config file. cursor prints only the hoststack entry — paste it inside mcpServers. --help and --version also work without a key.

Local server settings

These apply to the local server only; the hosted one reads the header.

HOSTSTACK_API_KEY
stringrequired

An hs_live_... or hs_test_... key. Needed to serve; not needed for --help, --version or --print-config.

HOSTSTACK_BASE_URL
string

The API host the tools call.

Default: https://hoststack.dev

HOSTSTACK_MCP_TRACE
string

Set to 1 to write one JSON line per tool call — tool, duration, ok or error — to stderr, for a local trace (2> mcp-trace.log). Nothing is sent to HostStack.

Prompts and resources

Besides tools, the server offers three prompts your client can list and run:

diagnose_failed_deploy
service_id

Finds a service’s most recent failed deploy, reads its logs and proposes a fix. It stops at the suggestion and never redeploys on its own.

deploy_status_check

A short status report: who you are, what’s running, what’s deploying, and recent activity.

rotate_secret
service_id, key

Rotates one secret env var. The agent asks you for the new value instead of generating it, and asks before redeploying.

And one resource, hoststack://team: the team, the user behind the key, project and service counts, and the first ten of each — enough for an agent to orient itself without a round of list calls.

Tool reference

132 tools in 22 groups, one section per group below. Read tools change nothing; Write tools create, change or delete something, so clients that ask before acting will ask for these. Each tool’s own description — what your agent sees — carries the full inputs, return shape and examples.

Most tools take the public ids you see in the dashboard (svc_..., prj_..., dpl_...). The error-tracking, uptime and site tools take numeric ids instead, which their list tools return.

Identity and build

ToolAccessWhat it does
get_meReadThe user and team the API key is bound to.
describe_mcpReadThe server’s package version, how many tools it registers, and whether the dev box tools are present. Touches no account data.

Call get_me first in a session to confirm which team the key acts on.

Projects

ToolAccessWhat it does
list_projectsReadEvery project in the team.
get_projectReadOne project by id.
create_projectWriteCreate a project.
update_projectWriteRename a project or change its description.

There is no delete_project: deleting a project takes every service, database, domain and volume under it, and that is a confirmation a person should give in the dashboard. Everything one level down can be deleted by an agent.

Services and dev boxes

ToolAccessWhat it does
list_servicesReadServices in the team, filterable by project, environment, status, type and dev box.
get_serviceReadOne service with its status and full config: resources, health check, scaling, restart policy.
get_service_metricsReadLatest CPU, memory, network and request rate.
get_service_metrics_historyReadCPU, memory, network and disk as a time series.
list_dev_environmentsReadThe team’s dev boxes, each with its companion services.
list_templatesReadStack templates (Next.js, Django …) and one-click apps (WordPress, Ghost, n8n …) that create_service accepts.
create_serviceWriteCreate a service from a Git repo or a prebuilt Docker image, with env vars and links in the same call.
create_dev_environmentWriteCreate a dev box inside a project, with a persistent /workspace and the API keys set, and start it.
create_standalone_dev_environmentWriteCreate a dev box in the team’s Development area from a GitHub repo, any clone URL or blank, with optional Postgres, Redis or Meilisearch.
spin_up_dev_environmentWriteCreate a dev box from an existing service: repo cloned, env vars copied, linked database cloned.
resize_dev_environmentWriteMove a dev box (or any service) to a different size.
set_dev_box_hardwareWriteGive a dev box on your own machine that machine’s graphics card, or all of its memory instead of its plan’s.
delete_dev_environmentWriteDelete a dev box together with its cloned database and /workspace volume.
update_serviceWriteRename a service.
update_service_configWriteChange build and runtime config: commands, branch, health check, resources, scaling, plan, log filter rules.
suspend_serviceWriteStop all instances and pause auto-deploys; the config is kept.
resume_serviceWriteStart a suspended service and re-enable auto-deploys.
delete_serviceWriteDelete a service with its volumes, env vars, domains and deploy history. Irreversible.

A dev box is a cloud workspace an agent codes in. It is not a project environment — create_environment with type "development" makes a deploy target next to production and staging, not a box.

Deploys

ToolAccessWhat it does
list_deploysReadA service’s deploys, newest first.
get_deployReadOne deploy: status, commit and timestamps.
get_deploy_logsReadBuild and deploy log for one deploy, paged.
diagnose_deployReadThe deploy record, the build log tail and the runtime log tail from the deploy’s start, in one call.
trigger_deployWriteDeploy the branch head, or a given commit or branch.
cancel_deployWriteStop a running deploy; the previous release keeps serving.

get_deploy_logs returns up to 500 log entries per call (at most 5,000) and a nextAfterId cursor; pass it back as after_id for the next page.

Runtime logs

ToolAccessWhat it does
get_service_logsReadRecent runtime output (stdout/stderr), filterable by time, stream, level and text, or just counted.
get_service_logs_bulkReadThe same for several services at once, keyed by service id.

Logs are snapshots, not a stream: get_service_logs returns the last 200 lines by default and at most 1,000. Call it again for newer lines, or use the service’s Logs tab to follow live.

Environments

ToolAccessWhat it does
list_environmentsReadA project’s environments: production, staging, development, preview.
create_environmentWriteCreate an environment in a project.
update_environmentWriteRename it, protect it, or make it the project default.
delete_environmentWriteDelete an environment.
promote_deployWriteRun an already-built deploy in another environment, without rebuilding.

Databases

ToolAccessWhat it does
list_databasesReadManaged databases in a project.
get_databaseReadOne database: status, engine, version. No credentials.
get_database_clusterReadMembers and failover history of an HA Postgres cluster.
list_database_backupsReadThe off-site archives a database can be restored from.
query_databaseReadRun one read-only SQL statement against a managed Postgres.
create_databaseWriteProvision Postgres, Redis, MySQL, MariaDB or MongoDB in a project.
update_databaseWriteRename, change plan, or grow the disk.
delete_databaseWriteDelete a database and all its data.
suspend_databaseWriteStop the container and keep the data.
resume_databaseWriteStart a suspended database; its URL is unchanged.
restart_databaseWriteRestart in place — a few seconds of downtime, same URL.
upgrade_database_to_haWriteMigrate a single-node Postgres to a three-node HA cluster.
upgrade_database_versionWriteUpgrade Postgres or Redis to a newer major version in place; URLs stay valid.

No tool returns database credentials — an app gets them by being linked (see Resource links), and query_database runs read-only SQL without the password ever reaching the agent. The nightly off-site dump is a schedule; list_database_backups is the evidence that one exists.

ToolAccessWhat it does
list_managed_resourcesReadEvery managed resource in the team — databases, buckets, queues, search, email domains — with the numeric id a link needs.
list_service_resourcesReadWhat is linked to a service and injected on deploy.
link_resource_to_serviceWriteInject a resource’s connection details into a service as env vars.
unlink_resource_from_serviceWriteRemove a link; the resource itself is kept.

The middle step of adding a database: create_database, then link_resource_to_service, then trigger_deploy. A link injects DATABASE_URL, REDIS_URL or MONGO_URL on the next deploy.

Volumes

ToolAccessWhat it does
list_volumesReadPersistent disks attached to a service.
list_volume_backupsReadThe archives a volume can be restored from.
create_volumeWriteAttach a disk; it is mounted on the next deploy.
update_volumeWriteChange the mount path, grow the size, or switch backups on or off.
delete_volumeWriteDetach a volume and destroy the disk.
restore_volumeWriteUnpack an archive over the volume. Destructive, not reversible.

backup_enabled says backups are being taken; list_volume_backups says which ones exist. A volume backup is a file-level copy of a live disk, taken file by file with nothing paused — not a point-in-time snapshot — so a database running on a volume wants its own dump as well.

Environment variables

ToolAccessWhat it does
list_env_varsReadA service’s variables, secrets masked.
set_env_varWriteCreate or update one variable by key.
delete_env_varWriteDelete one variable by key.
bulk_set_env_varsWriteAdd or update several variables at once; others are left alone. mode "replace" also removes every variable not listed, and returns the removed keys.

set_env_var and delete_env_var take the key (case-sensitive), not an id. list_env_vars masks secret values as ••••••, on the server, so secrets never reach the agent.

Domains

ToolAccessWhat it does
list_domainsReadEvery custom domain in the team.
add_domainWriteAttach a hostname, optionally to a service; returns the DNS targets.
verify_domainWriteCheck the DNS targets and issue the certificate.
update_domainWriteMake a domain the service’s primary hostname, or change SSL, redirect and trailing-slash handling.
remove_domainWriteDetach a hostname; it stops routing immediately.

DNS

ToolAccessWhat it does
list_dns_zonesReadHosted DNS zones.
list_dns_recordsReadEvery record in a zone.
get_dns_recordReadOne record, with its sync status.
check_dns_delegationReadWhether the parent registry really delegates the zone to HostStack, read live.
create_dns_recordWriteCreate a record.
update_dns_recordWriteChange a record’s type, name, value, TTL or priority.
delete_dns_recordWriteDelete a record.
resync_dns_recordWriteRe-push a record stuck at failed without changing it.

A zone can be active, signed and full of correct records while the registry still points the domain at its previous host. check_dns_delegation reads the registry live — run it first when a zone looks healthy but the site is not live, a domain will not verify or a certificate will not issue.

Your own machines

ToolAccessWhat it does
list_machinesReadYour enrolled machines, whether they are online, and counts of what runs on each.
get_machineReadOne machine and everything running on it.

Read-only on purpose: enrolling a machine means running an installer on it, which needs a person at that machine. Use the dashboard or `hoststack machines add`. The tools give an agent the machine id to pass as `machine` when creating a service, database or dev box.

Cron

ToolAccessWhat it does
list_cron_executionsReadRecent runs of a cron job, newest first.
get_cron_executionReadOne run: status, exit code, timing.

Dev box tasks

ToolAccessWhat it does
list_dev_tasksReadA project’s task backlog.
get_dev_taskReadOne task with its full prompt.
list_dependency_statusReadHow far behind every repo is: the latest weekly dependency scan per repo, advisories and majors.
create_dev_taskWriteFile a task, optionally pinned to a dev box.
update_dev_taskWriteEdit a task, or mark it done or back to idea.
update_dependency_updatesWriteTurn weekly dependency updates on or off, pick the box that runs them, allow auto-ship.

A project’s agent backlog — the list under Development → Tasks. Queue work for a box from outside it, or read back what it did.

Alerts and notification channels

ToolAccessWhat it does
list_alertsReadRecent alerts: failed deploys, health and uptime failures, new errors, certificate and backup failures and more.
list_notification_channelsReadSlack, Discord and email channels, with the events each receives.
create_notification_channelWriteCreate a channel and subscribe it to events.
update_notification_channelWriteRename, turn on or off, or change events. The URL and type cannot change.
delete_notification_channelWriteDelete a channel.
test_notification_channelWriteSend a test message to a channel.

Error tracking

ToolAccessWhat it does
list_error_issuesReadExceptions your apps reported, grouped by cause.
get_error_issueReadOne issue with its recent stack traces.
list_ingest_keysReadA service’s error-ingest keys (prefixes only).
update_error_issueWriteResolve, ignore or reopen an issue.
fix_error_in_dev_boxWriteTurn an issue into a coding-agent task in the project’s dev box.
create_ingest_keyWriteMint a write-only key a service reports errors with.
delete_ingest_keyWriteRevoke an ingest key immediately.

Uptime checks

ToolAccessWhat it does
get_uptime_checkReadA service’s uptime check and its last result.
set_uptime_checkWriteCreate or change a service’s uptime check.
delete_uptime_checkWriteRemove the check. An open alert is left as it stands.

Not the deploy-time health check: an uptime check requests the service’s public URL from outside, on a schedule.

Web analytics

ToolAccessWhat it does
list_analytics_sitesReadTracked sites, their keys, retention and service.
check_analytics_siteReadWhy a site is reporting nothing.
get_analytics_summaryReadVisitors, pageviews, bounce rate and visit length per site, against the previous period.
get_analytics_overviewReadThe full breakdown for a site: paths, referrers, events, devices, countries, campaigns.
get_search_console_overviewReadGoogle Search clicks, impressions, queries and index state for sites linked to Search Console, against the previous period.
get_search_console_detailReadOne page’s queries, or one query’s pages, with its daily series and the previous period.
get_search_console_statusReadWhether a site’s Search Console link is pending, active, still pulling its first 90 days, or broken.
get_bing_overviewReadBing clicks and impressions per day, weekly top queries and pages, crawl figures and sitemaps.
get_bing_statusReadWhether a site is linked to Bing, still pulling, or paused for a missing key or unverified site.
get_site_uptime_checkReadA tracked site’s uptime check.
get_site_auditRead
get_keyword_opportunitiesRead
research_keywordsRead
get_google_ads_statusReadWhether the team’s Google Ads is connected for Keyword Planner volumes and click prices.
create_analytics_siteWriteStart tracking a domain; returns the script tag.
update_analytics_siteWriteChange origins, name, retention or service.
purge_analytics_pathsWriteDelete what a site recorded under one path, e.g. a leaked token.
verify_site_domainWriteProve you own a site’s domain with a TXT record.
set_site_uptime_checkWriteWatch a site hosted elsewhere and alert when it stops answering.
connect_search_consoleWriteStart linking a site to Search Console; returns a link the owner opens to finish it.
disconnect_search_consoleWriteUnlink a site from Search Console, remove its search data and revoke the Google grant.
connect_bingWriteLink one site, or every site, to Bing Webmaster Tools with the team’s saved Bing key.
disconnect_bingWriteUnlink a site from Bing and remove its Bing data.
disconnect_google_adsWriteRemove the team’s Google Ads connection.
run_site_auditWrite

These read traffic; they do not record it — pageviews are sent with a public site key and never pass through this server. Beyond a site’s raw-event window, visitors are summed daily uniques; check visitorsAreSummedDailies before quoting a 90-day or 12-month visitor number.

Activity log

ToolAccessWhat it does
list_activity_logReadThe team’s audit log: who changed what, and when.

GitHub

ToolAccessWhat it does
list_github_reposReadRepositories the team can deploy, with the id create_service takes.
sync_github_reposWriteRe-read the repository list from GitHub, after pushing a new repo.

A repo’s github_repo_id is a HostStack id, not GitHub’s, and list_github_repos is the only place to read it. create_service also accepts the owner/name form directly.

Support

ToolAccessWhat it does
report_issueWriteFile a platform fault with the HostStack team.

For a fault in the platform, not a bug in your own code. Pass serviceId and the service, its latest deploy and that deploy’s last 40 log lines are attached server-side.

Limits and telemetry

  • The hosted endpoint accepts API keys only — a dashboard session cookie gets 401 API key required for /api/mcp — and allows 120 requests a minute.
  • For hosted calls HostStack records one row per tool call: the tool name, duration, success or error, and a hash of the arguments — never the arguments themselves. The rows feed on-call alerts on tool error spikes and are deleted after 30 days.
  • The local server records nothing on HostStack’s side.

Troubleshooting

Dev box tools are missing

A stale npx cache can keep serving an old build. Ask the agent to call describe_mcp: if devEnvToolsPresent is false, run npx -y @hoststack.dev/mcp@latest once, or clear the npx cache, and restart the client.

HOSTSTACK_API_KEY is required to serve

The local server started without a key. Put it in the client’s env block rather than only exporting it: a client started from a desktop launcher, like Claude Desktop, never sees your shell’s variables.

No team bound to API key

The key isn’t tied to a team. Create a new one under Settings → API keys.

requires an API key with full_access permission

The key is Deploy Only. Create a Full Access key and swap it in. A few owner-only actions, such as billing, can’t be done with any API key.

Next steps

Was this page helpful?