MCP 服务器
hdply 内置 MCP 服务器。任何 MCP 客户端——Claude Code、Claude Desktop 或你自己的 agent——都可以列出你的站点、创建站点、读取当前上线的 HTML、发布新版本并查看部署历史。五个工具,一个 API 密钥,本地无需运行任何东西。
可以放心交给 agent
没有删除工具。删除站点刻意只能在网页控制台完成。拥有全部部署权限的 agent 可能发布一个糟糕的版本,但无法毁掉你的成果。
每次部署——无论人还是 agent——都有版本记录。错误的部署在控制台一键即可恢复,get_deploy_history 会准确显示哪些部署来自 MCP("source": "mcp")。这就是与通用部署 MCP 的区别:hdply 的范围是每个站点一个 HTML 文件,最坏情况不过是页面难看一分钟。
主要用例
Claude 为你写了一个页面——方案、仪表盘、原型——作为 HTML 产物。你不用保存文件再上传到别处,只需说"发布它",同一段对话就以一个可发送的公开 URL 结束。之后"改一下标题再发布"也只是一轮对话。
连接
Claude Code,一条命令:
claude mcp add --transport http hdply https://api.app.hdply.com/mcp \ --header "Authorization: Bearer hdply_sk_…"
Claude Desktop,在 claude_desktop_config.json 中添加(Desktop 只能启动本地命令,因此通过 mcp-remote):
{
"mcpServers": {
"hdply": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://api.app.hdply.com/mcp",
"--header", "Authorization: Bearer hdply_sk_…"]
}
}
}
其他客户端:这是一个无状态的 Streamable HTTP 端点。向下面的 URL 发送 JSON-RPC,带上同样的 Bearer 头即可。
POST https://api.app.hdply.com/mcp
Authorization: Bearer hdply_sk_…
Content-Type: application/json
{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}
密钥在控制台仪表盘的"API 密钥"卡片中创建。只显示一次,且可访问账户下所有站点——请像对待密码一样对待它。
工具
每个工具接收一个 JSON 对象并返回文本内容。错误以带 isError: true 的文本返回,而不是传输失败,因此 agent 可以读取原因并重试。
list_sites
你可管理的所有站点(个人与团队),含上线 URL 及是否已部署。无参数。
调用示例
{ "name": "list_sites", "arguments": {} }
结果
[
{
"id": 42,
"name": "Q3 proposal",
"subroute": "k3v9x2m7q1",
"url": "https://k3v9x2m7q1.hdply.com",
"live": true
},
{
"id": 43,
"name": "Launch page",
"subroute": "launch",
"url": "https://launch.hdply.com",
"live": false,
"team_id": 7,
"team_name": "Design"
}
]
create_site
创建站点。提供 html 时,调用返回即在服务器分配的随机子域名上线;不提供则站点为空,直到 deploy_site。
输入
{
"html": string // optional — full HTML document, max 1 MB; live immediately when given
"name": string // optional — falls back to the HTML <title>
"team_id": number // optional — create inside a team (0 = personal)
}
调用示例
{
"name": "create_site",
"arguments": {
"html": "<!doctype html><html><head><title>Q3 proposal</title></head><body><h1>Q3 proposal</h1></body></html>"
}
}
结果
Site "Q3 proposal" live at https://k3v9x2m7q1.hdply.com (id 42, subroute k3v9x2m7q1)
get_site_html
访问者当前拿到的 HTML。编辑前先读取,让 agent 修改真正上线的内容,而不是它记忆中的内容。
输入
{
"site": string // required — numeric project id ("42") or subdomain ("k3v9x2m7q1")
}
调用示例
{ "name": "get_site_html", "arguments": { "site": "k3v9x2m7q1" } }
结果
<!doctype html><html><head><title>Q3 proposal</title>…
deploy_site
向已有站点发布新 HTML。调用返回即上线,与其他部署一样有版本记录,历史中标记为 mcp。
输入
{
"site": string // required — numeric project id or subdomain
"html": string // required — full HTML document, max 1 MB
}
调用示例
{
"name": "deploy_site",
"arguments": {
"site": "k3v9x2m7q1",
"html": "<!doctype html>…"
}
}
结果
Deployed. Live at https://k3v9x2m7q1.hdply.com
get_deploy_history
部署历史:谁、何时、多大、通过哪条路径(web、api、mcp、restore)。最新在前。
输入
{
"site": string // required — numeric project id ("42") or subdomain ("k3v9x2m7q1")
}
调用示例
{ "name": "get_deploy_history", "arguments": { "site": "k3v9x2m7q1" } }
结果
[
{
"id": 918,
"size": 4812,
"hash": "3f9c1a7b2d4e6f80",
"source": "mcp",
"actor_email": "you@example.com",
"created_at": "2026-09-08T09:41:12Z"
},
{
"id": 902,
"size": 4790,
"hash": "b81e0c5d9a2f4711",
"source": "web",
"actor_email": "you@example.com",
"created_at": "2026-09-07T18:02:55Z"
}
]
错误
工具错误是带 isError: true 的普通结果。有稳定代码时文本以该代码开头:file_too_large(超过 1 MB)、project_limit(达到套餐上限)、site not found。唯一的 HTTP 级错误是认证失败(401)。
{ "content": [{ "type": "text", "text": "file_too_large: html exceeds the 1MB size limit" }], "isError": true }
限制
- 每个站点一个 HTML 文件,最大 1 MB。CSS 和 JavaScript 请内联;图片可用外部 URL 或 data URI。
- 免费账户可有 6 个站点;Light 提高到 25 个,Pro 无限制。超出后
create_site会以project_limit失败。 - 新站点在所有者于控制台(或通过 REST
PATCH /v1/projects/{id}/settings)开启收录前,都以X-Robots-Tag: noindex提供。agent 无法自行让页面可被搜索。
发现
服务器在两个无需认证的 URL 上描述自己:包含实时工具列表和 schema 的 server card,以及用于 MCP 目录登记的清单。
https://api.app.hdply.com/.well-known/mcp/server-card.json # tools + schemas, live https://api.app.hdply.com/.well-known/mcp/server.json # registry manifest (com.hdply/hdply)
更喜欢普通 HTTP?同样的操作也有 REST API,hdply.com/llms.txt 为 agent 总结了两者。