HANDOFF TO COWORK AGENT
Documentation for Sessions
Handoff: Codebase Agent → Cowork
Created: February 1, 2026 From: Codebase Agent (Cursor/Claude Code - Session 79) To: Cowork Agent (Claude Desktop) Priority: HIGH Type: validation
TL;DR
I've implemented the MCP JSON-RPC controller and handoff tools. Your job: test the custom connector in Claude Desktop and validate everything works.
What I Implemented
1. MCP JSON-RPC Controller
File: apis/backend-ai-api/src/app/mcp-gateway/mcp-jsonrpc.controller.ts
Endpoints:
POST /ai-api/mcp- Main JSON-RPC endpointPOST /ai-api/mcp/jsonrpc- Alternative endpointGET /ai-api/mcp/events- SSE for real-time events
Protocol Methods:
initialize- Auto-registers Claude Desktop as Cowork agenttools/list- Returns all 79+ tools including new handoff toolstools/call- Execute any MCP toolresources/list- Returns empty (future expansion)prompts/list- Returns empty (future expansion)ping- Health check
2. Handoff Tools (3 New)
| Tool | Description |
|---|---|
check_handoffs |
Poll for pending handoffs assigned to you |
accept_handoff |
Accept a handoff before starting work |
complete_handoff |
Mark handoff complete with results |
3. Auto-Registration
On initialize, the controller:
- Extracts client info from headers (User-Agent, X-Client-Info)
- Generates unique agentId:
cowork-{clientName}-{timestamp} - Registers in AgentRegistry with capabilities
- Returns agentId in response for future handoff operations
4. SSE Events
The /mcp/events endpoint:
- Heartbeat every 30 seconds
- Handoff completion events
- Per-agent event streams
Your Testing Tasks
Task 1: Validate Connector Setup
Start the backend:
cd apis/backend-ai-api yarn start:devAdd custom connector in Claude Desktop:
- Name:
GoGrab AI Test - URL:
http://localhost:3000/ai-api/mcp
- Name:
Observe:
- Does Claude Desktop discover tools?
- Can you see 79+ tools in the tool picker?
- Any errors in Claude Desktop logs?
Document findings in: session-79/79.1-protocol-validation-results.md
Task 2: Test Tool Execution
Try calling these tools:
preflight:
Call preflight with task: "Test the Claude Desktop connector integration"get_stats:
Call get_stats to verify MCP system statuscheck_handoffs:
Call check_handoffs with your agentId (from initialize response)
Task 3: Test Handoff Flow
Create a test handoff from Cursor: I'll create a handoff to you using
create_handoff.You poll for it: Call
check_handoffs- you should see the pending handoff.You accept it: Call
accept_handoffwith the handoffId.You complete it: Call
complete_handoffwith a response.Verify notification: I should receive a completion event.
What You Should Report Back
Protocol Compatibility
[ ] Claude Desktop sends standard MCP JSON-RPC
[ ] Tool list loads correctly (79+ tools)
[ ] Tool execution works (preflight, log_decision)
[ ] Agent auto-registration works
Issues Found
<!-- List any errors, mismatches, or problems -->
Recommended Changes
<!-- Any changes needed to make this work better -->
Handoff for You to Test
I'm creating a test handoff right now. After you connect, call check_handoffs and you should see it.
Handoff Details:
- Type:
code-to-browser - Summary: "Validate Claude Desktop connector integration works end-to-end"
- Tasks:
- Connect via custom connector
- Verify tool discovery
- Execute preflight tool
- Check for this handoff
- Complete this handoff with findings
Files I Created/Modified
| File | Action |
|---|---|
mcp-gateway/mcp-jsonrpc.controller.ts |
Created |
mcp-gateway/mcp-gateway.module.ts |
Updated (added controller) |
docs/english/AI/CLAUDE-DESKTOP-CONNECTOR-SETUP.md |
Created |
session-79/HANDOFF-TO-COWORK-AGENT.md |
Created (this file) |
Communication Protocol
If You Find Issues
Create handoff back with:
- What failed
- Error messages
- What you think the fix is
If Everything Works
Create summary with:
- Confirmation all tests passed
- Any edge cases discovered
- Recommended next steps
Success Criteria for This Handoff
- Custom connector connects successfully
- All 79+ tools discoverable
- preflight tool executes correctly
- check_handoffs returns pending handoff
- accept_handoff marks handoff as acknowledged
- complete_handoff marks handoff as completed
- Completion event received (if SSE works)
Handoff created by Codebase Agent Session 79.2 - MCP JSON-RPC Implementation Complete