WORKSPACES.
MIT open source · Cloudflare Workers ($0/mo free tier) · updated November 2026
Connect your tools, skills, and shared agent files once. Plug Antigravity, Claude Code, Codex, Cursor, Grok, or ChatGPT into one self-hosted MCP URL. Switch models without rewiring GitHub, Cloudflare, Stripe, or your notes.
Architecture
Every AI client talks to your single Worker over Streamable HTTP MCP. Provider API keys stay in Worker secrets, never on your laptop or in AI client configs. Agents share one scratchpad (ws/) and one skill library (skills/) across laptops and phones.
Why One Gateway Beats 5 Separate MCPs
| Dimension | 5 Separate MCP Servers | @taktekhq/workspaces |
|---|---|---|
| Setup for a new agent | 5 configs + 5 token copies per machine | 1 MCP URL, zero tool keys on laptop |
| Context burned on turn 1 | ~42,000 tokens (all schemas upfront) | ~520 tokens (3 meta-tools, on-demand) |
| Merge PR / DNS / delete | Prompt instruction only | Code-enforced Tier-3 approval + R2 lock |
| Cross-agent handoffs | Copy-paste between apps | Shared R2 ws/ scratchpad + Skills |
| Hosting & privacy | Third-party SaaS holds your tokens | Your Cloudflare account ($0/mo free tier) |
Permission Tiers Enforced in Code
Auto-runs. Lists repos, reads files, checks Stripe balances, inspects DNS zones. Untrusted external text reads (GitHub, Stripe payments/customers) wrap output with untrusted_content: true.
Auto-runs inside a jail. Writes shared files under ws/ (256 KB max, secrets auto-scrubbed) or opens issues in GITHUB_DRAFT_REPOS (other repos require Tier-3 approval).
Never runs directly. github.merge_pr, cloudflare.upsert_dns, and files.delete create a 15-min single-use R2 approval lock.
2-Minute Setup (Stage 1: Local IDEs)
Requires Node 22.6+ and a free Cloudflare account logged in via npx wrangler login. Stage 1 starts in cli_only mode: your IDE connects with a 256-bit Bearer token, and browser OAuth routes fail closed until you enable Stage 2.
git clone https://github.com/taktekhq/workspaces.git cd workspaces npm install npm run setup
npm run setup creates your R2 bucket and KV namespace, mints WORKSPACE_DIRECT_TOKEN (for AI clients), WORKSPACE_ADMIN_TOKEN (for CLI approvals), and OAUTH_SIGNING_KEY, saves them to .env.local (mode 0600, gitignored), deploys your Worker, and prints a live curl check.
Connect any optional provider once by setting its secret on your Worker:
npx wrangler secret put GITHUB_TOKEN npx wrangler secret put CLOUDFLARE_API_TOKEN npx wrangler secret put STRIPE_API_KEY # rk_live_ (restricted) or sk_test_ only
For Cloudflare Workers listing and DNS writes, also set CLOUDFLARE_ACCOUNT_ID (secret or var) and CLOUDFLARE_ALLOWED_ZONES in wrangler.jsonc.
Client Config Generator
Enter your deployed Worker URL, pick your auth mode, and copy the exact config for each agent or IDE.
Real Tier-3 Approval Trace
When any agent calls a Tier-3 action like github.merge_pr, the Worker refuses to execute it immediately. It writes a 15-minute approval record (with an args_sha256 hash) to R2, returns a 1-tap approval URL (Stage 2) or CLI command (Stage 1), and claims an atomic R2 conditional lock (etagDoesNotMatch: "*") before executing so retries or double-clicks cannot double-run.
// 1. Agent calls cap_run("github.merge_pr", { "repo": "acme/api", "pull_number": 42 })
{
"status": "approval_required",
"approval_id": "9fK2mP7xQ4vL8nR1",
"action": "github.merge_pr",
"expires_at": "2026-11-29T18:45:00.000Z",
"approve_url": "https://workspace.example.com/approve/9fK2mP7xQ4vL8nR1",
"note": "Wait for the human to approve, then check files.approval_status."
}
// 2. Human clicks "Approve & Execute" behind Cloudflare Zero Trust (or runs npm run approve 9fK2mP7xQ4vL8nR1)
// 3. Agent checks cap_run("files.approval_status", { "id": "9fK2mP7xQ4vL8nR1" })
{
"status": "approved",
"decided_by": "you@example.com",
"result_summary": "{\"merged\":true,\"sha\":\"8a1c3f...\"}"
}
Stage 2: Mobile OAuth 2.1 + Phone Approvals
To connect Grok iOS, Claude mobile, or ChatGPT and approve Tier-3 actions from your phone with zero custom login forms:
- Attach a custom domain in
wrangler.jsonc(routes) and setworkers_dev: falseandpreview_urls: false. - In Cloudflare Zero Trust Access, create self-hosted applications protecting only
workspace.example.com/authorizeandworkspace.example.com/approve/*behind your email (One-Time PIN or IdP). Leave/mcp,/token,/register, and/.well-known/*open for MCP OAuth 2.1 clients. - Set
AUTH_MODE = "access",ISSUER,ACCESS_TEAM_DOMAIN,ACCESS_AUD,APPROVE_ACCESS_AUD, andACCESS_ALLOWED_EMAILSinwrangler.jsonc. - Run
npm run deploy. Every request to/authorizeand/approve/*cryptographically verifies the Cloudflare Access RS256 JWT inside the Worker.
Extend It (Without Forking Core)
Keep core OAuth, secret scrubbing, and atomic approvals untouched. Extend your workspace in three ways:
- 1-file tool provider: Drop
src/providers/linear.tsexporting aWorkspaceProvider, add it tosrc/index.ts, set the API secret once, and deploy. Every connected AI discovers it viacap_search. - Skills over MCP: Upload any markdown playbook to R2 at
skills/<name>/SKILL.md. Clients with MCP Prompts seeskill:<name>; all others load it viacap_run("files.read_skill", { name }). - Private stack on top (Memory, Wiki, Remote Compute): Import
createWorkspaceWorkerinto your own private repo by pinned Git commit SHA so you inherit upstream security fixes with zero copy-paste:
import { createWorkspaceWorker } from "@taktekhq/workspaces";
import { filesProvider, githubProvider, cloudflareProvider, stripeProvider } from "@taktekhq/workspaces/providers";
export default createWorkspaceWorker({
serverName: "my-private-workspace",
providers: [filesProvider, githubProvider, cloudflareProvider, stripeProvider],
orientLoader: async (env, actionSummary) => {
const wiki = await env.WORKSPACE_BUCKET.get("AGENTS.md");
return `${wiki ? await wiki.text() : ""}\n\n## Capabilities\n${actionSummary}`;
},
extraTools: [
// Add private memory search, wiki note writer, or remote job dispatcher here
],
});
Read full provider and extension recipes in EXTENSIONS.md.