DEV Community

Qasim Muhammad
Qasim Muhammad

Posted on

Give Your AI Coding Agent Email, Calendar & Contacts — One CLI Command

Claude Code can't read your email. Cursor can't check your calendar. GitHub Copilot can't search your contacts. Until you give them access.

The Nylas CLI connects AI assistants to your email, calendar, and contacts through the Model Context Protocol (MCP). One command. No API code. Your agent can then send emails, create events, search contacts, and manage your inbox on your behalf.

Why MCP Matters for AI Agents

MCP is an open standard that lets AI assistants call external tools. Instead of copy-pasting email content into Claude, the agent reads your inbox directly. Instead of describing a meeting, the agent creates it on your calendar.

The Nylas CLI ships a built-in MCP server that exposes 50+ email, calendar, and contact operations as tools your agent can call.

Step 1: Install and Authenticate

brew install nylas/nylas-cli/nylas
nylas init
Enter fullscreen mode Exit fullscreen mode

nylas init handles account setup. For headless environments, use nylas auth config with an API key directly.

Step 2: Connect Your AI Assistant

nylas mcp install writes the MCP configuration for your assistant:

# Interactive — pick your assistant
nylas mcp install

# Direct — specify the assistant
nylas mcp install --assistant claude-code
nylas mcp install --assistant cursor
nylas mcp install --assistant windsurf

# All detected assistants at once
nylas mcp install --all
Enter fullscreen mode Exit fullscreen mode

That's it. Your agent now has email, calendar, and contacts tools.

Check the installation with nylas mcp status:

nylas mcp status
# Shows which assistants are configured and server state
Enter fullscreen mode Exit fullscreen mode

Need to remove it later? nylas mcp uninstall cleans up:

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

Step 3: Start the MCP Server

The server runs automatically when your assistant starts, but you can also start it manually with nylas mcp serve:

nylas mcp serve
Enter fullscreen mode Exit fullscreen mode

This is useful for debugging — you can see every tool call your agent makes in real time.

What Your Agent Can Do Now

Once connected, your AI assistant can:

Read and search email:

"Show me unread emails from the last 24 hours"
→ Agent calls nylas email list --unread --json
Enter fullscreen mode Exit fullscreen mode

nylas email list and nylas email search are the most-used tools for AI agents that need inbox context.

Send email on your behalf:

"Reply to Sarah's email and accept the meeting"
→ Agent calls nylas email send --to sarah@... --subject "Re: ..." --body "..."
Enter fullscreen mode Exit fullscreen mode

nylas email send with --yes skips the confirmation prompt, which agents need for autonomous operation.

Manage your calendar:

"Schedule a 30-minute standup tomorrow at 9am with the team"
→ Agent calls nylas calendar events create --title "Standup" --start ...
Enter fullscreen mode Exit fullscreen mode

nylas calendar events create and nylas calendar events list give agents full calendar access.

Search contacts:

"Find Sarah's email address"
→ Agent calls nylas contacts list --json and searches
Enter fullscreen mode Exit fullscreen mode

nylas contacts list and nylas contacts search power contact lookups.

The AI Chat Interface

Don't want to use MCP? nylas chat launches a web-based AI chat that's already connected to your email and calendar:

# Default agent
nylas chat

# Use Claude
nylas chat --agent claude

# Use a local model via Ollama
nylas chat --agent ollama --model llama3
Enter fullscreen mode Exit fullscreen mode

Configure Your AI Provider

nylas ai config lets you choose between local models (Ollama, LM Studio) for privacy or cloud providers (OpenAI, Anthropic) for capability:

nylas ai config
Enter fullscreen mode Exit fullscreen mode

Other Ways to Interact

The CLI offers three UI modes beyond the terminal:

  • nylas tui — interactive terminal UI with keyboard navigation
  • nylas ui — web-based configuration dashboard
  • nylas air — full email client in your browser

Security: Track What Your Agent Does

When AI agents have email access, you need visibility. The Nylas CLI has built-in audit logging that records every command an agent executes. See the audit logging guide for setup.

Full Command Reference

Every MCP, email, calendar, and contacts command has a detailed reference page at the Nylas CLI Command Reference.

Top comments (0)