技术文档
集成 MistPage 所需的一切:Quick Start、MCP Server、REST API 和 Webhooks。
快速开始
三步接入 MistPage API,开始以编程方式管理项目。
第 1 步:获取 API Key
登录 MistPage,进入仪表盘 > 设置 > API 密钥,点击「创建密钥」。
第 2 步:创建项目
使用 API 创建一个新项目:
curl -X POST https://mistpage.com/api/v1/projects \
-H "Authorization: Bearer sk_mistpage_..." \
-H "Content-Type: application/json" \
-d '{"title": "My Project"}'{
"data": {
"id": "proj_...",
"title": "My Project",
"slug": "my-project",
"status": "draft"
}
}第 3 步:上传并发布
上传文件并发布项目:
curl -X POST https://mistpage.com/api/v1/projects/{id}/upload \
-H "Authorization: Bearer sk_mistpage_..." \
-F "files=@index.html" \
-F "files=@style.css" \
-F "entryFile=index.html"curl -X POST https://mistpage.com/api/v1/projects/{id}/publish \
-H "Authorization: Bearer sk_mistpage_..."MCP Server
通过 Model Context Protocol (MCP) 将 MistPage 接入你的 AI 工具。
什么是 MCP?
Model Context Protocol (MCP) 是一种标准协议,让 AI 助手(如 Claude、Cursor)能直接调用外部工具。MistPage 的 MCP Server 让你的 AI 助手可以创建项目、上传文件、发布内容和查看统计。
Claude Desktop 配置
{
"mcpServers": {
"mistpage": {
"url": "https://mistpage.com/api/mcp",
"headers": {
"Authorization": "Bearer sk_mistpage_..."
}
}
}
}Cursor 配置
{
"mcpServers": {
"mistpage": {
"url": "https://mistpage.com/api/mcp",
"headers": {
"Authorization": "Bearer sk_mistpage_..."
}
}
}
}可用工具
REST API
完整的 RESTful API,支持项目的增删改查、文件上传和数据分析。
Webhooks
在项目被访问时接收实时通知。
概述
当有人访问你的项目时,MistPage 会向你配置的 URL 发送 POST 请求。
设置方法
进入项目设置 > Webhook,输入你的 HTTPS URL 并保存。
Payload 格式
每次项目被访问时,你会收到以下格式的 JSON:
{
"event": "project.visited",
"project": {
"id": "proj_...",
"slug": "my-project",
"title": "My Project"
},
"visitor": {
"country": "US",
"referer": "https://..."
},
"timestamp": "2026-04-03T12:00:00.000Z"
}