hearth is a toolkit for building apps whose API is also a good MCP server:
Protobuf options, protoc plugins and a Go runtime, so that 1 Protobuf service
gives an app its API, its MCP tools, its permission checks, its events and a
versioned manifest. It is for the developers of those apps, and for the agents
that call them.
Status: pre-release. The options' extension numbers are in-house until the Protobuf global extension registry grants one.
Documentation: frostyard.github.io/hearth
- 3 options on your service.
hearth_rpcgives each RPC a permission, an effect (read,writeoroutward) and where it is reachable (UI, agent or both);hearth_selectormarks the request field that scopes the permission, such as a folder;hearth_eventdeclares an event (the options). - 4 plugins, 1 source.
protoc-gen-hearth-manifestwrites the app'smanifest.json,protoc-gen-hearth-authzits permission checks,protoc-gen-hearth-mcpits MCP tools, andprotoc-gen-hearth-eventsits event publishers. An RPC with no permission or no effect does not build. - Permission checks in the app. Each call is checked against the caller's grant, a list of capabilities on paths, and a stored object is checked in the app's own transaction (permissions).
- A Connect route from the same service.
protoc-gen-connect-go, pinned as a tool of the app's module, writes the app's HTTP API: the generated handler takes the API that the permission checks return, and the generated client satisfies the agent interface of the tools, so 1 service serves the app's UI and its agents. A refusal arrives aspermission_deniedwith the capability the caller needs (the Connect route). - MCP tools from your RPCs. Each agent RPC is a tool with a proto3 JSON schema and the hints of its effect, served over stdio with no token (MCP tools).
- Events that commit with the change. An event is written to an outbox in the change's transaction, and a relay publishes it, losing none on a crash (events).
- A compatibility gate.
hearth manifest diff OLD NEWexits 1 when a change needs the app's next major version (the manifest).
go install github.com/frostyard/hearth/cmd/hearth@latest
go install github.com/frostyard/hearth/cmd/protoc-gen-hearth-manifest@latest
go install github.com/frostyard/hearth/cmd/protoc-gen-hearth-authz@latest
go install github.com/frostyard/hearth/cmd/protoc-gen-hearth-mcp@latest
go install github.com/frostyard/hearth/cmd/protoc-gen-hearth-events@latestAn app's module can also run each plugin with go run at the version its
go.mod requires.
Install lists
the other ways, how to pin a version, and the requirements.
Build the example app, a small notes service, from its README alone:
examples/notes-lite. It walks through 1
service with the options, the buf template of the 4 plugins, the handlers
and the permission hooks, the outbox and the relay, and the stdio tools. Then
check a manifest:
hearth manifest validate gen/manifest.json
hearth manifest diff old/manifest.json gen/manifest.jsonAn app on hearth runs in 1 of 2 modes, with the same handlers. Standalone, it needs nothing else: its own user reaches its API over its private socket, as the local user who holds every capability, or its MCP tools over its stdio server, and its events go to an in-process bus. On lodge, frostyard's hub for first-party apps, lodge authenticates each caller and forwards the call on the app's lodge socket, where hearth's adapter trusts the caller's grant only after a peer check, and the app publishes its events to lodge's broker socket, which delivers each event only to a consumer whose grant reads its path. The design shows how the parts fit, and the Connect route is the API of both modes.
mise install # the pinned tools: golangci-lint, buf, protoc-gen-go, svu
make ci # what CI runs, the example app's gate includedBuild from source explains each target.
- AGENTS.md: the rules for agents and contributors.
- docs/README.md: the decisions, designs, specs and plans.
- SECURITY.md: report a vulnerability privately.
- LICENSE: MIT.