MCP problems

When an AI agent cannot use Mbox Viewer, the cause is one of three things. The client may fail to start the server, the server may refuse the call with an error code, or the policy in Settings › MCP server (AI agents) may hide what the agent asks for. The server is a copy of the app started with --mcp by the client itself. It reads the settings on every call, so most fixes in Mbox Viewer apply to the next request without a restart. Find the error code in the table below, or start with the startup checks if the client shows the server as failed.

Which error code did the agent get?

Every refused call returns a stable code. The agent usually quotes it.

Code Cause Fix
mcp_disabled The server is turned off in Settings. Turn on Enable the MCP server. No client restart is needed.
invalid_token The token was regenerated, or the client holds an old one. Click Copy token, paste it into the client and restart the client.
mailbox_not_allowed The mailbox is not ticked. Tick it under Mailboxes the agent may see.
mailbox_not_ready The mailbox is being indexed, or its file changed. Open it in Mbox Viewer and let indexing finish.
writes_not_allowed A write tool was called while changes are off. Turn on Allow changes to tags and folders if you want it.
export_dir_not_set save_attachment was called without an export directory. Choose an Export directory for attachments.
not_found A message, tag, folder or attachment does not exist. Ask the agent to list them first and to try again.
invalid_argument A parameter is out of range or malformed. The error text names the parameter. Ask the agent to fix it.
internal The server hit an unexpected error. Read the server log, then report the problem.
The MCP server section of the Mbox Viewer settings shows the server turned on, the All mail mailbox ticked and the export button.
Settings › MCP server (AI agents) holds every option that the server reads on each request.

Why does the client show the server as failed?

The server stops before the handshake when it cannot start. Claude Desktop then marks it as failed, and Claude Code shows it as failed in /mcp. Check these causes in order:

  1. The token is missing. The server prints missing token: set MBOX_VIEWER_MCP_TOKEN as copied from Mbox Viewer > Settings > MCP server on stderr. Paste the configuration again, or paste the token into the extension settings.
  2. The app moved. The configuration holds the absolute path of the app executable. On macOS, an app started from the disk image or from Downloads runs from a temporary path. Move Mbox Viewer to Applications, open it from there, then export the extension or copy the configuration again.
  3. Two tokens disagree. When both MBOX_VIEWER_MCP_TOKEN and --token are set with different values, the server stops. Keep the environment variable only.
  4. The client was not restarted. After the first setup or a token change, fully quit the client and open it again. On macOS, closing the Claude window is not enough. Quit Claude with ⌘Q.

The Settings section shows the path that the configuration starts. The line begins with "The configuration starts this copy of the app". If that path points into a disk image or a temporary folder, the section warns you and the extension cannot be exported.

How do I reinstall the Claude Desktop extension?

The extension is the recommended method for Claude Desktop. It needs no file to edit.

  1. In Mbox Viewer, open Settings › MCP server (AI agents). Check that Enable the MCP server is on, then click Export the Claude Desktop extension. The default file is Mbox Viewer.mcpb in your Downloads folder.
  2. Double-click the .mcpb file. Claude Desktop opens and shows an install dialog. Click Install.
  3. Claude Desktop asks for the access token. Click Copy token in Mbox Viewer, paste the token into the form and save. Check that the extension is enabled.

The bundle holds a copy of the app executable, a manifest and an icon. It never holds the token, which Claude Desktop keeps in its own storage for extension settings. Export and install the extension again after each update of Mbox Viewer, so that both run the same version.

To remove the flag, list the extension folders and run xattr on the one whose name contains mbox-viewer:

ls "$HOME/Library/Application Support/Claude/Claude Extensions"
xattr -cr "$HOME/Library/Application Support/Claude/Claude Extensions/<folder>"

How do I check the manual Claude Desktop configuration?

The manual method edits claude_desktop_config.json. Open it in Claude Desktop with Settings › Desktop App › Extensions › Manage › Local MCP Server › Edit Config, which creates the file if needed and shows it in Finder or File Explorer.

System File
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
Windows %APPDATA%\Claude\claude_desktop_config.json

mcpServers is a top-level key of that file. Add it next to the keys already there, such as preferences, and keep them. If mcpServers already exists, add the mbox-viewer entry inside it. The result looks like this:

{
  "preferences": {
    "menuBarEnabled": false
  },
  "mcpServers": {
    "mbox-viewer": {
      "command": "<path to the Mbox Viewer executable>",
      "args": ["--mcp"],
      "env": { "MBOX_VIEWER_MCP_TOKEN": "<token>" }
    }
  }
}

These mistakes break the file or the server:

  • The copied text replaced the whole file, and Claude Desktop lost its preferences.
  • mcpServers sits inside preferences or another key instead of at the top level.
  • A comma is missing between two keys, so the JSON is invalid.
  • The extension and the manual entry are both installed, and the client lists two servers. Keep one method.

On macOS the executable is usually /Applications/Mbox Viewer.app/Contents/MacOS/mbox-viewer. On Windows, Copy for Claude Desktop already doubles the backslashes of the path, as JSON requires.

What about Claude Code?

Click Copy for Claude Code and run the copied command in a terminal. It has this form:

claude mcp add --scope user mbox-viewer -e MBOX_VIEWER_MCP_TOKEN=<token> -- '<path to the Mbox Viewer executable>' --mcp

Check the result with claude mcp list, or with /mcp inside a session. Without --scope user, Claude Code registers the server for the current project only. On Windows, if Claude Code came from npm and the command fails in PowerShell, run it from cmd.exe, because the npm claude.ps1 shim can swallow the --. After a token change, remove the server with claude mcp remove --scope user mbox-viewer and run the new command, as described in Set up Claude Code.

What does the policy allow?

The server applies the policy of the MCP server (AI agents) section on every call.

Setting Default Effect
Enable the MCP server Off Every call answers mcp_disabled while it is off. The token is kept.
Mailboxes the agent may see None ticked Only ticked mailboxes are visible. Others answer mailbox_not_allowed.
Allow changes to tags and folders Off Write tools answer writes_not_allowed while it is off.
Export directory for attachments None save_attachment writes only into this folder.
Regenerate token… Not applicable It revokes every client at once.
Show audit log Not applicable It shows mcp-audit.jsonl in Finder or File Explorer.

The token has 64 hexadecimal characters. It travels in the MBOX_VIEWER_MCP_TOKEN environment variable. The export directory cannot be the disk root, your home folder or a data folder of the app. Each rule has its reason in the security model.

Which tools need which permission?

Read tools work on every ticked mailbox. Write tools need Allow changes to tags and folders. The export tool needs an export directory.

Tool Main parameters Access
list_mailboxes None Read
search_messages mailbox, query, limit (up to 50), offset, sort Read
get_message mailbox, id, max_chars (up to 20,000) Read
get_thread mailbox, id, limit (up to 50) Read
list_labels mailbox Read
list_tags_and_folders mailbox Read
suggest_senders mailbox, prefix Read
create_tag mailbox, name, color Write
set_message_tags mailbox, ids (up to 200), add, remove Write
create_folder mailbox, name, query Write
add_to_folder mailbox, folder, ids (up to 200) Write
remove_from_folder mailbox, folder, ids (up to 200) Write
save_attachment mailbox, id, attachment_index, file_name, overwrite Export

The Tools reference describes every parameter and answer.

Why does the agent see a mailbox as missing on macOS?

The server runs as a child process of the client. When a mailbox file sits in ~/Documents, ~/Desktop or ~/Downloads, the macOS privacy prompt names the client, such as Claude, and not Mbox Viewer. If that access was refused, the agent sees the mailbox as missing or stale and the tools answer mailbox_not_ready, while Mbox Viewer opens the file fine. Allow the client in System Settings › Privacy & Security › Files and Folders, then restart the client.

Which logs should I read?

Log Location Content
Client log of Claude Desktop ~/Library/Logs/Claude/mcp-server-mbox-viewer.log on macOS, %APPDATA%\Claude\logs\mcp-server-mbox-viewer.log on Windows The startup errors that the server prints on stderr.
Client log of Claude Code /mcp in a session, or claude --debug The same startup errors.
Server log mcp-server.log in the logs folder of Mbox Viewer The server records its start, its stop and its internal errors. It never records message content.
Audit log mcp-audit.jsonl in the logs folder of Mbox Viewer Each call adds one line with the tool, the mailbox, a summary of the arguments and the result or error code.

The logs folder is ~/Library/Logs/com.mboxviewer.viewer/ on macOS and %LOCALAPPDATA%\com.mboxviewer.viewer\logs\ on Windows. The server log is rotated above 5 MiB, and the audit log above 10 MiB. Neither one contains message bodies or the token. If a line cannot be written to the audit log, the server refuses the call. Every field of the audit log is documented with an example.

Frequently asked questions

Why does Claude Desktop show the Mbox Viewer server as failed?

The server usually stops before the handshake because the token is missing or because the configured path of the app no longer exists. Move the app to its final folder, then export the extension or copy the configuration again.

What does the error invalid_token mean?

The token in the client no longer matches the one in Mbox Viewer, usually after Regenerate token…. Click Copy token and paste the new token into the client, then restart the client.

What does the error mcp_disabled mean?

The MCP server is turned off in Settings. Turn on Enable the MCP server again. The next call works without a client restart.

Why does the agent see no mailbox?

No mailbox is ticked under Mailboxes the agent may see. Only mailboxes opened in Mbox Viewer appear in that list, so open the file in the app first and then tick it.

What does the error mailbox_not_ready mean?

The mailbox is still being indexed in the app, or its file changed since indexing. Open it in Mbox Viewer and let indexing finish, because the server never indexes a file itself.

Why can the agent not tag messages?

Write tools answer writes_not_allowed until you turn on Allow changes to tags and folders. The option is off by default because an email can contain instructions aimed at the agent.

Where does Claude Desktop write the server log?

Claude Desktop writes it to ~/Library/Logs/Claude/mcp-server-mbox-viewer.log on macOS and to %APPDATA%\Claude\logs\mcp-server-mbox-viewer.log on Windows. For the extension, the file is named after Mbox Viewer in the same folder.

Why does Claude Desktop ask for the token again after an update?

Installing a new version of the extension can ask for its settings again. Click Copy token in Mbox Viewer and paste it. The token stays the same unless you regenerated it.

Why is a newly shared mailbox missing from the resources?

Claude Desktop and Claude Code read the list of resources when they connect. Restart the client to see the new mailbox there. The tools see it at once.