Skip to content

Commit 2d366db

Browse files
committed
Scope the Zero fetch warning to CLI publishes
The hosted MCP publish tool compiles on the platform, where handlers already get fetch bounded by the Space's egress scope.
1 parent 0176452 commit 2d366db

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎content/(dynamic)/zero-runtime.mdx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,10 @@ Only three source roots are read: `client/`, `server/`, and `shared/`. Beyond th
221221

222222
Platform modules do not count against your client cap. The SDK, kit, charts, preact, recharts, and lucide serve from immutable same-origin URLs the browser keeps across publishes.
223223

224-
:::warning[There is no outbound fetch in a Zero handler]
225-
The runner defines `Headers`, `Response`, `URL`, `URLSearchParams`, `atob`, and `btoa`, but no `fetch`, `crypto`, or `TextEncoder`. A handler that needs to call an external API, like creating a checkout session, belongs in [Functions](/functions). Receiving the provider's webhook stays in Zero. See [Receiving a webhook](#receiving-a-webhook).
224+
:::warning[`sf publish` builds Zero handlers without outbound fetch]
225+
Handlers published with the current CLI get no `fetch`. The runner defines `Headers`, `Response`, `URL`, `URLSearchParams`, `atob`, and `btoa`, and never `crypto` or `TextEncoder`. A handler that needs to call an external API, like creating a checkout session, belongs in [Functions](/functions). Receiving the provider's webhook stays in Zero. See [Receiving a webhook](#receiving-a-webhook).
226+
227+
The exception is the hosted [MCP server](/agents/mcp-server) at `https://mcp.spacefast.com`: its `publish` tool compiles on Spacefast and the handlers it publishes do get `fetch`. On a claimed Space that reaches any public host. An unclaimed Space reaches only a short list of AI, GitHub, and Stripe APIs. The next `sf publish` from the current CLI builds without it again.
226228
:::
227229

228230
## Styling

0 commit comments

Comments
 (0)