最好的画布,是空白的画布。
1. 创建空工作区
创建一个 Python 文件:preset 参数控制后端配置。debug 预设使用 SQLite 与内存存储,便于轻量、免 Docker 搭建。local-lts 预设使用本机 Postgres、LanceDB 与 Elasticsearch,更稳健且仍在本机运行。两种预设均支持完整 MCP 工具集:debug 侧重易用,local-lts 在更大数据量下性能更好。
profile 参数选择服务器暴露的工作区 MCP 工具集。HeavenBase 内置目前提供 full(可信管理流程)、agent(首日 schema 与数据工作)、memory(笔记式记忆)与 memstate(项目级记忆状态)。
本页使用 profile="agent",因为 agent 可用其定义实体、检查 schema、upsert 行、patch 行、计数、查询并解释路由,同时省略批量操作、存在性检查与删除。
2. 运行
/mcp 上的 Streamable HTTP。HeavenBase 支持常见 MCP 传输方式。每个服务器进程只使用一种传输,客户端连接对应端点:
在 Python 中,对
ws.to_mcp_json(...) 与 ws.serve(...) 传入相同 transport。例如,仅支持 SSE 的客户端需要 /sse 时,两处均使用 transport="sse"。
工作区 MCP 服务器绑定实时工作区对象。外部 agent 使用时请保持
serve_space.py 运行。与持久化的 Toolkit 注册表引用不同,空工作区 MCP 服务器是暴露该脚本所创建工作区的常驻进程。3. 连接你的 Agent
将服务器添加到你常用的编程 agent:- Claude Code
- Codex
- Cursor
- VS Code / Copilot
- OpenCode
- OpenClaw
- Hermes
- LM Studio
- HeavenBase
- OpenAI Agents SDK
使用 Claude Code CLI 添加 HTTP 服务器:Claude Code 将本地作用域 MCP 服务器保存在 开启新的 Claude Code 会话,运行
~/.claude.json。若需在仓库内共享,在项目根目录用相同命令加 --scope project,或创建 .mcp.json:/mcp,在让 agent 使用算术工具前确认 my-space-mcp 已连接。4. Agent Profile 与工作区 MCP 工具
本教程使用profile="agent",即 HeavenBase 面向首日工作区的默认 MCP 表面。它暴露一套经精选的 schema 与数据工具集,由 Catalog 与 MetaSchema 支撑:智能体 (Agent) 通过 schema 工具检查工作区结构,并通过 Catalog 感知的列举与描述发现具体行。
agent profile 有意省略批量变更、批量读取、存在性检查与删除。仅在可信管理流程中使用 profile="full"。
保持面向模型的 profile 精简,并通过应用代码承载破坏性操作。同一工作区可暴露多个 MCP 工具集,每个使用不同 profile:
agent profile 足以让首日智能体定义 schema、写入与修补行、读取上下文、统计行数、查询并检查路由计划。memory profile 是五工具笔记表面(remember、recall、search_memory、list_memory、set_memory)。memstate profile 用于带版本的项目记忆(memstate_* 动词)。full profile 为可信代码路径增加批量操作、存在性检查与删除。启用可选 database 扩展时,HeavenBase 还提供 database profile,用于读/查询流程以及 run_snippet 与 suggest_sql。
5. 动手体验:玩具电商场景
按顺序将下方每条提示复制到 agent 对话中。每个代码块是一条可粘贴发送的消息。1
设置工作区上下文
告诉 agent 使用哪个 MCP 服务器:开启新会话时,建议先粘贴此提示,以设定最小工作区上下文。
2
定义业务模型
请 agent 逐个创建核心实体:
3
日常运营
向工作区写入目录商品、客户与订单:
4
分析问题
提出分析问题。每条提示下方为预期答案。
66.67% (4 out of 6 products)
Wireless Mouse ($49.99), Ergonomic Keyboard ($89.99), 27-inch 4K Monitor ($349.00)
Ergonomic Keyboard (2)
1 (Alice)
- Hi Alice — complete your desk setup
- You already run a keyboard-and-monitor setup. Add a Wireless Mouse ($49.99) for a matched input stack, and a Bamboo Desk Organizer ($24.50) to tidy cables and accessories.
- Suggested add-ons: Wireless Mouse · Bamboo Desk Organizer
- Hi Bob — we found chairs for you
- You searched for a chair earlier. The Wooden Chair isn’t available right now, but the Mesh Office Chair ($199.99) is — ergonomic mesh for long sessions.
- Suggested for you: Mesh Office Chair

