Inbox Switchboard

Connect every Gmail inbox to your AI assistant, not just one. A free, zero-dependency, local MCP server with 21 tools to search, read, label, archive, draft, reply and send across multiple Gmail and Google Workspace mailboxes. Bring your own Google key; keys are stored in the OS password vault.

Documentation

Inbox Switchboard

Connect every Gmail inbox to your AI, not just one.

Explainer video · Setup guide with pictures · Step-by-step walkthrough · Quick start

npm inbox-switchboard Official MCP Registry io.github.kowalcg/inbox-switchboard MIT licence Node 18+ Zero dependencies MCP server

Watch the two-minute explainer video
▶ Watch the two-minute explainer

Most AI assistants let you connect a single inbox. If you run a business you probably have several: your own, support@, billing@, a personal Gmail. Inbox Switchboard is a small MCP server that puts any number of them behind one connection. Claude (or any MCP client) can search, read, label, draft and send from each, and always knows which mailbox it is working in.

  • One server, unlimited mailboxes (Google Workspace and personal Gmail both work)
  • 21 tools: search, read threads and attachments, labels, archive, spam, trash, drafts, replies, forwards, send (what each one does)
  • Your mail stays between your computer and Google. There is no middleman server and nobody else's keys are involved
  • Zero dependencies: one JavaScript file, needs only Node 18+
  • Cannot permanently delete mail (it uses Google's gmail.modify permission, which does not allow it)
  • Optional drafts-only mode, so nothing is ever sent without you pressing Send in Gmail

How it works

Your inboxes connect to Inbox Switchboard on your computer, which connects to your AI assistant

You create your own free Google "app" (an OAuth client) once. Each mailbox then signs in to that app through the normal Google consent screen. The key and every sign-in are kept in your computer's password vault (Keychain on a Mac), never in a plain file and never in the chat.

Setup (about 15 minutes, once)

1. Create your Google key

The easy way: let your AI do the clicking. If you use Claude in Chrome or another browser agent, paste this:

Walk me through creating a Google OAuth client for a tool called Inbox Switchboard.
Work in my browser, one step at a time, and tell me what you are about to click before you click it.
1. Open console.cloud.google.com and create a new project named "Inbox Switchboard".
2. In APIs & Services > Library, enable the Gmail API for that project.
3. Open Google Auth Platform and click Get started. App name "Inbox Switchboard", my email for
   support and contact. For Audience choose Internal if all my mailboxes are in one Google
   Workspace; otherwise choose External.
4. If you chose External: on the Audience page, click Publish app so the status is "In production".
5. On the Clients page, create a client with application type "Desktop app", then download its JSON.
Stop and let me handle any sign-in, password or billing screen myself. Do not change anything else
in my Google account. The downloaded JSON file is a secret: do not open it, read it, or show its
contents, and never ask me to paste it into this chat. When it has downloaded, just tell me to run
"npx -y inbox-switchboard setup" in my own terminal.

The manual way:

  1. Go to console.cloud.google.com and create a new project (any name).
  2. Open APIs & Services → Library, find Gmail API, click Enable.
  3. Open Google Auth Platform and click Get started. Enter an app name and your email.
    • If every mailbox is in the same Google Workspace, choose Internal. Done.
    • Otherwise choose External. When the wizard finishes, open Audience and click Publish app so the status reads "In production". You do not need Google's verification for your own use; you will see an "unverified app" notice when signing in (click Advanced → Go to app).
    • Do not leave an External app in "Testing": Google then expires every sign-in after 7 days.
  4. Open Clients → Create client. Application type: Desktop app. Create it, then Download JSON.

Google renames these screens from time to time. The names above were checked in December 2026.

2. Lock the key in your password vault

Open a terminal (Terminal on a Mac, PowerShell on Windows) and run:

npx -y inbox-switchboard setup

It finds the client_secret…json file in your Downloads folder, stores the key in your computer's password vault, and deletes the download. You should see:

Stored your Google key in macOS Keychain.
Deleted the downloaded file: …/Downloads/client_secret_….json

Three rules that keep the key safe

  1. Never paste the key into a chat, including your AI assistant. You run the command; the assistant never sees the key.
  2. Never email it or leave it in a shared or synced folder. After setup there is no file left to leak.
  3. If it ever gets out, cancel it. Delete the client in Google Cloud Console and run setup again with a new one.

Other commands: … status shows where things are stored and which mailboxes are connected. … forget removes the key and every sign-in from this computer.

3. Install

Claude Code:

/plugin marketplace add kowalcg/inbox-switchboard
/plugin install inbox-switchboard@inbox-switchboard

Claude Desktop, Cursor, or any other MCP client: add this to the client's MCP config (Claude Desktop: Settings → Developer → Edit Config) and restart it. It needs Node.js 18 or newer.

{
  "mcpServers": {
    "inbox-switchboard": {
      "command": "npx",
      "args": ["-y", "inbox-switchboard"]
    }
  }
}

One-click install:

Add to Cursor Add to VS Code

The older form npx -y github:kowalcg/inbox-switchboard still works if you would rather install from GitHub.

Prefer a fixed copy you control? Download server.mjs and use "command": "node", "args": ["/full/path/to/server.mjs"] instead.

4. Connect your mailboxes

Ask your assistant:

Connect my mailbox you@yourcompany.com

It gives you a Google sign-in link. Open it, pick that account, approve. Repeat for each mailbox. Then try:

List my mailboxes, then show me unread mail from this week in each one.

What it does

Inbox Switchboard gives your AI assistant 21 actions ("tools") it can use in any mailbox you have connected. You never call them yourself. You ask in plain words, and the assistant picks the right tools and the right mailbox.

What that lets you do

  • One search across every inbox. "Check all my mailboxes for anything from our accountant this month."
  • Clear a shared inbox. "Draft replies to the five oldest unanswered emails in support@." You review the drafts and send.
  • Chase paperwork. "Find last week's invoices in billing@, save the PDFs' details and list who has not paid."
  • Tidy up. "Archive the newsletters in my personal Gmail, label the receipts, and mark the rest read."
  • Reply from the right address. A customer email to support@ is answered from support@, not from your personal account.
  • Daily brief. "Give me the three things that need me today across all inboxes."

Every tool except list_mailboxes and authorize_mailbox takes an account (the mailbox address), so the assistant always states which inbox it is acting in.

The 21 tools

Mailboxes (3)

ToolWhat it doesExample request
list_mailboxesLists every mailbox that is connected. The assistant calls this first."Which inboxes can you see?"
authorize_mailboxConnects a new mailbox, or reconnects one whose access expired. Returns a Google sign-in link for you to approve."Connect my mailbox billing@mycompany.com"
remove_mailboxDisconnects a mailbox by deleting its saved sign-in from your computer."Disconnect my personal Gmail"

Find and read (4)

ToolWhat it doesExample request
search_mailSearches one mailbox with Gmail's own search language (from:, newer_than:7d, has:attachment…), including archived mail. Returns up to 100 results a page."Anything from Amy in the last week?"
get_messageOpens one email: sender, subject, body and the list of attachments."Open the latest one"
get_threadReads a whole conversation, every message in order."Summarise this thread"
get_attachmentFetches one attachment from an email."What does the attached quote say?"

Labels (3)

ToolWhat it doesExample request
list_labelsLists the labels (folders) in a mailbox."What labels do I have in support@?"
create_labelCreates a new label."Make a label called Receipts 2026"
apply_labelsAdds or removes labels on one or many emails."Label these five as Receipts 2026"

Organise (5)

ToolWhat it doesExample request
mark_readMarks emails read or unread."Mark the newsletters as read"
star_mailStars or unstars emails."Star anything from the bank"
archive_mailRemoves emails from the inbox but keeps them in All Mail."Archive everything older than a month"
mark_spamSends emails to Spam, or rescues them from it."That one is spam"
trash_mailMoves emails to Trash. Gmail keeps them 30 days; nothing is deleted for good."Bin these three"

Write (2)

ToolWhat it doesExample request
draft_mailWrites a new email and leaves it in Drafts. Plain text or HTML, with CC and BCC."Draft a note to Sam about Friday"
reply_draftWrites a reply inside the existing conversation and leaves it in Drafts. Reply or reply-all."Draft a reply saying yes"

Send (4)

ToolWhat it doesExample request
send_mailSends a new email from the mailbox you name."Send it from billing@"
reply_mailSends a reply in the existing conversation."Reply that we ship Monday"
send_draftSends a draft that is already in the mailbox."Looks good, send that draft"
forward_mailForwards an email with its attachments. Makes a draft unless told to send now."Forward this to my bookkeeper"

The assistant is told to confirm recipients and wording with you before any of the four send tools. With drafts-only mode on (see Options), send_mail, reply_mail and send_draft are removed and forward_mail can only create drafts, which leaves 18 tools.

What it cannot do: permanently delete mail, change Gmail settings or filters, read contacts or calendar, or touch any mailbox you have not connected.

Try it and check its score on Glama

Inbox Switchboard MCP server

Inbox Switchboard is listed on Glama. There you can browse the server's tools, check its quality score, and test it online with the MCP Inspector.

Options

Set these as environment variables in the MCP config ("env": { ... }):

VariableEffect
INBOX_SWITCHBOARD_NO_SEND=1Drafts only. Removes send_mail, reply_mail and send_draft, and blocks forward_mail from sending. Recommended while you are getting comfortable.
INBOX_SWITCHBOARD_VAULT=fileOnly for computers with no password vault (for example a headless Linux server). Stores the key and sign-ins in one file only your account can read, in ~/.config/inbox-switchboard/ or $INBOX_SWITCHBOARD_HOME.

Security

How it is built:

  • Local only. The server talks to three Google addresses (accounts.google.com, oauth2.googleapis.com, gmail.googleapis.com) and nothing else. No analytics, no update checks, no third-party services.
  • Keys live in the vault, not in files. The Google key and each mailbox sign-in are stored in the operating system's password vault: Keychain on macOS, the Secret Service keyring on Linux, and a file encrypted for your Windows account (DPAPI) on Windows. Secrets are handed to the vault on standard input, never on a command line. Nothing is bundled with this repository.
  • The assistant never handles the key. You store it yourself with the setup command. The server tells the assistant not to ask for keys, open key files or print them.
  • Upgrading is automatic. If version 1.0 left oauth-client.json and tokens.json on disk, the first run moves them into the vault and deletes the files.
  • Careful sign-in. The Google sign-in uses PKCE and a one-time state value, listens on 127.0.0.1 only, and refuses to store a mailbox if the approved account is not the one you asked for.
  • Least privilege that still works. It requests gmail.modify, which cannot permanently delete mail.
  • One file, no dependencies. server.mjs is about 600 lines. You can read all of it.

What to keep in mind:

  • The vault protects the key from being synced, backed up, shared or pasted by accident. It does not protect against malicious software already running under your own login, which can ask the vault the same way this tool does. Keep your computer clean and locked.
  • Tested on macOS. The Linux and Windows vault paths follow each system's documented tools but have not been tested on real machines yet; please open an issue if one misbehaves.
  • The server asks the assistant to confirm with you before sending. For a hard guarantee, use INBOX_SWITCHBOARD_NO_SEND=1.
  • Email is untrusted input. A message can contain text written to trick an AI assistant; review what your assistant proposes before approving actions.
  • To revoke access completely, remove your app at myaccount.google.com/permissions.

Troubleshooting

ProblemFix
"Setup needed: no Google key is stored yet"Run npx -y inbox-switchboard setup in your terminal after downloading the key (step 2).
403 access_denied at sign-inThe app is External + Testing and this mailbox is not a test user. Publish the app (step 1).
A mailbox stops working after a weekSame cause: app still in Testing. Publish it, then reconnect the mailbox.
"Wrong account" after approvingYou picked a different Google account than the one requested. Ask for a new link.
"authorization has expired or was revoked"Ask your assistant to connect that mailbox again.

Want it set up for you?

I build AI systems inside small and medium-sized businesses. If you would rather have this installed, connected and working with your team's inboxes in one sitting, get in touch.

Greg Kowalczyk · gregkowalczyk.com

License

MIT. Not affiliated with or endorsed by Google. Gmail is a trademark of Google LLC.