All integrations
Cline·MCP server·4 min read

Mails.ai for Cline — drop-in MCP server in VS Code

cline.bot
MCP serveradd to Cline → MCP Settings panel

Open Cline → MCP Servers (top-right icon) → Edit Config. Add to mcpServers, save, restart Cline.

{
  "mcpServers": {
    "mails": {
      "command": "npx",
      "args": ["-y", "@mailsai/mcp-server"],
      "env": {
        "MAILS_API_KEY": "mk_live_..."
      }
    }
  }
}

Cline is the open-source autonomous coding agent for VS Code. Add the mails.ai MCP server in Cline’s MCP Settings panel and your in-IDE agent gets the same five tools (mails.send, mails.on_reply, mails.list_threads, mails.suppress, mails.get_reputation) that Claude Code and Cursor get — auto-discovered and ready for plan-mode and act-mode use.

Why Cline + mails.ai

Cline’s autonomous-loop architecture (read → plan → act → verify) maps cleanly onto agent-mail workflows. Common patterns Cline customers ship:

  • Code review → email reviewer. Cline reviews a PR, summarizes findings, and uses mails.send to email the author with the writeup.
  • Long-running refactor → status email. Cline checkpoints progress through a multi-hour refactor and emails a digest to the team when blocked or done.
  • Issue triage → reply automation. Cline reads incoming bug reports via mails.list_threads, classifies them via the typed-event intent field, and replies with a triage summary or escalation.
  • Documentation update → reviewer notification. After landing docs changes, Cline emails the docs maintainers via mails.send for a sanity check.

Setup

  1. Get an API key. Sign in at api.mails.ai/keys at Phase 1 launch, or request a closed-beta key from support@mails.ai.
  2. Open Cline’s MCP Settings.In the Cline panel header, click the MCP Servers icon (top-right). Click “Edit Config” to open the JSON settings.
  3. Add the snippet from the install card above. Replace mk_live_... with your key. Save and restart Cline.
  4. Verify. The MCP Settings panel should show mails under configured servers with five tools listed.

First commands to test

# In a new Cline task
> What mails.* tools are available to me?

# Plan-mode test (preview before sending)
> Plan: send myself a test hello via mails.send from agent "test", subject "Cline test".

# After approval, Cline executes the plan
> Approved. Run plan.

# Verify the send
> List the most recent threads on the test agent.

Common patterns

  • Always-plan-mode for production sends. Set Cline to plan-mode for any task that might send to customer addresses. Review the recipient + body in the plan summary before approving.
  • Per-workspace key scoping. Use a workspace-specific MCP config (in .vscode/settings.json or workspace-level Cline config) so different projects use different mails.ai agents.
  • Suppress before send. If your agent might send to addresses that have unsubscribed in your own system, call mails.suppress first to push them to the network suppression list. Subsequent sends to those addresses fail loud rather than silently bouncing.
  • Read injection_score on every reply handler.The Cline agent reading inbound is exactly the prompt-injection RCE class — check event.injection_score at the top of any handler that consumes inbound.

Security considerations

  • Per-key scope. One mails.ai key per Cline agent identity. Cline can host multiple per-workspace configs; rotate keys per-agent without affecting others.
  • Plan-mode discipline.Cline’s autonomous loop is powerful; combined with mails.send, it can fire emails the user did not explicitly approve. Plan-mode default for any external-facing email task.
  • Checkpoints don’t roll back sends.Cline’s checkpoint system snapshots the workspace; it does not undo sent emails. Treat sends as irrevocable.

Compare against the Claude Code integration for the same MCP setup with a different config path, or read the MCP-native email post for the broader distribution thesis.

FAQ

Questions developers ask after wiring this up.

Does mails.ai work in Cline's plan-mode and act-mode?

Yes both. In plan-mode, Cline previews mails.* tool calls in the plan summary before execution, so you can review the recipient and body before approving. In act-mode, Cline calls them autonomously as part of its task loop. We recommend keeping plan-mode on for any agent that hits production-customer addresses.

Cline supports per-server toggles. Can I disable mails.* for some tasks?

Yes — Cline's MCP Settings panel has per-server enable/disable toggles. For coding tasks where the agent should NOT send email (e.g., refactoring, code review), toggle the mails server off for that workspace. Re-enable when needed.

What about Cline's checkpoint feature — does it interact with sent emails?

Cline's checkpoints snapshot the workspace filesystem; they don't roll back external side effects like sent emails. Emails sent by your Cline agent are real — once mails.send fires, the email is dispatched. If you need rollback semantics, use mails.suppress to block follow-ups + manually email the recipient with a correction.

Does this work with Cline's CLI / non-VS-Code use?

Yes. The MCP server runs identically in any Cline runtime — VS Code extension, Cline CLI, or future IDE forks. The config file location varies (extension settings vs ~/.cline/config.json for CLI), but the JSON shape is the same.

Closed beta

Built for agents.
Self-serve at every volume.

Public API opens Q3 2026. Drop ~6 lines into your agent and ship.

npmpnpmbunpip
$ npm install @mailsai/sdk
Packages publish with cohort 1 · Q3 2026