| title | date | categories | tags | description | image | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Mai-Tai - Async Human-Agent Collaboration From Anywhere |
2025-04-01 |
|
|
How I built Mai-Tai, an async collaboration layer that lets you manage AI coding agents from your phone, laptop, or the beach while they keep working on your projects. |
|
AI coding agents are incredibly capable. They can refactor codebases, write tests, debug issues, and implement features while you provide guidance. But there's a catch: you need to be sitting at your computer, watching the terminal, ready to answer questions the moment they come up.
This creates an awkward dynamic. Your agent hits a decision point and waits. You're stuck watching. Step away for coffee and the whole thing stalls. It's like having a brilliant assistant who refuses to leave you a voicemail.
I wanted something different. I wanted to tell my agent what to work on, walk away, and check in from my phone when I had time. Answer questions from the couch. Review progress from the coffee shop. Keep the work flowing without being chained to my desk.
Mai-Tai is an async collaboration layer that connects AI coding agents to humans via the web. Your agent keeps working while you step away; you check in from any device, answer questions, and review progress whenever you're ready.
The name captures the vision: you should be able to manage your AI assistant while sipping a drink on the beach. Or more realistically, while walking the dog, waiting in line, or pretending to pay attention in a meeting.
The architecture is straightforward:
- Human creates a project and channels in the web UI
- Agent connects via MCP server using an API key
- Agent sends messages, asks questions, reports progress
- Human responds from any device - phone, laptop, wherever
Messages flow through Mai-Tai's backend. The agent doesn't need you at your IDE. You catch up when it's convenient.
Mai-Tai uses the Model Context Protocol (MCP) to integrate with AI agents. The mai-tai-mcp server exposes tools that agents can call:
chat_with_human- Send a message and wait for a replyupdate_status- Non-blocking progress updatesget_messages,get_project_info- Context retrieval
Any MCP-compatible agent host (Claude Desktop, Cursor, Claude Code, etc.) can connect to Mai-Tai and start collaborating asynchronously.
The magic happens when you activate "mai-tai mode" by telling your agent:
"start mai-tai mode"
The agent switches to routing all communication through the web UI. It stops responding in the terminal and uses mai-tai tools instead. Now you can close your laptop, and the conversation continues on your phone.
The agent keeps working, queues questions via chat_with_human, and sends progress updates. You review and respond when you're back - whether that's five minutes or five hours later.
The frontend is designed for phones first. This isn't an afterthought; it's the entire point. If you can't comfortably manage your agent from a mobile browser, the async workflow falls apart.
Projects are organized into channels (like Slack), making it easy to separate concerns. Your agent posts to the appropriate channel; you review when ready.
Setting up Mai-Tai locally takes a few commands:
# Clone and start the stack
git clone https://github.com/jmcdice/mai-tai.git
cd mai-tai
cp .env.example .env
./dev.sh local upThis spins up the frontend (Next.js) at localhost:3000 and the backend API (FastAPI) at localhost:8000.
From there:
- Create a project in the web UI
- Add channels for your workflows
- Generate an API key
- Configure your MCP host to use
mai-tai-mcpwith that key
Your agent is now connected. Tell it to start mai-tai mode and walk away.
Mai-Tai is built with modern, pragmatic choices:
- Frontend: Next.js 14+ with App Router, mobile-first responsive design
- Backend: FastAPI + SQLAlchemy + Alembic for the API and database
- MCP Server: Python package using FastMCP with stdio transport
Everything runs in Docker for local development, with a simple dev.sh script managing the lifecycle.
The current generation of AI coding agents is powerful but synchronous. You're expected to be present, attentive, responsive. That's fine for pair programming sessions, but it doesn't scale.
Real work happens in chunks. You have meetings. You have lunch. You have a life outside the terminal. Mai-Tai acknowledges this reality and builds around it.
The agent becomes a truly asynchronous collaborator. It works while you're away. It waits patiently for your input. It doesn't need you watching every keystroke. You're the manager, not the babysitter.
Mai-Tai is actively evolving. Some directions I'm exploring:
- Multi-agent coordination - Multiple agents working on a project, communicating through shared channels
- Webhook integrations - Trigger agent workflows from external events
- Enhanced context - Better ways for agents to share what they've learned
Mai-Tai is open source and ready to use. Check out the GitHub repository for installation instructions, documentation, and contribution guidelines.
If you've ever wished you could manage your AI agent from your phone while grabbing coffee, this is for you.
Mai-Tai is MIT licensed. Contributions welcome.
