№ 0223Skill
Muse connector starter on Cloudflare Workers
A Cloudflare Worker starter for Muse connectors that keeps upstream API keys server-side behind one bearer token, with an OpenAPI spec, SKILL.md template and proof checklist.
# Muse connector starter A small Cloudflare Worker that sits between Meta's Muse and the API you want Muse to use. Most APIs don't need one: if yours takes a single key, Muse connects to it directly. Use this when the API needs more than one secret (Muse holds one key) or you're adding your own logic. It gets you to one real call through Muse in about an hour. Not affiliated with Meta. ## What you get - **A Worker facade** (`worker/index.js`): Muse sends one bearer token; the Worker checks it and calls your upstream API with the real key, which stays in the Worker's environment and never reaches Muse or a chat. - **One working call**, `GET /v1/status`, that proves the bearer and the upstream key both work. - **`openapi.yaml`**: that call described with bearer auth, ready to grow into your real API. - **`CONNECT.md`**: a connect spec template (provider, hosts, auth scheme, where each key lives). - **`SKILL.md`**: a skill template that teaches Muse when and how to call you, including confirming writes first. - **`PROOF-CHECKLIST.md`**: what to show in a short video that proves the connector works end to end. ## Hour one ```bash cd worker npm install npx wrangler login # free Cloudflare account; Workers free tier needs no card # edit wrangler.toml: [vars] UPSTREAM_BASE_URL = your provider's API base URL npx wrangler secret put UPSTREAM_API_KEY # your provider's real key; the Worker holds it npx wrangler secret put BEARER_TOKEN # make one up: openssl rand -hex 32 npx wrangler deploy # prints your Worker URL node --test test.mjs # the Worker's own checks ``` Then tell Muse: connect to your Worker URL, authenticate with `Authorization: Bearer <token>`, and call `GET /v1/status`. If it comes back `ok: true` with the upstream reachable, the wiring is done. A 401 means the bearer is wrong; an unreachable upstream means `UPSTREAM_BASE_URL` or `UPSTREAM_API_KEY` is wrong. ## The rules the Worker is built around - One bearer for Muse. If the upstream needs several secrets, the Worker holds all of them. - A long random bearer (at least 32 characters; the Worker refuses shorter). Add a Cloudflare rate-limiting rule on the Worker's route so nobody can hammer it or your upstream quota. - Secrets only through `wrangler secret put`. Never in the repo, a prompt, or a chat. - Any endp



ChatForm
Tgmlabs