# Nylas MCP server

Source: https://developer.nylas.com/docs/dev-guide/mcp/

The Nylas MCP server gives AI agents typed tools for email, calendar, contacts, and Notetaker -- no SDK integration or API calls required. Your agent asks to "list my messages," "create an event," or "send a Notetaker to this meeting," and the MCP server handles the Nylas API calls.

Works with any [MCP-compatible client](https://modelcontextprotocol.io/): Claude Code, Claude Desktop, Cursor, Windsurf, VS Code, OpenAI Codex CLI, and more.

<a
  style="display: inline-block;"
  href="https://god.gw.postman.com/run-collection/698f951f3d8727c51d3055b7?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D698f951f3d8727c51d3055b7%26entityType%3DextensibleCollection%26workspaceId%3De36cf1fc-a749-494d-9c8c-f3c28f18c342"
>
  <img
    src="https://run.pstmn.io/button.svg"
    alt="Run In Postman"
    style="width: 128px; height: 32px; display: inline; vertical-align: middle;"
  />
</a>

## Before you begin

You need a Nylas API key and a connected account (grant). If you haven't set these up yet:

- **[Get started with the CLI](/docs/v3/getting-started/cli/)** -- run `nylas init` to create an account, generate an API key, and connect a test account in one command.
- **[Get started with the Dashboard](/docs/v3/getting-started/dashboard/)** -- do the same steps through the web UI.

## Quickstart: Nylas CLI (fastest)

If you have the [Nylas CLI](https://cli.nylas.com) installed, one command registers the MCP server with your agent:

```bash [mcpInstall-Claude Code]
nylas mcp install --assistant claude-code
```

```bash
nylas mcp install --assistant cursor
```

```bash
nylas mcp install --assistant windsurf
```

```bash [mcpInstall-VS Code]
nylas mcp install --assistant vscode
```

```bash [mcpInstall-Codex CLI]
nylas mcp install --assistant codex
```

```bash [mcpInstall-All agents]
nylas mcp install --all
```

Verify it's running:

```bash
nylas mcp status
```

That's it. Your agent now has access to 36 email, calendar, contacts, and Notetaker tools. Skip to [available tools](#available-tools) to see what's included.

## Manual setup

If you're not using the CLI, add the Nylas MCP server config to your tool's config file. Replace `<NYLAS_API_KEY>` with your actual key.

```json [manualSetup-Claude Desktop]
// ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
// %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
  "mcpServers": {
    "Nylas": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.us.nylas.com",
        "--transport",
        "http-first",
        "--header",
        "Authorization: Bearer <NYLAS_API_KEY>"
      ]
    }
  }
}
```

```json
// ~/.cursor/mcp.json (macOS/Linux)
// %APPDATA%\Cursor\mcp.json (Windows)
{
  "mcpServers": {
    "nylas": {
      "type": "streamable-http",
      "url": "https://mcp.us.nylas.com",
      "headers": {
        "Authorization": "Bearer <NYLAS_API_KEY>"
      }
    }
  }
}
```

```toml [manualSetup-Codex CLI]
# ~/.codex/config.toml (global) or .codex/config.toml (project)
# Set NYLAS_API_KEY in your environment -- don't put the key directly in this file

[mcp_servers.nylas]
url = "https://mcp.us.nylas.com"
bearer_token_env_var = "NYLAS_API_KEY"
```

After saving, restart your tool. Verify the connection:

- **Claude Desktop:** Check **Settings > Developer > Local MCP servers** -- Nylas should show as "running."
- **Cursor:** Check **Settings > Tools & MCP** -- look for a green dot next to the Nylas server.

## MCP server URLs

The MCP server URL depends on where your Nylas application stores data. Use the URL that matches your application's [data residency region](/docs/dev-guide/platform/data-residency/).

| Region | URL |
|--------|-----|
| US (default) | `https://mcp.us.nylas.com` |
| EU | `https://mcp.eu.nylas.com` |

Authentication uses a Bearer token with your Nylas API key in the `Authorization` header -- the same key you use for direct API calls.

## Available tools

The MCP server exposes these tools to your agent:

| Tool | What it does |
|------|-------------|
| `availability` | Find available meeting times across one or more Nylas grants |
| `confirm_send_draft` | Generate the confirmation hash required before calling `send_draft` |
| `confirm_send_message` | Generate the confirmation hash required before calling `send_message` |
| `create_draft` | Create a draft email using only the fields the user provided |
| `create_event` | Create a calendar event |
| `current_time` | Get the current epoch time and ISO 8601 date for a timezone |
| `datetime_to_epoch` | Convert a date, time, and timezone to a Unix timestamp |
| `delete_draft` | Delete a draft email |
| `delete_event` | Delete a calendar event |
| `epoch_to_datetime` | Convert Unix timestamps to human-readable date and time values |
| `get_contact` | Get a single contact by ID |
| `get_event` | Get a single event by ID |
| `get_folder_by_id` | Get folder or label details by ID |
| `get_grant` | Look up a grant by email address |
| `get_message` | Get a single email message by ID, including full body content |
| `get_notetaker` | Get details for one grant-scoped Notetaker bot |
| `get_notetaker_media` | Get fresh media links for one grant-scoped Notetaker bot |
| `get_search_syntax` | Get provider-specific native search syntax for messages and threads |
| `get_standalone_notetaker` | Get details for one standalone Notetaker bot |
| `get_standalone_notetaker_media` | Get fresh media links for one standalone Notetaker bot |
| `list_calendars` | List all calendars for a connected account |
| `list_contacts` | List contacts, with optional filters for email, phone number, source, or group |
| `list_events` | List events in a calendar |
| `list_folders` | List email folders or labels |
| `list_messages` | List and search email messages |
| `list_notetakers` | List grant-scoped Notetaker bots |
| `list_standalone_notetakers` | List standalone Notetaker bots for the application |
| `list_threads` | List and search email threads |
| `schedule_notetaker` | Schedule a grant-scoped Notetaker bot for a future meeting |
| `schedule_standalone_notetaker` | Schedule a standalone Notetaker bot for a future meeting |
| `send_draft` | Send a previously created draft |
| `send_message` | Send an email directly |
| `send_notetaker` | Send a grant-scoped Notetaker bot to an active meeting |
| `send_standalone_notetaker` | Send a standalone Notetaker bot to an active meeting |
| `update_draft` | Update an existing draft |
| `update_event` | Update an existing event |

> **Info:** 
> **Send confirmation is required.** The `send_message` and `send_draft` tools require a preceding call to `confirm_send_message` or `confirm_send_draft`. This two-step process prevents your agent from sending email without explicit confirmation. The `delete_draft` and `delete_event` tools are irreversible, so confirm with the user before calling them.

## Security

> **Warn:** 
> **Prompt injection is a real risk.** Malicious content in emails, documents, or calendar events can contain hidden instructions that attempt to trick your agent into sending emails, exposing credentials, or performing unauthorized actions.
> 
> You are responsible for implementing safeguards:
> 
> - Always require explicit user confirmation before sending emails
> - Never expose API keys or credentials in agent responses
> - Validate and sanitize content before processing
> - Monitor and log all MCP tool calls

> **Info:** 
> **Data isolation.** The MCP server uses the same auth as the Nylas API -- your API key and grant IDs. Configure your agent's system prompt to ensure each user's data is only accessed through their own grant.

## Timeouts and reconnection

The MCP server enforces a 90-second timeout per request. Connections are stateless -- each request is independent. Your client should handle timeouts gracefully and retry as needed.

## What's next

- **[Give your agent email access](/docs/v3/getting-started/agent-email/)** -- CLI commands for email operations
- **[Give your agent calendar access](/docs/v3/getting-started/agent-calendar/)** -- CLI commands for calendar operations
- **[Authentication](/docs/v3/auth/)** -- how grants and OAuth work
- **[API reference](/docs/reference/api/)** -- full endpoint documentation
- **[CLI guides](https://cli.nylas.com/guides/ai-agent-email-mcp)** -- detailed MCP setup guide on cli.nylas.com