WritBase
A control plane for AI agents and human supervisors. Persistent task registry with scoped permissions, inter-agent delegation, and full provenance — all accessible via MCP. Deploy on Supabase free tier in 3 commands.
README
<div align="center">
WritBase
MCP-native task management for AI agent fleets
A control plane for AI agents and human supervisors. Persistent task registry with scoped permissions, inter-agent delegation, and full provenance — all accessible via MCP.
<br/>
<img src="docs/assets/demo.svg" alt="WritBase MCP demo — agent creates a task and delegates to another agent" width="100%"/>
</div>
Why WritBase?
AI agents need a shared, persistent task registry — not ephemeral in-memory state that vanishes between sessions. WritBase gives your agent fleet:
- One source of truth — Tasks live in Postgres, not scattered across files and chat threads
- Scoped permissions — Each agent gets exactly the access it needs, nothing more
- Full provenance — Every change is recorded: who, what, when, and why
- Inter-agent delegation — Agents can assign tasks to each other with depth limits and cycle detection
- MCP-native — Agents connect via the Model Context Protocol, no custom integration needed
Getting Started
Option A: CLI Setup (recommended)
No repo clone needed. Just npx:
npx writbase init # Interactive setup — configures Supabase credentials
npx writbase migrate # Apply database schema
npx writbase key create # Create your first agent key
That's it. Your MCP endpoint is live at:
https://<project-ref>.supabase.co/functions/v1/mcp-server/mcp
Prerequisites: Node 18+, Supabase CLI, a Supabase project (free tier works)
Deploy the Edge Function:
npx supabase functions deploy mcp-server --no-verify-jwtSee the CLI README for all commands.
Option B: Manual Setup
<details> <summary>Clone and deploy manually</summary>
git clone https://github.com/Writbase/writbase.git
cd writbase && npm install
# Create a free project at supabase.com/dashboard, then:
npx supabase link --project-ref <your-project-ref>
npx supabase db push
npx supabase functions deploy mcp-server --no-verify-jwt
Optional dashboard:
cp .env.example .env.local→ edit with your Supabase URL + anon key →npm run devSee the Deployment Guide for Vercel hosting and self-hosted Supabase.
</details>
2. Create a project and agent key
Via the CLI (npx writbase key create), the dashboard, or a manager agent:
- Create a project — e.g.,
my-app. Optionally add departments (backend,frontend,devops) - Create an agent key — name it, pick the
workerrole, save the key (wb_<key_id>_<secret>— shown once) - Grant permissions —
writbase key permit my-agent --grant --project my-app --can-read --can-create --can-update(or via dashboard)
3. Connect your MCP client
<details> <summary><strong>Claude Code</strong></summary>
claude mcp add writbase \
--transport http \
--url https://<project-ref>.supabase.co/functions/v1/mcp-server/mcp \
--header "Authorization: Bearer wb_<key_id>_<secret>"
</details>
<details> <summary><strong>Cursor</strong></summary>
Add to .cursor/mcp.json:
{
"mcpServers": {
"writbase": {
"type": "streamableHttp",
"url": "https://<project-ref>.supabase.co/functions/v1/mcp-server/mcp",
"headers": { "Authorization": "Bearer wb_<key_id>_<secret>" }
}
}
}
</details>
<details> <summary><strong>VS Code / Copilot</strong></summary>
Add to .vscode/mcp.json:
{
"servers": {
"writbase": {
"type": "http",
"url": "https://<project-ref>.supabase.co/functions/v1/mcp-server/mcp",
"headers": { "Authorization": "Bearer wb_<key_id>_<secret>" }
}
}
}
</details>
<details> <summary><strong>Windsurf / Claude Desktop / Other</strong></summary>
See the MCP Config Reference for all supported clients. </details>
4. Use it
Ask your agent:
"Check my WritBase permissions" → calls info
"Create a task in my-app: Fix login bug" → calls add_task
"Mark it as in_progress" → calls update_task (with version for concurrency)
"Show all high priority tasks" → calls get_tasks with priority filter
5. Scale up
| Agent | Role | Scoped to | Use case |
|---|---|---|---|
ci-bot |
worker | my-app/devops — can_create |
CI creates tasks on build failure |
triage-agent |
worker | my-app (all depts) — can_comment |
Reviews tasks, adds notes |
ops-manager |
manager | (workspace-wide) | Manages keys, permissions, projects |
Each agent gets its own key with exactly the permissions it needs — nothing more.
Full walkthrough: Getting Started Guide — permissions, departments, troubleshooting
MCP Tools
Worker Tools (all agents)
| Tool | Description |
|---|---|
info |
Agent identity, permissions, and system metadata |
get_tasks |
List tasks with filtering, pagination, and full-text search |
add_task |
Create a task in permitted scope |
update_task |
Update a task with optimistic concurrency control |
Manager Tools (manager agents only)
| Tool | Description |
|---|---|
manage_agent_keys |
Create, update, deactivate, rotate agent keys |
manage_agent_permissions |
Grant/revoke permissions with subset enforcement |
get_provenance |
Query the append-only audit log |
manage_projects |
Create, rename, archive projects |
manage_departments |
Create, rename, archive departments |
subscribe |
Register webhooks for task event notifications |
discover_agents |
Find agents by capability and skill |
Features
- Multi-tenant workspaces — Signup auto-provisions an isolated workspace
- Dynamic MCP schema — Tool visibility and parameter enums adapt per agent's role and permissions
- 6 permission types —
can_read,can_create,can_update,can_assign,can_comment,can_archive - Project + department scoping — Permissions are granted per (project, department) pair
- Optimistic concurrency — Version-based conflict detection prevents silent overwrites
- Cursor pagination — Efficient traversal of large task sets
- Rate limiting — Per-agent-key request throttling
- Request logging — Every MCP call logged with latency, status, and agent context
Architecture
┌─────────────┐ ┌──────────────────┐ ┌──────────────┐
│ MCP Client │────▶│ Edge Function │────▶│ Postgres │
│ (Agent) │◀────│ (Hono + MCP SDK)│◀────│ (Supabase) │
└─────────────┘ └──────────────────┘ └──────────────┘
│
┌──────┴──────┐
│ Next.js 16 │
│ Dashboard │
└─────────────┘
- Backend: Supabase (Postgres + Edge Functions with Deno runtime)
- Transport: Streamable HTTP (MCP SDK)
- Frontend: Next.js 16 (App Router) + Tailwind CSS
- Auth: Supabase Auth (humans) + SHA-256 agent keys (agents)
Deployment Options
| Supabase Cloud (recommended) | Self-Hosted Supabase | |
|---|---|---|
| Setup | npx writbase init → npx writbase migrate → done |
Docker Compose (5 containers) |
| Cost | Free tier: 500MB DB, 50K MAUs | Your infrastructure |
| Dashboard | Deploy to Vercel (free) | Self-host Next.js |
| Updates | Automatic platform updates | Manual |
| Control | Supabase-managed | Full |
See docs/deployment.md for detailed setup instructions.
Documentation
- Getting Started — Deploy, create an agent key, connect your MCP client, and manage tasks
- CLI Reference —
npx writbase init,migrate,key,status - Deployment Guide — Supabase Cloud, Vercel, and self-hosted setup
- Core Concepts — Permissions, provenance, error codes, delegation
- MCP Config Reference — Client configs for Claude Code, Cursor, VS Code, Windsurf
Contributing
See CONTRIBUTING.md for development setup, testing, and PR guidelines.
Security
See SECURITY.md for vulnerability reporting.
License
Apache 2.0 — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。