Multi-Agent AI Collaboration Tutorial

MCP Full Course Lesson 6 - Multi-agent collaboration patterns

Table of Contents

Multi-Agent AI Collaboration with MCP is a lesson in the GenAI Unplugged MCP Masterclass that shows how to run two Claude Desktop conversations, a Researcher agent and a Writer agent, connected to the same MCP server so one saves research findings and the other reads them to write a polished draft.

What you will be able to do

  • Build an MCP server named collaboration-hub with three tools: save_research, read_research, and save_draft
  • Run two separate Claude Desktop conversations as a Researcher agent and a Writer agent that share work through one MCP server
  • Decide when a task calls for a single agent versus multiple specialized agents, using the decision framework from the lesson
  • Update your Claude Desktop config to add a new MCP server alongside an existing one, using your Python path and server.py path
  • Verify your MCP SDK installation with check_setup.py before writing the server code

Before you start

  • Completed the previous lesson's MCP server build, or have run pip install mcp to get the SDK
  • Python 3 installed, with the ability to create and activate a virtual environment
  • Claude Desktop installed and signed in (from claude.ai/download), used as the MCP host
  • A code editor such as VS Code, Cursor, or PyCharm

Reference

Step / Tool Purpose Details
check_setup.py Verify MCP SDK install Imports mcp.server.Server, stdio_server, Tool, TextContent; run with python check_setup.py
pip install mcp Install the MCP SDK Skip this step if you already installed it in the previous lesson
save_research tool Save research findings Writes content to research_findings.txt and confirms it saved
read_research tool Read saved research Reads research_findings.txt; reports an error if the file does not exist yet
save_draft tool Save the final document Writes content to final_draft.txt and confirms it saved
server.py Defines the MCP server Server named collaboration-hub; registers the three tools via handle_list_tools and handle_call_tool
Claude Desktop config Connect Claude to the new server Settings, Developer tab, Edit Config; add collaboration-hub alongside the existing note-reader server using your Python path and server.py path

Common errors and fixes

What goes wrong The fix
MCP SDK import fails when running check_setup.py The script prints the ImportError and tells you to run pip install mcp
read_research is called before any research has been saved The tool returns: No research findings found. The Researcher agent needs to save research first using the save_research tool
save_research or save_draft is called with no content The handler returns: Error: No content provided to save
A file read or write fails for another reason The handler catches the exception and returns a message like Error saving research: (the exception text), or Error reading research: (the exception text)

Read the full walkthrough

The complete lesson, with screenshots and any downloads, is published on Substack as part of MCP Masterclass: Connect AI to Everything.

Read Lesson 6 on Substack →

More in this section

Continue the course

Browse all lessons in the MCP Masterclass: Connect AI to Everything course, or subscribe to the GenAI Unplugged newsletter to get new lessons in your inbox.

Dheeraj Sharma

Dheeraj Sharma

AI Systems Builder
Creator of the n8n Zero to Hero course (42 lessons, 31+ hours). I help solopreneurs build AI systems that grow revenue without growing workload.

Get the n8n Mastery Bundle

All workflows, cheat sheets, and premium resources from the entire course in one package.

Read the full lesson on Substack