nizar@taktek.io

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.

~520 tok3 meta-tools vs ~42,000 for 5 MCPs
$0 / moCloudflare Workers, R2, and KV free tier
20.1 KiBgzipped Worker, zero runtime deps

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.

ANY AI OR IDE Antigravity / Cursor Claude Code / Codex Grok / ChatGPT iOS Remote Workers 1 MCP URL, 0 tool keys /mcp YOUR CLOUDFLARE WORKER 3 Meta-Tools workspace_orient cap_search · cap_run Code Guardrails Tier-3 R2 atomic lock Zero Trust /approve/:id Secret scrubbing + audit OAuth 2.1 + Bearer auth CONNECTED ONCE R2 Files + Skills GitHub Cloudflare Stripe (rk_ read-only) + 1-file providers

Why One Gateway Beats 5 Separate MCPs

Dimension5 Separate MCP Servers@taktekhq/workspaces
Setup for a new agent5 configs + 5 token copies per machine1 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 / deletePrompt instruction onlyCode-enforced Tier-3 approval + R2 lock
Cross-agent handoffsCopy-paste between appsShared R2 ws/ scratchpad + Skills
Hosting & privacyThird-party SaaS holds your tokensYour Cloudflare account ($0/mo free tier)

Permission Tiers Enforced in Code

Tier 1 · read

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.

Tier 2 · draft

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).

Tier 3 · approve

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.

Shell · bootstrap & deploy
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:

Shell · connect providers once
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.

~/.gemini/config/mcp_config.json

      

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.

Trace · cap_run("github.merge_pr")
// 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:

  1. Attach a custom domain in wrangler.jsonc (routes) and set workers_dev: false and preview_urls: false.
  2. In Cloudflare Zero Trust Access, create self-hosted applications protecting only workspace.example.com/authorize and workspace.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.
  3. Set AUTH_MODE = "access", ISSUER, ACCESS_TEAM_DOMAIN, ACCESS_AUD, APPROVE_ACCESS_AUD, and ACCESS_ALLOWED_EMAILS in wrangler.jsonc.
  4. Run npm run deploy. Every request to /authorize and /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.ts exporting a WorkspaceProvider, add it to src/index.ts, set the API secret once, and deploy. Every connected AI discovers it via cap_search.
  • Skills over MCP: Upload any markdown playbook to R2 at skills/<name>/SKILL.md. Clients with MCP Prompts see skill:<name>; all others load it via cap_run("files.read_skill", { name }).
  • Private stack on top (Memory, Wiki, Remote Compute): Import createWorkspaceWorker into your own private repo by pinned Git commit SHA so you inherit upstream security fixes with zero copy-paste:
TypeScript · extend core in your private Worker
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.