Connect Claude Code to XgenPlus Mail
To connect Claude Code, make your token, then run claude mcp add --scope user --transport http xgenplus https://mcp.xgenplus.com/mcp --header "Authorization: Bearer <TOKEN>" in a terminal. Check it with claude mcp list, which should show the server as connected. In a Claude Code session, type /mcp to see the server and its tools.
How to connect Claude Code
- Create an agent password in webmail under Settings › Security › AI Agents (MCP) and copy its token, or make your token.
- Run the command below in a terminal, replacing
<TOKEN>with your token. - Run
claude mcp listand check that xgenplus shows as connected. - Start Claude Code and type
/mcpto see the XgenPlus tools. - Test the connection: ask the assistant to "Call get_mailbox_profile". If it lists your permissions, the token works. If it fails with a sign-in problem, the token is wrong or the mailbox is blocked. If it says the agent can't sign in right now, check the agent in webmail: it may be paused, expired or have Login unticked.
When to use it
Rohit, a developer at acme.in, asks Claude Code to find the build-failure mails from the last week and list which projects they came from, without leaving his terminal.
Command
- In XgenPlus webmail, go to Settings › Security › AI Agents (MCP) and click Create agent password.
- On Your agent is ready, copy the Token for AI apps. It is already encoded, so paste it where this guide says
<TOKEN>, afterBearerwith one space.
Chose your own password, or need to make the token again? It is your email address and agent password joined by a colon, with no spaces, in base64. Replace the sample values with yours, run the command on your own computer, and copy the line it prints.
Windows (PowerShell):[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes('you@xgenplus.com:AGENT_PASSWORD'))Mac or Linux (Terminal):printf '%s' 'you@xgenplus.com:AGENT_PASSWORD' | base64 | tr -d '\n'For example, you@xgenplus.com:AGENT_PASSWORD becomes eW91QHhnZW5wbHVzLmNvbTpBR0VOVF9QQVNTV09SRA==. Base64 is not encryption: keep the token as secret as a password. Never paste it into a chat with the AI, a shared file or a code repository, and never use online base64 encoder websites, because they would receive your agent password. If your agent password contains a single quote ('), these commands break, so create a new agent password without one. More help: Make your MCP token.
claude mcp add --scope user --transport http xgenplus https://mcp.xgenplus.com/mcp --header "Authorization: Bearer <TOKEN>"
Good to know
--scope usermakes the server available in every folder. Without it, Claude Code saves the server only for the folder you ran the command in, and the tools are missing in other projects.- If you copy the Claude Code line from Ready-to-paste setup in webmail, add
--scope userto it. claude mcp remove xgenplus --scope userremoves the server. Run it before adding the server again with a new token.- Your token is saved in Claude Code's settings on your computer. Do not add it to a shared project file or a code repository.
Common questions
claude mcp list shows the server failed to connect. Why?
Usually the token is wrong. Claude Code saves the server without checking the token, so remove it with claude mcp remove xgenplus --scope user, copy or make the token again and run the add command again. If it still fails, check the agent in webmail, because it may be paused, expired or have Login unticked.