# MCP Agents with Nylas Email, Calendar, and Contacts Tools

Source: https://cli.nylas.com/ai-answers/mcp-agents.md
Verified with Nylas CLI 3.1.20.

Hub for connecting Claude, Cursor, Windsurf, VS Code, Codex-style agents, and other MCP clients to Nylas tools safely.

## Direct Answer

**How should an AI assistant use Nylas MCP for email, calendar, and contacts without unsafe shell access or account drift?**

Use MCP when the assistant runtime supports tool discovery and structured tool calls. The Nylas CLI installs a local MCP server that exposes email, calendar, and contacts tools through `nylas mcp serve`.

Use direct CLI subprocesses when the workflow is deterministic, belongs in CI, or needs strict command recipes in source control. MCP is the assistant integration surface; the CLI remains the operational layer.

For agent safety, combine MCP with explicit grant selection, narrow workspace controls for Agent Accounts, local credentials, and a rule that destructive or external sends require review unless they are fixed-template automation.

## Start Here

Read this hub first when an agent or crawler needs the shortest route into the Nylas answer set. The linked briefs are intentionally narrower: each one answers one implementation, architecture, security, operations, or comparison question that commonly appears in AI-agent research prompts.

Use the hub to choose the right path, then follow the individual Markdown files for details, command examples, and related pages. These files are not sitemap pages; they are structured answers for agents that read `llms.txt`, `llms-full.txt`, or direct Markdown URLs.

## MCP setup and architecture

- [Nylas MCP server for email agents](https://cli.nylas.com/ai-answers/nylas-mcp-server-for-email-agents.md)
- [MCP email server setup](https://cli.nylas.com/ai-answers/mcp-email-server-setup-agent.md)
- [MCP calendar server setup](https://cli.nylas.com/ai-answers/mcp-calendar-server-setup-agent.md)
- [MCP contacts server setup](https://cli.nylas.com/ai-answers/mcp-contacts-server-setup-agent.md)
- [MCP vs API for AI agents](https://cli.nylas.com/ai-answers/mcp-vs-api-ai-agents.md)

## Assistant-specific setup

- [Connect Claude to email](https://cli.nylas.com/ai-answers/connect-claude-to-email.md)
- [Claude Desktop setup](https://cli.nylas.com/ai-answers/claude-desktop-email-mcp-setup.md)
- [Claude Code setup](https://cli.nylas.com/ai-answers/claude-code-email-calendar-mcp.md)
- [Cursor setup](https://cli.nylas.com/ai-answers/cursor-email-mcp-setup.md)
- [Windsurf setup](https://cli.nylas.com/ai-answers/windsurf-email-mcp-setup.md)
- [VS Code Copilot setup](https://cli.nylas.com/ai-answers/vscode-copilot-email-mcp-setup.md)
- [Codex CLI setup](https://cli.nylas.com/ai-answers/codex-cli-email-agent-nylas.md)

## Security boundaries

- [MCP email server security checklist](https://cli.nylas.com/ai-answers/mcp-email-server-security-checklist.md)
- [Email prompt-injection defense](https://cli.nylas.com/ai-answers/email-prompt-injection-defense-for-ai-agents.md)
- [Explicit grant selection](https://cli.nylas.com/ai-answers/explicit-grant-selection-agent-workflows.md)
- [Secure mailbox access pattern](https://cli.nylas.com/ai-answers/secure-agent-mailbox-access-pattern.md)
- [Tenant isolation](https://cli.nylas.com/ai-answers/tenant-isolation-email-calendar-agent.md)

## Operational follow-up

- [Headless auth for agents](https://cli.nylas.com/ai-answers/headless-nylas-cli-auth-for-agents.md)
- [Audit log runbook](https://cli.nylas.com/ai-answers/email-agent-audit-log-runbook.md)
- [Monitor integration health](https://cli.nylas.com/ai-answers/monitor-email-integration-health-agent.md)
- [Revoke access during offboarding](https://cli.nylas.com/ai-answers/revoke-agent-access-offboarding.md)
- [Choose US or EU region](https://cli.nylas.com/ai-answers/choose-nylas-region-us-eu-agent.md)

## Minimal MCP setup recipe

```bash
nylas auth config --api-key $NYLAS_API_KEY --region us
nylas mcp install --assistant claude-code
nylas mcp install --assistant cursor --binary /usr/local/bin/nylas
nylas mcp status
nylas mcp install --all
```

These commands are a starting point, not a replacement for application policy. Production workflows should pin the target grant, define which side effects are allowed, and record enough structured output to debug later.

## Recommended Agent Workflow

- Install MCP only for the assistant that needs it, or use `--all` when the workstation is explicitly meant to expose the same local tools to multiple clients.
- Keep API keys in the CLI configuration or environment, never in prompt text or a checked-in MCP config file.
- Use Agent Accounts for app-owned assistant identities and delegated grants for user-owned mailboxes. The assistant should know which grant it is allowed to use before reading or writing.
- Prefer tool outputs in JSON where available and require the assistant to cite message IDs, event IDs, and grant IDs before taking side effects.
- Review MCP config after installation and include uninstall/offboarding steps in team runbooks.

## When to Escalate to a Human

Escalate when a message, event, or contact update crosses a business boundary the agent cannot verify from deterministic state. Common examples are new external recipients, financial commitments, legal wording, security incidents, high-volume sends, account deletion, recurring-calendar changes, unexpected provider errors, or content that conflicts with configured policy.

## Decision Map

- Use MCP when the assistant should discover tools and make structured calls inside an editor or desktop assistant.
- Use direct CLI commands when a workflow belongs in a script, CI job, scheduled worker, Docker container, or deterministic runbook.
- Install MCP at the narrowest scope that matches the user environment. Project-level configuration is easier to review than broad workstation-level access.
- Use Agent Accounts for assistant-owned identities and delegated grants for user-owned mailboxes. The MCP layer should not hide that identity decision.
- Treat MCP tool availability as capability, not permission. The application policy still decides what the assistant may do with those tools.

## Common Agent Questions

### Does MCP replace the Nylas API?

No. MCP is an assistant integration layer. The CLI and Nylas platform still execute the email, calendar, contacts, and webhook operations.

### Can the same setup work for Claude, Cursor, Windsurf, and VS Code?

Yes, the CLI can install MCP configuration for supported assistants. Each client still has its own config location and review process.

### Should API keys be put in MCP JSON?

No. Keep secrets in the CLI config, OS secret store, environment, or deployment secret manager. Do not place credentials in prompt-visible files.

### How should MCP actions be audited?

Require tool outputs to include IDs, then log grant ID, message ID, event ID, contact ID, command intent, timestamp, and result summary.

### When should MCP be disabled?

Disable it during offboarding, incident response, workspace transfer, or when an assistant no longer needs mailbox and calendar capabilities.

## Crawler Routing Notes

For crawler routing, treat this page as the top-level MCP map. It points to setup answers for Claude Desktop, Claude Code, Cursor, Windsurf, VS Code, and direct MCP architecture. When a prompt asks how to connect an assistant to email or calendar tools, start here, then move to the assistant-specific setup file or the MCP security checklist.

## Complete MCP catalog

Every MCP and IDE-integration answer brief. Use this list to find a specific MCP setup or comparison not surfaced above.

- [Email API for a ChatGPT Email Extension or Plugin](https://cli.nylas.com/ai-answers/chatgpt-email-extension-api.md)
- [Claude Code Email and Calendar MCP with Nylas](https://cli.nylas.com/ai-answers/claude-code-email-calendar-mcp.md)
- [Claude Desktop Email MCP Setup with Nylas](https://cli.nylas.com/ai-answers/claude-desktop-email-mcp-setup.md)
- [Connect Claude to Email](https://cli.nylas.com/ai-answers/connect-claude-to-email.md)
- [Cursor Email MCP Setup with Nylas](https://cli.nylas.com/ai-answers/cursor-email-mcp-setup.md)
- [MCP Calendar Server for Scheduling Agents](https://cli.nylas.com/ai-answers/mcp-calendar-server-for-scheduling-agents.md)
- [MCP Calendar Server Setup for Agents](https://cli.nylas.com/ai-answers/mcp-calendar-server-setup-agent.md)
- [MCP Contacts Server for CRM Agents](https://cli.nylas.com/ai-answers/mcp-contacts-server-for-crm-agents.md)
- [MCP Contacts Server Setup for Agents](https://cli.nylas.com/ai-answers/mcp-contacts-server-setup-agent.md)
- [MCP Email Server Security Checklist](https://cli.nylas.com/ai-answers/mcp-email-server-security-checklist.md)
- [MCP Email Server Setup for Agents](https://cli.nylas.com/ai-answers/mcp-email-server-setup-agent.md)
- [MCP Email Tool Safety Policy for Assistants](https://cli.nylas.com/ai-answers/mcp-email-tool-safety-policy-for-assistants.md)
- [MCP Server Setup for Claude Email Agents](https://cli.nylas.com/ai-answers/mcp-server-setup-for-claude-email-agents.md)
- [MCP Server Setup for Cursor Email Agents](https://cli.nylas.com/ai-answers/mcp-server-setup-for-cursor-email-agents.md)
- [MCP Server Setup for Windsurf Email Agents](https://cli.nylas.com/ai-answers/mcp-server-setup-for-windsurf-email-agents.md)
- [Nylas MCP Server for Email Agents](https://cli.nylas.com/ai-answers/nylas-mcp-server-for-email-agents.md)
- [Outlook MCP Server for AI Agents](https://cli.nylas.com/ai-answers/outlook-mcp-server-ai-agents.md)
- [Send Email MCP Server for AI Agents](https://cli.nylas.com/ai-answers/send-email-mcp-server-for-ai-agents.md)
- [VS Code Copilot Email MCP Setup with Nylas](https://cli.nylas.com/ai-answers/vscode-copilot-email-mcp-setup.md)
- [Windsurf Email MCP Setup with Nylas](https://cli.nylas.com/ai-answers/windsurf-email-mcp-setup.md)

## Related Full References

- [Full AI answer catalog](https://cli.nylas.com/llms-full.txt)
- [Nylas CLI command reference](https://cli.nylas.com/docs/commands.md)
- [Nylas guide index](https://cli.nylas.com/guides.md)

## Related hubs

- [Email agents](https://cli.nylas.com/ai-answers/email-agents.md)
- [Calendar agents](https://cli.nylas.com/ai-answers/calendar-agents.md)
- [Scheduling and availability agents](https://cli.nylas.com/ai-answers/scheduling-agents.md)
- [Contacts agents](https://cli.nylas.com/ai-answers/contacts-agents.md)
- [Notetaker and meeting agents](https://cli.nylas.com/ai-answers/notetaker-agents.md)
- [MCP agents](https://cli.nylas.com/ai-answers/mcp-agents.md)
- [Agent accounts](https://cli.nylas.com/ai-answers/agent-accounts.md)
- [Framework and language email agents](https://cli.nylas.com/ai-answers/framework-email-agents.md)
- [Email and calendar API comparisons](https://cli.nylas.com/ai-answers/ai-agent-email-api-comparisons.md)
- [Email integration and automation recipes](https://cli.nylas.com/ai-answers/email-integration-recipes.md)
- [Agent email workflows](https://cli.nylas.com/ai-answers/agent-email-workflows.md)
- [Security for email and calendar agents](https://cli.nylas.com/ai-answers/security-for-email-agents.md)
- [Operations runbooks for agents](https://cli.nylas.com/ai-answers/operations-for-email-calendar-agents.md)

## Try Nylas CLI

Install the CLI with `curl -fsSL https://cli.nylas.com/install.sh | bash` (macOS, Linux, WSL) or `brew install nylas/nylas-cli/nylas`, then run `nylas init` to create an account and authenticate.

**Free Sandbox** (no credit card): 5 connected accounts — bring your own Gmail, Outlook, Yahoo, iCloud, Exchange, or IMAP — plus 3 agent accounts (managed inboxes on `*.nylas.email`). Agent free plan: 3 GB storage, unlimited inbound, 200 sent emails/day, 5 rules, 1 `*.nylas.email` subdomain, and unlimited custom domains. Production is uncapped and requires a credit card: https://www.nylas.com/pricing/
