How it's built
How SZ-MCP is built
A focused Cloudflare connector, about 3,000 lines of Worker TypeScript, written as a compact sibling of R1-MCP.
One tool for 1,354 operations
SmartZone exposes 1,354 REST operations: 1,116 for wireless (WSG) and 238 for switches (SwitchM). Giving Claude a separate MCP tool for each would flood its context window. So I gave it one tool and two small objects, `wifi` and `switches`, each with five functions: search, browse by tag, read a full endpoint schema, and call. Claude writes a short script that chains those calls, the server runs it in a sandboxed V8 isolate, and only the result goes back. Specs are indexed at build time into slim JSON bundled in the Worker; full specs sit in R2 and load on demand when Claude reads a schema.
SZ-MCP is a sibling of R1-MCP, built on the same auth and sandbox pattern. The main work was handling SmartZone's service-ticket auth, detecting the right API version at setup (twelve candidates, v9_0 through v14_1), and routing WSG and SwitchM to their separate base paths. About 3,000 lines of Worker TypeScript, 2,240 lines of React frontend, three test files covering host validation, the retention sweep, and terms acceptance.
Security-first start
Before the first user existed I audited the scaffold and fixed everything it found the same day, in PRs #3 through #8.
Later hardening added canonical IP-literal handling to the SSRF check (PR #15, September 2026), privacy-version re-acceptance on policy changes (#16, #18), and stopped advertising plain PKCE (#17). The deny-list blocks RFC 1918, loopback, link-local, CGNAT, IPv6 ULA and link-local, and reserved hostname patterns.
Two limits worth stating
The controller must be on a public address with a publicly trusted TLS certificate. Cloudflare Workers cannot skip certificate verification, and there is no tunnel or relay. A controller only on a private LAN will not work.
The API catalogue is pinned to v13_1. Version detection at setup picks the correct path prefix, but the spec Claude searches is always v13_1. An endpoint that exists in v13_1 but not on an older controller will return a 404.