What This Example Shows
- Plugging three live MCP servers (Gmail, Google Calendar, Notion) into a single agent via
mcp_configs - Carrying conversation history across a full day so the agent remembers what you talked about at 9am when you ping it again at 4pm
- Sub-agent delegation: a main Chief of Staff that hands off to specialists (Inbox Triager, Meeting Prep, Notion Logger) when it’s time to do real work
- Structured outputs for clean calendar slots and Notion rows
- An idiomatic Python CLI loop you can paste into a terminal and start using today
- A cron-style 7am inbox digest you can deploy as your morning routine
Grab a free Swarms API key at swarms.world. The Gmail, Google Calendar, and Notion MCP servers shown here are pluggable — point
mcp_url at any hosted MCP endpoint that exposes those tools (Composio, Zapier MCP, Pipedream, your own). If you’re new to MCP, start with MCP Integration.Why This Matters
A great Chief of Staff does three things: triages your inbox so you only see what matters, runs your calendar so you never double-book or miss prep, and keeps your second brain (Notion) up to date so context never falls through the cracks. An AI Chief of Staff does the same job in roughly 50 lines of Python, runs you about $0.20/day in API spend, and doesn’t need a 1:1. The trick is wiring one conversational agent into the three tools a real CoS actually lives in — and letting it remember everything you said earlier in the day.The Architecture
Step 1: Setup
You’ll need four environment variables. The three MCP URLs are hosted endpoints you control — either via a provider like Composio/Pipedream/Zapier MCP or your own server. Each one exposes a different toolset to the agent.Step 2: Define the Three Sub-Agents
Each sub-agent is tightly scoped to one job. Keep the system prompts short — these aren’t generalists, they’re specialists the main CoS calls when it needs work done.Sub-agents inherit
max_loops="auto" so they can call MCP tools repeatedly until the task is done — read a thread, then reply; search Notion, then append. The main CoS doesn’t need to micromanage them.Step 3: Wire Up the Main Chief of Staff Agent
The main agent gets all three MCP servers attached and a roster of the three sub-agents underhandoffs. It uses claude-sonnet-4.5 because the orchestration model matters most — it’s the one deciding when to delegate vs. just answer.
Step 4: The CLI Loop with Conversation History
This is the part you’ll actually use. A tiny REPL that accumulates messages across turns so the CoS remembers everything you said today.- Turn 1: the CoS delegates inbox reading to Inbox-Triager, then summarizes.
- Turn 2: the CoS calls Google Calendar MCP directly (single action, no delegation needed), pulls Sarah’s email from history, attaches the PDF.
- Turn 3: “Acme” is never disambiguated — the CoS knows it’s Sarah Chen’s company from the prior two turns and delegates to Notion-Logger to find the right database row.
Step 5: Deploy It as a Daily 7AM Inbox Digest
The CLI is great for the day-to-day. The real flex is letting your CoS proactively brief you before you’ve even opened your laptop. Drop this into a cron job at 7am and you’ll get a digest email every morning.What You Just Built
About 50 lines of Python, three MCP URLs, and you now have:- An always-on Chief of Staff that lives in your terminal (or wherever you wire the loop next — Slack, iMessage, a web app)
- Continuity across the entire day via conversation history
- Specialist sub-agents that handle the heavy lifting (inbox triage, meeting prep, Notion logging) without you ever having to name them
- A 7am morning brief delivered to your real inbox, automatically
Next Steps
- MCP Integration — full reference for
mcp_url,mcp_configs, auth headers, and multi-server setups - Sub-Agent Delegation — how the main agent dynamically picks and runs specialists
- Conversation History — the exact
historyshape and the mistakes to avoid when threading multi-turn context