Apps
Datanotes is extended by apps: programs in any language that use the HTTP API and the change
feed (POST /datanotes/changes/, SSE GET /datanotes/changes/stream, webhooks created by the
owner), and may add MCP
tools that teach agents how to use part of the database. Agents keep one MCP address: the MCP
server (datanotes-mcp) lists the apps’ tools after the engine’s operations.
- Register (owner token):
POST /datanotes/apps/create/ {"name": "planning", "write": ["personal.tasks.*"], "mcp_url": "http://127.0.0.1:5235/mcp", "mcp_token": "…"}returns the app’s token once (the engine keeps its SHA-256 in.datanotes/apps.json). Alsoapps/,apps/update/,apps/refresh/,apps/rotate-token/,apps/delete/. - App token: reads are always allowed; row writes only on tables matching
write(catalog.schema.table,catalog.schema.*,catalog.*,*); schema changes only with"ddl": true; configuration, undo, restore, vacuum and rebuilding the semantic index only with"maintain": true(meant for an agent’s own token). Creating and deleting apps and webhooks, listing apps, rotating tokens and/api/stay the owner’s; an app may list webhooks and see, refresh and update its own entry. Writes carryactor.app; an app that forwards the agent’sX-Datanotes-Actorgets both recorded (“harness / model via app”). An app may change its ownmcp_url,mcp_token,descriptionandinstructionswithapps/update/(e.g. at start). - Tools: an app with
mcp_urlis an ordinary MCP server (JSON or SSE answers). The engine reads itstools/listandinstructionsat start, every 5 minutes, when the app is created, when itsmcp_urlormcp_tokenchange and onapps/refresh/, and holds itsmcp_token.POST /datanotes/apps/tools/lists the tools (each with itsapp) and the instructions;POST /datanotes/apps/call/ {"tool", "arguments"}calls one for the caller, forwardingX-Datanotes-ActorwithAuthorization: Bearer <mcp_token>, and answers{ok, value, servedBy}(timeouts: 15 s to open a session, 30 s to list, 180 s per call). A name already taken by an operation or by an app registered earlier is skipped (skippedToolson the app’s entry). While the app is down its tools stay listed and answer that it is not reachable. A tool may declare_meta: {"datanotes/tables": ["…"]}:describe_tablethen lists it undertools. - Tool calls are change-feed events
op: "tool_call"(call: tool, args cut at 300 characters, ok, value cut at 1000, servedBy, durationMs, summary, session, resultChars, resultTokens), sent only to consumers that ask for that op. MCP servers report them withPOST /datanotes/tool-calls/record/after each call;/apps/call/itself records nothing.