Guide

Set Up an MCP Email Server in 5 Minutes

The Model Context Protocol (MCP) hit 97 million monthly SDK downloads by March 2026. An MCP email server gives AI agents direct access to email, calendar, and contacts without custom integration code. This guide walks through installing, configuring, and verifying the Nylas MCP email server for Claude Code, Cursor, Windsurf, VS Code Copilot, and Claude Desktop.

Written by Qasim Muhammad Staff SRE

VerifiedCLI 3.1.10 · Gmail, Outlook · last tested May 21, 2026

Command references used in this guide: nylas mcp install for registering the server, nylas mcp serve for starting the STDIO server, nylas mcp status for verifying configuration, nylas auth login for OAuth authentication, and nylas auth whoami for checking grant status.

What is an MCP email server?

An MCP email server is a local process that exposes email operations (send, read, search, draft) and calendar operations (list, create, check availability) as tools an AI agent can call through the Model Context Protocol. The agent sends JSON-RPC tool-use requests over STDIO; the server translates them into email API calls and returns structured results. No custom glue code, no per-assistant integration.

MCP was created by Anthropic in November 2024 and donated to the Linux Foundation in December 2025 with OpenAI, Google, and Microsoft as co-sponsors. By March 2026, the protocol reached 97 million monthly SDK downloads and the public server registry listed over 9,400 servers. Every major AI coding tool now supports it natively: Claude Code, Cursor, Windsurf, VS Code Copilot, and JetBrains AI Assistant.

How do I install the Nylas MCP email server?

The Nylas CLI includes a built-in MCP email server that connects AI agents to Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP accounts. Install the CLI via Homebrew, authenticate with OAuth, and register the MCP server with your AI tool. The entire process takes under 60 seconds if you already have Homebrew installed. For other install methods (shell script, PowerShell, Go), see the getting started guide.

The install command below adds the CLI and authenticates your email account. The OAuth flow opens a browser window, stores the grant locally in ~/.config/nylas/, and handles token refresh automatically. Tokens refresh every 3,600 seconds without manual intervention.

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

# Authenticate your email account
nylas auth login

# Confirm the grant is active
nylas auth whoami

Once authenticated, register the MCP server for your AI tool with a single command. The nylas mcp install command detects which assistants are installed, writes the correct JSON config, and sets up tool permissions where the assistant requires them (Claude Code needs explicit permission entries).

# Register the MCP server (interactive -- detects installed tools)
nylas mcp install

# Or target a specific tool
nylas mcp install --assistant claude-code
nylas mcp install --assistant cursor
nylas mcp install --assistant windsurf
nylas mcp install --assistant vscode
nylas mcp install --assistant claude-desktop

# Or install for all detected tools at once
nylas mcp install --all

How do I configure MCP for each AI tool?

The nylas mcp install command writes the correct config automatically, but understanding what it writes helps with debugging. Every tool uses the same JSON block — it points to the Nylas binary and passes mcp serve as the startup argument. The server communicates over STDIO using JSON-RPC, which all 5 supported tools expect. Roughly 78% of enterprise AI teams run at least one MCP-backed agent in production as of April 2026.

// The config block is identical for every tool — only the file path differs
{
  "mcpServers": {
    "nylas": {
      "command": "/opt/homebrew/bin/nylas",
      "args": ["mcp", "serve"]
    }
  }
}

Place that block in the config file for your tool. Claude Code also needs mcp__nylas__* added to ~/.claude/settings.json so all 16 tools are pre-approved without interactive prompts — nylas mcp install --assistant claude-code handles both files.

ToolConfig fileScope
Claude Code~/.claude.jsonGlobal
Cursor.cursor/mcp.jsonProject (auto-discovers 16 tools in ~2 seconds)
Windsurf~/.codeium/windsurf/mcp_config.jsonGlobal (restart after editing)
VS Code Copilot.vscode/mcp.jsonProject
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.jsonGlobal (first MCP client, Nov 2024)

For per-tool setup walkthroughs with screenshots and hosted MCP server alternatives, see the give your AI agent an email address guide.

What email tools does the MCP server expose?

The Nylas MCP server exposes 16 tools across email, calendar, and utility categories. These tools map to Nylas API v3 endpoints but include automatic credential injection, timezone detection, and grant lookup. Every tool works across all 6 supported providers without provider-specific configuration. The agent discovers all 16 tools at startup through MCP's built-in tool discovery protocol.

Email tools (6)

ToolWhat it does
list_messagesSearch and retrieve emails with filters
list_threadsList email threads with grouping
create_draftCreate a new email draft
update_draftModify an existing draft
send_messageSend a new email (requires user confirmation)
send_draftSend an existing draft (requires user confirmation)

Calendar tools (5)

ToolWhat it does
list_calendarsList all calendars on the account
list_eventsQuery events with date and keyword filters
create_eventCreate a calendar event with attendees
update_eventModify an existing event
availabilityCheck free/busy across participants

Utility tools (5)

ToolWhat it does
get_grantReturn grant info without requiring the email parameter
current_timeReturn current time with the detected system timezone
epoch_to_datetimeConvert a Unix timestamp to a human-readable datetime
datetime_to_epochConvert a datetime string to Unix epoch seconds
list_contactsList contacts from the address book

Here's what a tool call looks like in practice. The agent sends a JSON-RPC request naming the tool and parameters. The MCP server handles authentication, calls the Nylas API, and returns the result. The round-trip takes under 500ms for most operations.

// Agent sends:
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "list_messages",
    "arguments": {
      "limit": 5,
      "subject": "quarterly report"
    }
  }
}

// Server returns structured email data:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "Found 3 messages matching 'quarterly report'..."
      }
    ]
  }
}

How do I verify the MCP server works?

The nylas mcp status command checks all 5 supported AI tools in a single pass and reports which ones have the Nylas MCP server configured. It reads each tool's config file, verifies the nylas server entry exists, and flags tools that are installed but not yet connected. Run it immediately after nylas mcp install to confirm the setup.

nylas mcp status

Expected output:

MCP Installation Status:

  ✓ Claude Code       configured    /home/dev/.claude.json
  ✓ Cursor            configured    /home/dev/project/.cursor/mcp.json
  ○ Claude Desktop    not configured
  ○ VS Code           not configured
  - Windsurf          application not installed

Legend:
  ✓ Nylas MCP configured
  ○ Available but not configured
  - Not available

For an end-to-end test, open your AI tool and ask it something that exercises the MCP server. A simple prompt like "list my 3 most recent emails" will call list_messages and confirm the full chain works: STDIO transport, credential injection, API call, and response parsing. If the tool returns email subjects, the server is working.

Common errors and fixes

Most MCP server issues come down to 3 things: missing authentication, wrong binary path, or stale config. These fixes resolve 90% of reported problems in under 60 seconds.

ErrorCauseFix
No authenticated grants foundCLI isn't authenticatedRun nylas auth login, then restart your AI tool
Permission denied (Claude Code)Missing tool permissions in settings.jsonRe-run nylas mcp install --assistant claude-code
MCP server not respondingBinary path mismatch in configRun which nylas and update the command field in the config file
Tools not appearingAI tool needs a restart after config changeRestart the AI tool so it spawns the MCP server process

How does MCP compare to direct API calls?

MCP and direct API calls solve different problems. MCP gives AI agents a standardized way to discover and call tools across services, while direct API calls with agent skills are faster and use fewer tokens per operation. According to benchmarks published by Toolradar in 2026, direct API calls are 33% more token-efficient and 30x faster for batch operations. The best-performing agents use both: MCP for interactive multi-service discovery, direct API for hot paths and bulk work.

FactorMCPDirect API
Setup timeUnder 60 seconds (nylas mcp install)5-15 minutes (API keys, SDK, code)
Token efficiencyBaseline (tool schemas in context)33% fewer tokens per call
Batch operationsSequential tool calls30x faster with parallel requests
Provider coverage6 providers, 16 tools, auto-discoveredSame 6 providers, full API surface
Tool discoveryAutomatic at startupRequires skill files or documentation
Best forInteractive agent workflows, multi-serviceHigh-volume pipelines, cost-sensitive apps

For a deeper comparison with architecture diagrams and benchmark data, see the full MCP vs API for AI agents guide.

Next steps