Repository navigation
Cloudhal 0.7.0
All @cloudhal/* packages and create-cloudhal at 0.7.0.
Changes
- Remote MCP clients can now authorize with OAuth 2.1 against the deployment itself (RFC-0044 Phase 2, ADR-0045). Better Auth's
mcp()andjwt()plugins run in the Studio's auth instance when the runtime has a stable public origin: the admin Worker uses its origin,cloudhal studioneeds--base-url/CLOUDHAL_BASE_URL(it logs why OAuth is off otherwise), andCLOUDHAL_MCP_OAUTH=offturns it off. Access tokens are Ed25519 JWTs bound to/mcpfor one hour, refresh tokens rotate with a 30-second reuse window, and each connection is approved on Studio's new consent screen (/oauth/consent), which narrows the requested scopes by the member's role and records anagent_grantsrow (migration0031_oauth). A token resolves to the same principal an agent key does; revoking a connection (DELETE /api/agent-grants/:id) or removing the member refuses it on its next call. The Better Auth family moves to 1.7.18. Client registration (CIMD, DCR) and the "Connected agents" screen follow in Phase 3.
Patch Changes
-
Remote MCP clients can now register themselves (RFC-0044 Phase 3a, ADR-0045). Clients that name an HTTPS Client ID Metadata Document as their
client_id(Claude Code, Codex, VS Code) are accepted through@better-auth/cimd, fetched with the media import's SSRF-safe transport (pinned on Node, DoH-checked on Workers; https only, public addresses only, no redirects, 5 KB, 5 s). Clients without one (Cursor) use dynamic client registration at/api/auth/oauth2/register: public clients only, rate-limited per address and per day, capped at 5,000, and pruned by the scheduler after 30 unused days. Document clients are fetched at most hourly per client, with budgets in Cloudhal's own counters that never lock out stored clients, a cap of 5,000 that evicts unused clients (the well-known clients' hosts are exempt), pruning after three hours unused, and a failed refetch that refuses the client; migration0032_oauth_client_kind_indexindexes them. Redirect URIs must be https, loopback http (any port) or a native app's private-use scheme (cursor,vscode, reverse-domain,CLOUDHAL_MCP_REDIRECT_SCHEMES), and the client host list applies at every authorization. With DCR off, the clients it registered earlier cannot start new authorizations. The consent screen shows client names plain and short, a document client's host first, and marks self-registered clients as unverified.CLOUDHAL_MCP_CIMD=off,CLOUDHAL_MCP_DCR=off,CLOUDHAL_MCP_CLIENT_HOSTSandCLOUDHAL_MCP_REDIRECT_SCHEMEScontrol it on both runtimes, and the Docker compose file passes them through. The Phase 2 server-side test client (OauthServer.createClient) is removed.set_embargothrough an OAuth connection now files the gate for a person's approval instead of leaving it unapplied, and the request is notified while it waits.safeFetchresults carry the response headers. -
Studio shows "Connected agents" and how to connect an MCP client by URL (RFC-0044 Phase 3b). On
/agents, each member sees the apps they connected through OAuth. A client is named as the consent screen named it: a metadata document's host first, a self-registered client as not verified, a name that looks like a well-known client with a warning. Each row shows what the connection can do in words, its mode and when it was last used, and has Disconnect, which uses the existing revoke. Administrators see every member's connections under All keys. "Connect an MCP client" gains a Connect by URL tab: the deployment's/mcpURL, steps for Claude, Claude Code, ChatGPT and Codex, Cursor, VS Code and the MCP Inspector, and a note where a client needs dynamic client registration that is off.GET /api/agent-grantsnow returnsclient(kind, a document client'shost,lookalike) with the name sanitized, and with?all=1each owner'srole./api/instancereportsfeatures.mcpOauthClients: the/mcpresource, and whether metadata documents and dynamic registration are on. The new guide isdocs/guides/mcp-oauth.md, and the MCP server README has an Authentication section.
Upgrade
npm install @cloudhal/cli@0.7.0 @cloudhal/core-ts@0.7.0 @cloudhal/astro-renderer@0.7.0 @cloudhal/cloudflare@0.7.0
npx cloudhal deployDocs: https://cloudhal.dev/docs/start/installation#upgrading