Module 5 turns REVIEWBOT inside out: the reviewer you built becomes a server that other AI tools can call.
MCP in one line
The Model Context Protocol is an open standard for exposing tools to AI clients. Your agent advertises tools with schemas; any MCP client (Claude Desktop, Cursor, OpenCode, another agent) can discover and call them.
ReviewMCP is an McpAgent
ReviewMCP extends McpAgent, so it is a real agent with its own Durable Object, state, and SQLite per session. It creates an McpServer and registers tools in init(): review-pr (fetch a public PR and review it) and review-diff (review a raw diff). Both reuse the same runReview and prompts from Module 2.
Serve and route it
ReviewMCP.serve("/mcp", { binding: "ReviewMCP" }) mounts the server over Streamable HTTP, and the Worker’s fetch handler routes /mcp to it. In wrangler.jsonc you add a second Durable Object binding and a new_sqlite_classes migration for ReviewMCP, and you re-export the class from the entrypoint. Forget the re-export and the binding silently no-ops at runtime.
When you are ready, open the MCP exercise to build it.