Build an App
App Binding uses AppServer for authority and a binding-scoped Streamable HTTP MCP server for tools.
Connect the app principal
- A trusted DotCraft client calls
app/connection/startwithappId. - The app reads the handoff with
app/connection/request/get. - The app calls
app/connection/connectand stores the returned credential. It is returned once. - Immediately call
app/connection/authenticateon the initialized AppServer connection. - Authenticate later connections with the stored credential. Use
app/connection/refreshto rotate it.
The principal credential expires after 30 days. Rotation invalidates the old credential immediately.
Activate a thread binding
After the user enables the app with thread/appBindings/enable, obtain the bindingRequestId from app/binding/requested while online. If the app is offline, use the request-specific handoff returned to the trusted client. Inspect the request with app/binding/request/get, then call:
{
"jsonrpc": "2.0",
"id": 1,
"method": "app/binding/activate",
"params": {
"bindingRequestId": "appbindreq_...",
"endpoint": "https://app.example/mcp/binding/123",
"bearer": "one-time-binding-secret"
}
}Expose tools through that MCP server. Associate interactive results with stable MCP Apps ui:// resources. App descriptors contain identity, installation, connection UX, branding, and security links only.
After a process restart, call app/bindings/list, then app/binding/rebind with the current authorityRevision, a trusted endpoint, and a new bearer. Use thread/appBindings/confirmCapabilities only from a trusted DotCraft client.
Endpoint rules
- Streamable HTTP only.
- Remote HTTPS or loopback HTTP only.
- No command, arguments, environment, working directory, or stdio configuration.
- Redirects or trust-boundary changes require activation again.
See Connected Apps for the user workflow and App Binding for the protocol model.