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:

Protocol Methods:

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:

  1. Extracts client info from headers (User-Agent, X-Client-Info)
  2. Generates unique agentId: cowork-{clientName}-{timestamp}
  3. Registers in AgentRegistry with capabilities
  4. Returns agentId in response for future handoff operations

4. SSE Events

The /mcp/events endpoint:


Your Testing Tasks

Task 1: Validate Connector Setup

  1. Start the backend:

    cd apis/backend-ai-api
    yarn start:dev
    
  2. Add custom connector in Claude Desktop:

    • Name: GoGrab AI Test
    • URL: http://localhost:3000/ai-api/mcp
  3. 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:

  1. preflight:

    Call preflight with task: "Test the Claude Desktop connector integration"
    
  2. get_stats:

    Call get_stats to verify MCP system status
    
  3. check_handoffs:

    Call check_handoffs with your agentId (from initialize response)
    

Task 3: Test Handoff Flow

  1. Create a test handoff from Cursor: I'll create a handoff to you using create_handoff.

  2. You poll for it: Call check_handoffs - you should see the pending handoff.

  3. You accept it: Call accept_handoff with the handoffId.

  4. You complete it: Call complete_handoff with a response.

  5. 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:


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:

If Everything Works

Create summary with:


Success Criteria for This Handoff


Handoff created by Codebase Agent Session 79.2 - MCP JSON-RPC Implementation Complete