Inside Capsid
Its 9 parts, what each runs on, and how they connect, plus the 2 outside systems it works with.
| Part | Kind | Runs on | What it does |
|---|---|---|---|
| MCP Worker | worker | Cloudflare Worker | Serves MCP, the operator routes, /health and the Portal's API. |
| Portal | site | React, served by the Worker | The admin view, behind Cloudflare Access. |
| Five-minute tick | cron | Workers cron trigger | Auto-merge, the watcher and the daily passes. |
| capsid | database | D1 with FTS5 | Documents, jobs, agents and the audit log. |
| Search index | database | Cloudflare AI Search | A meaning index of every document, derived from D1 and rebuildable from it. D1 stays the record. |
| capsid-media | bucket | R2 | Media and the daily backups. |
| capsid-mcp-tool-calls | bucket | R2 | Copies of the tool-call log, kept a year under a lock rule after the log prunes them. |
| app KV | kv | Workers KV | Caches, rate-limit counters and computed documents. |
| OAuth KV | kv | Workers KV | The OAuth provider's grants and tokens, kept apart from the app KV. |
Outside it
- Agents (Coding sessions over MCP): The sessions that post, claim and work jobs.
- GitHub (Repos, pull requests, Actions): Where the code, the pull requests and CI live. Capsid reaches it through its GitHub App.
How they connect
- MCP Worker writes to capsid
- MCP Worker writes to capsid-media
- MCP Worker writes to capsid-mcp-tool-calls
- MCP Worker writes to app KV
- MCP Worker writes to OAuth KV
- MCP Worker serves Portal
- MCP Worker serves Agents
- MCP Worker writes to GitHub
- MCP Worker reads GitHub
- Five-minute tick reads GitHub
- Five-minute tick writes to GitHub
- GitHub deploys MCP Worker
- GitHub watches MCP Worker
- Five-minute tick writes to capsid
- Five-minute tick writes to app KV
- Five-minute tick writes to Search index
- MCP Worker reads Search index
- MCP Worker reads capsid
Flows through it
- A job's life, in 9 steps: One job, from the moment a session posts it to the moment Capsid checks the agent's claims against GitHub.
- A search, in 6 steps: One question to the knowledge base, searched by keyword and by meaning. Capsid checks every match against the database before it shows it.
- A session starts, in 6 steps: How a coding session picks up where the last one stopped: it starts from the project's notes and writes back what it decides.
- The nightly backup, in 7 steps: Once a day the Worker copies the whole store to R2, keeps daily, weekly and monthly copies, and trims old history only after a copy holds it. A watcher checks that the copy outside the account is fresh.