Connect VS Code Copilot to XgenPlus Mail
To connect VS Code, add the XgenPlus server to .vscode/mcp.json in your project, or to your user mcp.json with MCP: Open User Configuration from the Command Palette. Use the block below. VS Code asks for your token the first time the server starts and stores it securely, so the token is not written in the file.
How to connect VS Code
- Create an agent password in webmail under Settings › Security › AI Agents (MCP) and copy its token, or make your token.
- Open
.vscode/mcp.jsonin your project, or run MCP: Open User Configuration from the Command Palette. - Paste the block below and save.
- Start the xgenplus server and paste your token when VS Code asks for it.
- Open Copilot Chat in agent mode and check that the XgenPlus tools are listed.
- 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
Meera, a developer at acme.in, asks Copilot to find the mail with the staging server change and draft a reply confirming the new date.
Configuration
- 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.
{
"inputs": [
{ "type": "promptString", "id": "xgenplus-token", "description": "XgenPlus MCP token", "password": true }
],
"servers": {
"xgenplus": {
"type": "http",
"url": "https://mcp.xgenplus.com/mcp",
"headers": { "Authorization": "Bearer ${input:xgenplus-token}" }
}
}
}
Good to know
- VS Code's file uses
servers, notmcpServersas in other clients. - Because the token is asked for at start-up, a project
mcp.jsonlike this is safe to share with your team. Each person enters their own token.