Skip to main content

Documentation Index

Fetch the complete documentation index at: https://ahvn.top/llms.txt

Use this file to discover all available pages before exploring further.

Any workspace can become a native Toolkit with schema, CRUD, query, and explain tools.

1. What HeavenBase MCP provides

HeavenBase exposes workspaces and Capsule Toolkits over the Model Context Protocol (MCP), allowing agents to:
  • inspect the schema (entities, fields, backends)
  • read and write entities
  • run queries
  • call persisted Capsule tools such as math or application functions

2. Create a workspace Toolkit

import heavenbase as hb

workspace = hb.HeavenBase("demo", backends={"main": {"backend_type": "inmem"}})
toolkit = workspace.to_mcp(name="demo")

print(toolkit.list_tools())

3. Serve it

workspace.serve(
    name="demo",
    transport="http",
    host="127.0.0.1",
    port=7011,
    wait=True,
)
Or create client config JSON:
print(workspace.to_mcp_json(name="demo", transport="http", host="127.0.0.1", port=7011))

4. Serve a Capsule Toolkit

loaded = hb.Toolkit.load(name="math-tools", namespace="demo", version="1")
server = loaded.to_fastmcp()

from fastmcp import Client

async with Client(server) as client:
    result = await client.call_tool("add", {"left": 2, "right": 3})
The export path is:
  1. CapsuleManifest stores signature and schema.
  2. Tool exposes the Capsule under a tool name.
  3. Toolkit.to_fastmcp() builds wrappers with evaluated annotations and the original callable signature.
  4. FastMCP serves native Python return values; scalar results appear as structured_content["result"] in the client.

5. Available workspace tools

Workspace MCP exposes stable generic tools instead of generating one tool per entity:
  • define_entity
  • list_entities
  • describe_entity
  • upsert, upsert_many
  • get, get_many
  • set, set_many
  • delete, delete_many
  • exists, exists_many
  • count
  • query
  • explain

Further Exploration

Related resources: