DEV Community

Qasim Muhammad
Qasim Muhammad

Posted on • Originally published at cli.nylas.com

Give Your AI Coding Agent an Email Address

Claude Code, Cursor, Codex CLI, and Windsurf can write code, debug tests, and refactor files. But they can't send a deploy notification, read a confirmation email, or check a calendar invite.

Here's how to fix that with Nylas CLI — one authentication, every major email provider.

The problem

AI coding agents live in your terminal but have zero access to communication. You finish a deploy and manually send the notification. You need an OTP code and switch to your browser. Your agent can't check if a meeting conflicts before scheduling a pair session.

Gmail MCP servers only work with Google. Microsoft Graph only works with Outlook. What if you want one setup that works across Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP?

Prerequisites: install and authenticate (2 minutes)

Sign up at dashboard-v3.nylas.com, create an API key, and connect an email account under Grants. Then:

# Install (macOS / Linux)
brew install nylas/nylas-cli/nylas

# Or shell script
curl -fsSL https://cli.nylas.com/install.sh | bash

# Windows
irm https://cli.nylas.com/install.ps1 | iex

# Configure your API key
nylas auth config --api-key YOUR_NYLAS_API_KEY

# Verify
nylas auth whoami
Enter fullscreen mode Exit fullscreen mode

That's it. Now connect your agent.

Claude Code

One command writes the MCP config and sets tool permissions:

nylas mcp install --assistant claude-code
Enter fullscreen mode Exit fullscreen mode

This writes to ~/.claude.json and pre-approves all 16 Nylas tools in ~/.claude/settings.json. Restart Claude Code, then try "Read my latest 5 emails" or "Send an email to alice@example.com about the deploy."

Cursor

Same deal:

nylas mcp install --assistant cursor
Enter fullscreen mode Exit fullscreen mode

Writes to ~/.cursor/mcp.json. Restart Cursor and check Settings → Tools & MCP for a green dot next to "nylas."

You can also skip the local CLI and connect directly to the hosted Nylas MCP server:

{
  "mcpServers": {
    "nylas": {
      "type": "streamable-http",
      "url": "https://mcp.us.nylas.com",
      "headers": {
        "Authorization": "Bearer YOUR_NYLAS_API_KEY"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

OpenAI Codex CLI

Codex supports MCP natively. Two options:

Local MCP:

codex mcp add nylas -- nylas mcp serve
Enter fullscreen mode Exit fullscreen mode

Hosted MCP (no CLI install):

# ~/.codex/config.toml
[mcp_servers.nylas]
url = "https://mcp.us.nylas.com"
bearer_token_env_var = "NYLAS_API_KEY"
Enter fullscreen mode Exit fullscreen mode

Codex can also run Nylas CLI commands directly in its sandboxed shell as a fallback.

Windsurf

nylas mcp install --assistant windsurf
Enter fullscreen mode Exit fullscreen mode

Same MCP setup, same 16 tools.

OpenClaw

OpenClaw uses a plugin instead of MCP:

openclaw plugins install @nylas/openclaw-nylas-plugin
openclaw config set nylas.apiKey YOUR_NYLAS_API_KEY
openclaw nylas discover
Enter fullscreen mode Exit fullscreen mode

14 native tools with typed schemas and multi-account support. Full plugin details: Install the OpenClaw Nylas Plugin.

Quick comparison

Agent Integration Setup Command
Claude Code MCP (STDIO) nylas mcp install --assistant claude-code
Cursor MCP (STDIO/HTTP) nylas mcp install --assistant cursor
Codex CLI MCP (STDIO/HTTP) codex mcp add nylas -- nylas mcp serve
Windsurf MCP (STDIO) nylas mcp install --assistant windsurf
OpenClaw Plugin openclaw plugins install @nylas/openclaw-nylas-plugin

All five agents get 16 email, calendar, and contacts tools. All six email providers work: Gmail, Outlook, Exchange, Yahoo, iCloud, IMAP.

What your agent can do now

  • Send a deploy notification — "Email the team that v2.4.1 is live"
  • Read a confirmation email — "Check inbox for the AWS signup confirmation"
  • Extract an OTP — "Get the 6-digit code from my latest email"
  • Schedule a meeting — "Book 30 min with alice@company.com Tuesday at 2pm"
  • Search email history — "Find all emails about the Q4 contract"

Security notes

MCP tools require a confirm_send_draft step — your agent drafts, you approve before sending. Credentials stay local. Revoke anytime with nylas auth logout.

For full audit logging of every action your agent takes, check the AI Agent Audit Logs guide.


Full setup walkthrough with config file locations and troubleshooting: Give Your AI Coding Agent an Email Address

More guides: cli.nylas.com/guides

Top comments (0)