Skip to main content

Toucan Router

Toucan Router connects WhatsApp, Microsoft Teams and email to coding agents running in T3 Code. When an approved person messages a chat you've routed, Toucan wakes the T3 thread that owns that chat. It then tracks the request until the thread replies, promises a follow-up, escalates to you or closes it.

It is a small, single-operator tool for people who already run Claude Code or Codex threads in T3 Code and want colleagues to be able to ask those threads for work.

WhatsApp (wacli) ─┐                       ┌─> T3 thread "project-a" ─┐
Teams (bot)     ──┼─> toucan sync ─ wake ─┤                          ├─> toucan reply / promise / escalate
Email (notmuch) ──┘    (allowlist)        └─> T3 thread "project-b" ─┘        │
                                                                              v
                                    WhatsApp, Teams (as the bot), or a draft to you

What it does:

  • Reads approved chats only. People are matched by WhatsApp JID, Entra ID or email address, never by display name.
  • Wakes a thread through its T3 webhook. The wake carries counts and times, never message text.
  • Tracks every request: claim, reply --final, reply --promise WHAT --due 3h, done, close, escalate, resume. Overdue promises and unclaimed requests send an alert.
  • Sends replies to WhatsApp, posts them in Teams as a bot, or drafts them to you. Email is read-only: Toucan never sends email.
  • Uploads proof videos with toucan upload, through any uploader command you configure.
  • Rotates T3 threads whose context gets large, and hands requests to a fallback thread on another provider while one is rate-limited.

Requirements

  • Linux with systemd user services, Python 3.11 or newer, and uv or pipx.
  • T3 Code running on the same machine.
  • At least one source: wacli for WhatsApp, the Toucan Teams bot for Teams, or notmuch for email.

Quick start

Toucan is set up by an agent, not by hand. Paste this into Claude Code or Codex on the machine that runs T3 Code:

Install toucan-router with `uv tool install toucan-router`, then run `toucan guide` and follow
it to set Toucan up for me. Ask me before adding anyone or turning anything on.

The agent installs the package, asks for your name, timezone and number, discovers your chats, adds the people and routes you pick, wires each owner thread to T3, and turns on the timer. toucan doctor shows what's configured and what's left at any point.

The guides are in docs/ and inside the package (toucan guide --list):

Topic Covers
setup-t3 owner threads, webhook tasks, hook files
setup-whatsapp wacli pairing and sync
setup-teams the Teams bot: registration, approval, routing
setup-email read-only email through notmuch
setup-upload the upload hook, and Loom through toucan-router-tools
setup-sheets Google Sheets through toucan-router-tools
setup-alerts ntfy or any alert URL
configuration every config key
operations the request lifecycle, rotation, escalations, recovery

toucan guide prints AGENTS.md, the instructions agents follow.

How much you need to set up

Most people stop after the first or second tier.

Tier Adds Outside accounts Background services
1 T3 Code + WhatsApp a dedicated phone number wacli sync, toucan-sync timer
2 + email (read-only) none new your mail sync
3 + Teams one Azure Bot, approved once by a Teams admin, and a public HTTPS URL toucan-bot

Packages

Package Commands What it's for
toucan-router toucan the router. Standard library only.
toucan-teams-bot toucan-bot Teams: receives chat messages and posts replies. Needed for any Teams route.
toucan-router-tools toucan-upload-loom, toucan-sheets optional tools for agents: Loom uploads (docs/setup-upload.md) and Google Sheets (docs/setup-sheets.md). The router doesn't need them.

Status

Version 0.1. T3 Code is the only supported agent host. Toucan reads some of T3's internal tables for optional features (rotation, rate-limit fallback, resume). When a T3 update changes them, those features turn off, toucan doctor warns, and wakes keep working.

WhatsApp support uses wacli, an unofficial client. Use a dedicated number: WhatsApp can ban numbers that use unofficial clients. The Loom uploader in toucan-router-tools also uses Loom's unofficial API and is marked experimental. Read SECURITY.md before routing chats from people you don't fully trust: their messages reach agents that can run commands.

Development

uv venv && uv pip install -e . pytest && .venv/bin/python -m pytest -q
(cd bot && uv venv && uv pip install -e '.[test]' && .venv/bin/python -m pytest -q)
(cd tools && uv venv && uv pip install -e . pytest && .venv/bin/python -m pytest -q)

MIT licensed. See LICENSE.

Metadata

Release files for toucan-router 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for toucan-router 0.2.0
File Size Uploaded Provenance Actions
toucan_router-0.2.0.tar.gz 192.6 kB Without provenance Details for toucan_router-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for toucan-router 0.2.0
File Interpreter ABI Platform Actions
toucan_router-0.2.0-py3-none-any.whl Python 3 none any Details for toucan_router-0.2.0-py3-none-any.whl

Total release size: 335.9 kB

Release files / toucan_router-0.2.0.tar.gz

Download URL toucan_router-0.2.0.tar.gz
Size 192.6 kB
Tags Source
SHA-256 checksum
How to use checksums
919f29831e2f8abbad1aa2b6948af3b6e8f1a7a580df5130417309a514177cfe
BLAKE2b-256 checksum
How to use checksums
d464fff904559f542d3e41dfdc0a82d0215d29cf46038ce4c9f862020fe26ac2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / toucan_router-0.2.0-py3-none-any.whl

Download URL toucan_router-0.2.0-py3-none-any.whl
Size 143.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3da2084648753f1422b776aaae80bd6a17183be73c89a0e6619e582ebaf3a85b
BLAKE2b-256 checksum
How to use checksums
ff2ed7ceac0a93fecc90848d91f108e04dd8fe93c516cd6f30facfe9d0387843
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Security for toucan-router 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page