How-to

Connecting an MCP Email Server to Claude Desktop: A Step-by-Step Guide

Akshay Sarode 6 min read
Direct answer

Add an MCP server entry for @ujexdev/postbox-mcp to Claude Desktop's config file, authenticated with an inbox-scoped Ujex API key (prefix apk_sc_), then fully quit and relaunch Claude Desktop. Once the new tools show up in the tools list, you can ask Claude in plain language to check your agent's inbox or send an email, and it calls Postbox directly instead of you copying text into a mail client. Setup takes about five minutes once you have a key in hand.

Claude Desktop already runs whatever MCP servers you point it at: a filesystem server for local files, a shell server for commands, a database server for queries against production data. Email works the same way. Instead of drafting a reply yourself and pasting it into Gmail, Claude drafts it and sends it, then reads whatever comes back, all inside the same conversation. This post walks through wiring up @ujexdev/postbox-mcp, the MCP server Ujex ships for its Postbox email subsystem, so a Claude Desktop conversation can read and send mail through your agent's own inbox by the end of it.

What you're actually connecting

Postbox is the part of Ujex that gives an agent a real inbox: sending, receiving, and threaded conversations, backed by an actual mail server rather than a webhook simulation bolted onto a shared address. Inbound mail is verified with signed webhooks, so a message that lands in your agent's inbox is provably from Ujex's mail infrastructure and not something spoofed further up the chain.

@ujexdev/postbox-mcp is the piece that makes Postbox usable from an MCP client. It's a small server process that speaks MCP on one side and calls the Postbox API on the other, translating "send an email" or "check for new messages" into whatever calls Postbox actually expects underneath. Because MCP is a protocol and not a Claude-specific feature, the same server works with any MCP-compatible client. Claude Desktop is just the one this post walks through, since it's the most common place people first hook an agent up to a real inbox.

Claude Desktop MCP server @ujexdev/postbox-mcp Postbox Inbox
Claude Desktop talks to the Postbox MCP server over stdio; the server calls Postbox, which reads and writes against your agent's own inbox.

Two kinds of Ujex keys, and which one to use here

Ujex separates two identities that are easy to conflate at first. Your human account signs in through Firebase Auth, same as any SaaS login. Your agent, separately, gets its own identity through API keys: a device key (prefix ap_live_) that authenticates broadly as the agent, or an inbox-scoped key (prefix apk_sc_) that's locked to a single Postbox inbox and nothing else.

For an MCP server sitting in a plaintext config file on your laptop, I'd default to the inbox-scoped key every time. It's not that the device key would fail here, it's that handing a local process broad agent-account access to do one job, email, is more blast radius than the job needs.

Key typePrefixScopeGood fit for this MCP server?
Device keyap_live_Full agent identity, account-wideWorks, but broader than the job needs
Inbox-scoped keyapk_sc_Locked to one Postbox inboxYes, this is what the config below uses

Wire it up

Four steps get you from nothing to a working setup: get a key, edit the config, restart, and confirm it worked with a real message.

Try it

Sign in to the Ujex dashboard and open the Postbox inbox you want Claude to use, or create a new one if you don't have one yet. Generate an inbox-scoped API key, prefix apk_sc_, scoped to that single inbox rather than a full-account device key. Copy the value somewhere safe before you navigate away, dashboards typically only show a freshly generated key once.

Claude Desktop reads a JSON config file on startup and launches whatever's listed under an mcpServers object. Open that file (or create it if this is your first MCP server) and add an entry for Postbox, something in this shape:

{
  "mcpServers": {
    "ujex-postbox": {
      "command": "npx",
      "args": ["-y", "@ujexdev/postbox-mcp"],
      "env": { "UJEX_API_KEY": "YOUR_UJEX_API_KEY" }
    }
  }
}

Replace YOUR_UJEX_API_KEY with the inbox-scoped key from the previous step. Treat this snippet as illustrative of the general shape, an mcpServers object, a command, an args array, an env block, rather than a guarantee of the exact package invocation or environment variable name Ujex ships right now. Check docs.ujex.dev for the current, authoritative values before you paste. Whatever you end up with, make sure the file is valid JSON: no trailing commas after the last item, every brace and bracket matched.

Quit Claude Desktop fully, not just close the window. On macOS that means Claude Desktop → Quit Claude Desktop from the menu bar, or right-clicking the dock icon and choosing Quit. Closing the window with the red button often leaves the app running in the background with the old config still loaded in memory, so relaunching from the dock icon doesn't pick up your change, you have to end the process first. Reopen it and give it a few seconds to spin up the MCP server as a subprocess.

Start a new conversation and ask Claude something concrete: "check my agent's Postbox inbox for new messages" or "send a test email from my agent's inbox to my own address." If the config loaded correctly, Claude calls the Postbox tools directly, you'll see it reference a tool call in its response rather than declining, hedging, or hallucinating an answer about email it can't actually send.

Confirm the tools actually loaded

Before trusting Claude with a real send, it's worth checking that the server registered at all. Claude Desktop surfaces connected MCP servers and their tools in its settings, or via a small tools icon near the chat input depending on your version. Look for an entry tied to whatever key you used in the config, ujex-postbox in the snippet above, with a handful of tools listed underneath it: something along the lines of sending a message, listing recent messages, and reading a thread. Exact tool names are defined by the server itself and can change between releases, so treat what's actually in the UI as the source of truth over anything printed here, and check docs.ujex.dev if you want to know the current list ahead of time. If the entry isn't there at all, skip down to the troubleshooting section before trying to send anything.

Send a real test email

Once the tools show up, ask Claude to send a short test message from the agent's inbox to an address you can actually check, your own personal email works fine for this. It should land within a minute or two, with the agent's Postbox address as the sender. Reply to it from your inbox. Then ask Claude to check the inbox again: a correctly wired setup pulls your reply back in as part of the same thread rather than a disconnected new message, because Postbox tracks threaded conversations instead of treating every message as standalone.

That round trip, agent sends, human replies, agent reads the reply back in context, is the real proof the wiring is correct. It matters more than the tools simply appearing in a list, since a stale key or a misconfigured inbox can still show tools in the UI while every actual call fails.

When something doesn't work

Two things account for almost every "the tools didn't show up" report. First, a JSON syntax error in the config file: a missing comma between server entries, a trailing comma after the last key, an unmatched brace. Claude Desktop tends to fail quietly rather than telling you the config didn't parse, so run the file through a JSON validator, or just read it slowly, before assuming the server itself is broken.

Second, and more common than it should be: Claude Desktop wasn't actually restarted. Closing the window is not the same as quitting the app, most desktop apps on macOS and Windows keep running after the last window closes, and Claude Desktop is no exception. Quit it from the menu bar or system tray, confirm there's no lingering Claude Desktop process, and relaunch clean.

If both of those check out and the server still isn't listed, the next suspect is the key itself, expired, revoked, or scoped to an inbox that no longer exists will make the server fail to authenticate on startup even though the config file is syntactically perfect. Generate a fresh inbox-scoped key from the dashboard and swap it in if you're not sure.

FAQ

Does this work with Claude Code too, or only Claude Desktop?

MCP is a general protocol, not a Claude Desktop-only feature, and Claude Code supports it as well. Conceptually the setup is the same idea: register the Postbox MCP server with an inbox-scoped key so the agent can call its tools during a session. Where you configure it and the exact file format differ between the two products, though, and since this guide is specifically about Claude Desktop's config file, check the current Claude Code documentation for the equivalent steps there rather than assuming the JSON above transfers unchanged.

What if I don't have a Postbox inbox set up yet?

You need an inbox before an inbox-scoped key means anything. See How to give an AI agent its own email address for the walkthrough on creating one, then come back here for the MCP wiring.

The new tools don't show up after I restart, what should I check first?

Almost always one of two things: a JSON syntax error in the config, a stray or missing comma is the usual suspect, or Claude Desktop not actually having restarted, since closing the window doesn't quit it on most systems. Quit from the tray or menu bar, confirm the process ended, and relaunch before digging further.

Is it safe to put my Ujex API key in a plaintext config file?

Use an inbox-scoped key (apk_sc_) rather than a device key, so a leaked config exposes one inbox instead of your whole agent identity. Inbound mail is also verified with signed webhooks on Ujex's side, so messages arriving in the inbox can't be spoofed at the transport layer. Beyond that, treat the config file the way you'd treat any other file holding a credential: don't commit it to a public repo, don't share your screen with it open.

Does any of this cost money?

Ujex has a free tier, and its SDKs, the Postbox MCP server included, ship under Apache-2.0. Check docs.ujex.dev for current tier limits before you build something that depends on high send volume.