UStackUStack
Nylas CLI icon

Nylas CLI

Free, open-source Nylas CLI for unified terminal access to email, calendar, and contacts across Gmail, Microsoft 365/Exchange, Yahoo, iCloud & IMAP—plus built-in MCP for AI agents.

Nylas CLI

What is Nylas CLI?

Nylas CLI is a free, open-source command-line tool for unified access to email, calendar, and contacts from the terminal. It lets you send, read, search, and manage these items across multiple provider types using a single CLI workflow.

It also includes a built-in MCP (Model Context Protocol) server so AI agents can access email, calendar, and contacts directly from the command line—without requiring you to build custom middleware for every tool.

Key Features

  • Built-in MCP server for AI agents: Provides agent-native access to email, calendar, and contacts so agents can read and send using CLI tools.
  • Unified email access across providers: A single interface supports Gmail, Microsoft 365/Exchange, Yahoo, iCloud, and IMAP for sending, searching, listing, and reading email.
  • Calendar management via CLI: Create, list, update, and delete events; includes natural-language scheduling and DST-aware timezone handling, plus free/busy availability checks.
  • Contact search and sync with JSON export: Search and sync contacts across connected providers, list contact groups, look up by name or email, and export results as JSON for automation.
  • Pipe-friendly, headless-first output: Designed for terminal workflows with JSON output that can be piped into tools like jq or other shell scripts.
  • Sandboxed OAuth tokens and local key handling: OAuth tokens are stored in your OS keyring; GPG signing and encryption help keep messages private and keep credentials/keys on your machine.
  • Automation-oriented command set: Includes 72+ CLI commands intended for scripting and repeatable operations.
  • Webhook management and GPG support: Includes webhook management and GPG encryption/signing for message handling workflows.

How to Use Nylas CLI

  1. Install Nylas CLI and confirm it’s available in your terminal.
  2. Connect the providers you need (email, calendar, and contacts) so the CLI can access Gmail/Outlook/Exchange/Yahoo/iCloud/IMAP accounts.
  3. Use the CLI commands to perform tasks such as listing or searching emails, managing calendar events, and exporting contacts as JSON.
  4. If you’re using AI agents, use the built-in MCP server so the agent can call the appropriate email/calendar/contact tools from the terminal.

Use Cases

  • Agent-assisted email and scheduling from the terminal: Use an AI agent (e.g., Claude/Cursor/VS Code workflows mentioned in the guides) to read and send email, then create or adjust calendar events based on natural language scheduling.
  • Scripting across multiple email providers: Write shell scripts that send or search messages using a consistent CLI interface across Gmail, Microsoft 365/Exchange, Yahoo, iCloud, and IMAP.
  • Automated contact exports for internal tools: Sync and search contacts, list contact groups, look up contacts by name/email, and export as JSON to feed downstream automation.
  • Operational calendar management without EWS/Graph setup: Create, list, update, and delete Exchange Online and on-prem calendar events from the command line; the page specifically calls out workflows that avoid EWS and Graph configuration for certain tasks.
  • Terminal-based webhook and encrypted message handling workflows: Manage webhooks and use GPG signing/encryption to keep message handling oriented toward privacy and automation.

FAQ

Does Nylas CLI work only for Gmail?

No. The documentation describes unified access across Gmail, Microsoft 365/Exchange, Yahoo, iCloud, and IMAP.

Is Nylas CLI a GUI application?

No. It is designed as a terminal-first, pipe-friendly tool (headless-first) intended for use in scripts, CI pipelines, and remote environments.

What does the built-in MCP server do?

The built-in MCP server enables AI agents to access email, calendar, and contacts using commands from within the agent workflow. The page describes this as “agent-native.”

How are OAuth tokens stored?

The page states that OAuth tokens are stored in your OS keyring.

Does it support GPG encryption?

Yes. The page specifically mentions GPG signing and encryption.

Alternatives

  • Raw provider APIs (e.g., Gmail API / Microsoft Graph / iCloud/Exchange SDKs): These offer direct control but typically require building and maintaining more authentication and per-provider integration than a unified CLI.
  • IMAP-based CLI tooling: If your needs are limited to email retrieval/sending over IMAP, IMAP-oriented tools can be simpler, but they may not cover calendar and contacts in the same unified way.
  • Dedicated email/calendar integration platforms: Tools that provide higher-level connectors can reduce custom scripting, but may not offer the same command-line, pipe-friendly workflow described for Nylas CLI.
  • Email automation and parsing scripts using general-purpose libraries: You can build custom scripts for specific providers, but you’d need to handle provider differences (auth, pagination, rate limits, and data normalization) yourself.