MaillyDocs

Give GitHub Copilot in VS Code its own email address

Add Mailly's Remote MCP server to VS Code so GitHub Copilot chat can read your inbox, save reply drafts and send after you approve.

GitHub Copilot in VS Code can work from a real inbox: search threads, read incoming mail, save reply drafts and send once you approve the final text. Mailly gives it an address such as your-name@mailly.site and connects over Remote MCP with OAuth.

What you get

  • A two-way inbox on @mailly.site, or on your own domain on the Developer plan.
  • About 70 typed MCP tools for threads, drafts, sending, domains, contacts, templates, campaigns and workflows, limited to the permissions you grant.
  • Two layers of control: VS Code can ask you to confirm each tool call, and Mailly sends only text and recipients you have reviewed.

Get an inbox

Already have a Mailly account? Skip to the next step.

Paste this prompt into Copilot chat. It reads Mailly's setup instructions, asks for the name you want, reserves it over HTTP and gives you a verification link.

Prompt
Read https://mailly.site/auth.md
and set up a Mailly inbox for me over HTTP.
Ask me for the name if unknown; if taken, ask for another,
with no blind retries.
Send me the verification link.
After I confirm the inbox in my browser,
store the API key securely, tell me the address,
and ask me before sending any email.

Open the link, sign in or register with your own verified email, and confirm the inbox. Copilot then receives the address and your account's API key. You can also start at mailly.site/onboard. See Let an agent set up an inbox for the rules.

Add the Mailly MCP server

Run MCP: Add Server from the Command Palette, select HTTP, enter https://mcp.mailly.site/mcp, enter mailly as the server ID and choose where to save it.

Or add it to .vscode/mcp.json in your workspace. For every workspace, run MCP: Open User Configuration and add it to your user profile's mcp.json:

.vscode/mcp.json
{
  "servers": {
    "mailly": {
      "type": "http",
      "url": "https://mcp.mailly.site/mcp"
    }
  }
}

Sign in and choose permissions

VS Code implements the MCP authorization spec, including dynamic client registration, which Mailly supports. When the server first starts, a browser window opens to Mailly's sign-in and consent page. Choose what Copilot may do:

PermissionWhat Copilot can do
mail:readRead your inboxes, threads, sent mail, drafts and settings. Always granted.
mail:draftSave, edit and discard reply drafts. No sending.
mail:sendSend replies, forwards and new emails you have reviewed.
workspace:manageManage addresses, domains, templates, contacts, campaigns, workflows and webhooks.

You can review and sign out of MCP server access from the Accounts menu with Manage Trusted MCP Servers.

Use an API key instead

Where OAuth isn't an option, VS Code can prompt for your Mailly API key once and keep it out of the file with an input variable:

.vscode/mcp.json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "mailly-api-key",
      "description": "Mailly API key",
      "password": true
    }
  ],
  "servers": {
    "mailly": {
      "type": "http",
      "url": "https://mcp.mailly.site/mcp",
      "headers": { "Authorization": "Bearer ${input:mailly-api-key}" }
    }
  }
}

An API key carries full account access; permission scopes don't apply to it. Never paste it into chat or commit it. Find it under Integration in the workspace.

Verify the connection

  1. Run MCP: List Servers and select mailly to see its status and actions.
  2. In the Chat view, select Configure Tools in the chat input and check that the Mailly tools are listed and enabled.
  3. Ask Copilot: "Use Mailly to list my inbox addresses and my five most recent threads." It should call mailly_list_inbox_addresses and mailly_list_threads.
  4. Send an email from your personal account to your Mailly address, then ask: "Read my latest Mailly thread and save a reply draft. Show me the exact text and don't send it." Copilot calls mailly_read_thread and mailly_save_draft. Approve or discard the draft in the conversation.

Use the CLI instead

Copilot can also drive mailly-cli in the integrated terminal. Every command accepts --json.

npm install -g mailly-cli   # Node.js 18+
mailly login                # browser sign-in; --no-browser on remote machines
mailly inbox addresses list --json
mailly inbox threads list --json

Troubleshooting

  • Mailly tools don't show up: open Configure Tools in the chat input and turn them on. Check the server's state with MCP: List Servers.
  • Sign-in is stuck or uses the wrong account: open Manage Trusted MCP Servers from the Accounts menu and sign out of Mailly, or run Authentication: Remove Dynamic Authentication Providers, then start the server again.
  • A tool you expected is missing: it needs a permission you didn't grant. Sign out as above, sign in again and grant the permission. Mailly never widens an existing grant on its own.
  • You declined a trust prompt: run MCP: Reset Trust and start the server again.
  • No mail arrives: check the address in the workspace and look in the inbox's Spam folder.

On this page