htmlhost.co

MCP server

Let your AI assistant publish for you. The htmlhost MCP server connects Claude, Cursor, VS Code, Windsurf, Codex and other Model Context Protocol clients to your htmlhost.co account, so you can say “deploy this folder” and get a live URL back.

It runs locally over stdio and signs in with the same API token as the htmlhost CLI. It can deploy, list, inspect, download and delete your sites.

Setup

You need Node.js 18 or later and an htmlhost.co account.

  1. 1Sign in once with the CLI. It opens Settings → API keys; paste the token back into the terminal. It's saved to ~/.htmlhostrc, which the MCP server reads.
  2. 2Add the server to your AI tool (below). Restart the tool if it doesn't pick it up.
  3. 3Ask your AI to run whoami. If it replies with your email and plan, you're connected.
bashnpx htmlhost-cli login

Already use the CLI? You're signed in. If you'd rather not go through npx each time, install the server globally with npm i -g htmlhost-mcp and use htmlhost-mcp as the command in the configs below.

Connect your AI tool

Claude Code

bashclaude mcp add htmlhost -- npx -y htmlhost-mcp

# Make it available in every project
claude mcp add --scope user htmlhost -- npx -y htmlhost-mcp

Claude Desktop

Open Settings → Developer → Edit Config, add the server to claude_desktop_config.json, then quit and reopen Claude.

json{
  "mcpServers": {
    "htmlhost": {
      "command": "npx",
      "args": ["-y", "htmlhost-mcp"]
    }
  }
}

Cursor

Add to ~/.cursor/mcp.json for all projects, or .cursor/mcp.json for one project:

json{
  "mcpServers": {
    "htmlhost": {
      "command": "npx",
      "args": ["-y", "htmlhost-mcp"]
    }
  }
}

VS Code (GitHub Copilot)

Add to .vscode/mcp.json in your project. VS Code uses a servers key:

json{
  "servers": {
    "htmlhost": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "htmlhost-mcp"]
    }
  }
}

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

json{
  "mcpServers": {
    "htmlhost": {
      "command": "npx",
      "args": ["-y", "htmlhost-mcp"]
    }
  }
}

Codex

bashcodex mcp add htmlhost -- npx -y htmlhost-mcp

Other clients

Cline, Zed and any other MCP client that supports stdio servers work the same way: the command is npx with the arguments -y htmlhost-mcp. No environment variables are needed.

Tools

Your AI picks these tools itself; you just describe what you want. Each one returns JSON, including the live URL after a deploy.

deploy

Deploy a local folder or a single HTML file. Without a slug, a new site is created.

Parameter
Type
Description
pathstringRequired. Absolute path to a folder or an .html file.
slugstringOptional. An existing site to update. Omit to create a new site.
titlestringOptional. The site title.
ttlstringOptional. 1d, 7d, 30d or never. Defaults to your plan's default.

deploy_html

Publish HTML the AI has just written, with no file on disk. Deploys a single page.

Parameter
Type
Description
htmlstringRequired. The full HTML document.
slugstringOptional. An existing site to update.
titlestringOptional. The site title.
ttlstringOptional. 1d, 7d, 30d or never.

list_sites

Lists your sites with their slug, URL, title, size, TTL and expiry, plus your plan usage. No parameters.

get_site

Shows a site's current version, its pages, and its assets with their sizes.

Parameter
Type
Description
slugstringRequired. The site slug, e.g. bold-fern-x3k.

pull_site

Downloads every page and asset of a site into a local folder, creating the folder if needed. Useful for bringing edits made in the browser editor back into your project.

Parameter
Type
Description
slugstringRequired. The site to download.
directorystringRequired. Absolute path of the folder to write into.

delete_site

Permanently deletes a site. This can't be undone.

Parameter
Type
Description
slugstringRequired. The site to delete.
confirmbooleanRequired. Must be true, or nothing is deleted.

whoami

Returns the signed-in account's email, name, handle and plan. No parameters.

Example prompts

  • “Deploy this folder to htmlhost and give me the link.”
  • “Build a one-page wedding RSVP site and publish it on htmlhost for 30 days.”
  • “Redeploy ./site to bold-fern-x3k.”
  • “Which of my htmlhost sites expire this week?”
  • “Pull my portfolio site into ./portfolio so I can edit it here.”

If you build sites with forms, also run htmlhost agents in your project (see the CLI docs). It tells your AI how htmlhost hosting and forms work, so the forms it writes deliver to your inbox.

How deploys work

  • Folders deploy as multi-page sites. Each HTML file becomes a page (index.html → /, about.html → /about, blog/index.html → /blog) and every other file (CSS, JS, images, fonts) is uploaded next to it.
  • Single files deploy as-is.Unlike the CLI, the MCP server doesn't inline or upload local files a lone HTML file links to. If the page uses local CSS, scripts or images, deploy its folder instead.
  • Updating needs a slug. The MCP server doesn't read the CLI's .htmlhost link file, so without a slug every deploy creates a new site. Tell your AI which site to update, or ask it to find the slug with list_sites.
  • Private files stay local. node_modules, .git, .env files, lockfiles, editor folders, .htmlhost, and agent files such as AGENTS.md, CLAUDE.md and .cursor are never uploaded.
  • Pulls overwrite. pull_site replaces local files that have the same name and leaves other files alone. Commit or back up local changes first.
  • Your plan applies. Deploys count toward the same site, page, storage and TTL limits as the browser and CLI. See Plans & limits.

Troubleshooting

“Not logged in”

Run npx htmlhost-cli login in a terminal, then try again. The server reads the token from ~/.htmlhostrcon each request, so you don't need to restart your AI tool.

“Not authenticated”

The token was revoked or deleted. Create a new one at Settings → API keys and run htmlhost login again.

The server doesn't start (spawn npx ENOENT)

Desktop apps don't always see the same PATH as your terminal, which is common with nvm or Homebrew installs of Node. Run which npx and use that full path as the command, for example /opt/homebrew/bin/npx.

The tools don't appear

Restart your AI tool after editing its config, and check the JSON is valid. Most clients show the server's status and logs in their MCP settings.

Questions? Reach out at hey@htmlhost.co