Cowork Code MCP Server
MCP server for real-time messaging and task delegation between Claude Code and Claude Cowork agents
Ask AI about Cowork Code MCP Server
Powered by Claude Β· Grounded in docs
I know everything about Cowork Code MCP Server. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
cowork-code-mcp-server
An MCP server that acts as a real-time bridge for communication and task delegation between Claude Code and Claude Cowork agents.
What it does
Two Claude agents β one running as "code" and the other as "cowork" β can exchange messages and coordinate tasks through a shared SQLite database. Each server instance runs with an identity (code or cowork) and exposes MCP tools scoped to that identity.
Architecture
Claude Code Claude Cowork
| |
| stdio (JSON-RPC) | stdio (JSON-RPC)
v v
CoworkBridge CoworkBridge
(identity: "code") (identity: "cowork")
| |
+----------> SQLite DB <---------------+
~/.cowork-code-mcp/messages.db
Both instances share the same SQLite database. Messages sent by one agent are read by the other. Tasks created by one are picked up and updated by the other.
MCP Tools
| Tool | Description |
|---|---|
send_message | Send a message to the other agent (params: to, content) |
read_messages | Retrieve unread messages for current identity (params: mark_read) |
create_task | Create a task for the other agent (params: to, title, description) |
get_tasks | Get tasks assigned to current identity (params: status filter) |
update_task | Update a task's status and result (params: task_id, status, result) |
Task statuses: pending -> in_progress -> completed | failed
Installation
Prerequisites
- Rust (stable toolchain)
Build and install
git clone https://github.com/jagwar/cowork-code-mcp-server.git
cd cowork-code-mcp-server
cargo build --release
The binary is at ./target/release/cowork-code-mcp-server. The SQLite database is created automatically at ~/.cowork-code-mcp/messages.db on first run.
Configure for Claude Code
Add to ~/.claude/settings.json:
{
"mcpServers": {
"cowork-bridge": {
"command": "/absolute/path/to/cowork-code-mcp-server/target/release/cowork-code-mcp-server",
"args": ["code"]
}
}
}
Configure for Claude Desktop (Cowork)
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"cowork-bridge": {
"command": "/absolute/path/to/cowork-code-mcp-server/target/release/cowork-code-mcp-server",
"args": ["cowork"]
}
}
}
The CLI argument sets the identity β use code or cowork (defaults to code). Both instances must point to the same binary so they share the same database.
Direct DB access (CLI)
You can also interact with the bridge directly via SQLite, useful for scripting or manual testing.
Send a message
sqlite3 ~/.cowork-code-mcp/messages.db \
"INSERT INTO messages (id, sender, recipient, content, read, created_at) \
VALUES ('$(uuidgen)', 'code', 'cowork', 'Your message here', 0, datetime('now'));"
Create a task
sqlite3 ~/.cowork-code-mcp/messages.db \
"INSERT INTO tasks (id, sender, recipient, title, description, status, created_at) \
VALUES ('$(uuidgen)', 'code', 'cowork', 'Task title', 'Task description', 'pending', datetime('now'));"
Check for unread messages and pending tasks
sqlite3 -header -column ~/.cowork-code-mcp/messages.db \
"SELECT id, sender, content, created_at FROM messages WHERE read=0 AND recipient='code';"
sqlite3 -header -column ~/.cowork-code-mcp/messages.db \
"SELECT id, sender, title, description, created_at FROM tasks WHERE recipient='code' AND status='pending';"
Swap 'code' and 'cowork' to target the other direction. You can batch multiple INSERTs β the recipient picks them up on next poll.
Project structure
src/
main.rs # MCP server, tool handlers, and stdio transport
db.rs # SQLite database layer (messages + tasks tables)
Dependencies
- rmcp β MCP protocol implementation (server, macros, stdio transport)
- tokio β Async runtime
- rusqlite β SQLite with bundled library
- serde/serde_json β JSON serialization
- uuid β UUID v4 generation for message/task IDs
- chrono β Timestamps (RFC 3339)
- schemars β JSON Schema generation for tool parameters
- anyhow β Error handling
License
MIT β see LICENSE.
