Skip to content

Nylas Model Context Protocol (MCP)

The Nylas Model Context Protocol (MCP) server enables AI agents to interact seamlessly with Nylas’s Email and Calendar APIs. This guide provides instructions for integrating the Nylas MCP server into your environment.

To connect your MCP-compatible client to the Nylas MCP server, use the following server URL:

https://mcp.us.nylas.com
https://mcp.eu.nylas.com

Unlike some other MCP servers that utilize OAuth for authentication, Nylas employs a Bearer token system using your Nylas API key. This method ensures that each grant’s data is accessed exclusively by its owner, maintaining data privacy and security.

When configuring your MCP client, include your Nylas API key in the Authorization header as a Bearer token. This approach aligns with Nylas’s authentication mechanism, ensuring that data access is restricted to authorized grants.

Use system prompts to guarantee data isolation. Just like with the Nylas API, you must configure your AI agent’s system prompt to ensure that each grant’s data is only accessed by its owner. The MCP server uses the same authentication and authorization mechanisms as the Nylas API, so proper system prompt configuration is essential for maintaining data privacy and security.

You can only access email and calendar data with already connected grants. The Nylas MCP server requires that grants are already established through the Nylas authentication flow before you can access their data. Make sure you have connected grants before attempting to use the MCP tools.

AI bots can be exploited through prompt injection attacks. Malicious actors may attempt to exploit AI bots connected to the Nylas MCP server by embedding hidden instructions in documents, emails, or other content that the AI processes. These attacks can:

  • Bypass confirmation workflows: Hidden instructions may attempt to trick the AI into sending emails or performing actions without proper user confirmation
  • Expose sensitive data: Prompt injection attacks may attempt to extract API keys, credentials, or other sensitive information from the AI’s context
  • Perform unauthorized actions: Attackers may try to manipulate the AI into executing unintended operations

AI Bot owners are responsible for preventing prompt injection attacks. You must implement appropriate safeguards in your AI agent’s system prompts and processing logic to:

  • Always require explicit user confirmation before sending emails or performing sensitive operations
  • Never expose API keys, credentials, or configuration files in responses
  • Validate and sanitize all user-provided content before processing
  • Implement strict boundaries on what actions the AI can perform autonomously
  • Monitor and log all MCP tool calls for suspicious patterns

The Nylas MCP server provides confirmation mechanisms (such as confirm_send_draft and confirm_send_message), but these protections are effective only if your AI agent consistently enforces them and does not execute the instructions embedded within user-provided content.

The Nylas MCP server is compatible with various MCP clients. Below are setup instructions for popular clients:

Here’s an example conversation using the Nylas MCP:

User: “Check my calendar for next week and tell me what meetings I have.”

Chatbot: “Checking your calendar for next week. To check your calendar for next week, I need:

  1. Your email address — to access your calendar account

  2. Your timezone — to determine the exact dates for ‘next week’ (e.g., ‘America/New_York’, ‘Europe/London’, ‘Asia/Tokyo’)

Please provide both, and I’ll fetch your meetings for next week.”

User: “My email address is [email protected]. My timezone is PST.”

Chatbot: (Uses current_time, get_grant, list_calendars, list_events, and epoch_to_datetime tools)

“Here are your meetings for next week (November 24–30, 2025):

Monday, November 24

  • 9:00 AM - 9:30 AM PST — Team Standup [Collaboration]

  • 11:30 AM - 12:00 PM PST — Project Review Meeting

  • 12:00 PM - 1:00 PM PST — Team Lunch [Learning] (Status: Maybe)

Tuesday, November 25

  • 8:00 AM - 9:00 AM PST — Office Hours (Status: No)

  • 9:00 AM - 9:30 AM PST — Team Standup [Collaboration]

  • 9:30 AM - 10:00 AM PST — Weekly 1:1: Manager/User

  • 10:30 AM - 11:00 AM PST — Weekly 1:1: Team Lead / User

  • 1:00 PM - 2:00 PM PST — Office Hours (Status: No)

Wednesday, November 26

  • 8:00 AM - 8:30 AM PST — Office Hours: Department (Status: No)

  • 9:00 AM - 9:30 AM PST — Team Standup [Collaboration]

Thursday, November 27

  • 8:00 AM - 8:30 AM PST — Office Hours: Team Lead (Status: No)

  • 8:00 AM - 9:00 AM PST — Office Hours (Status: No)

  • 11:30 AM - 12:00 PM PST — Client Meeting

  • 12:00 PM - 12:30 PM PST — Office Hours: Senior Engineer [Learning] (Status: No)

  • 1:00 PM - 2:00 PM PST — Office Hours (Status: No)

Friday, November 28

  • 9:00 AM - 9:30 AM PST — Team Standup [Collaboration]

  • 9:30 AM - 10:00 AM PST — Weekly 1:1: Colleague/User

Total: 17 meetings scheduled for next week. Most are recurring (Team Standup, Office Hours, 1:1s). Several show ‘No’ status, so you may have declined them.”

The Nylas MCP server provides a comprehensive suite of tools to interact with email, calendar, and contacts data. Below is a table listing all available tools, their descriptions, and links to the Nylas API reference:

Tool NameDescriptionAPI Reference
availabilityReturns availability information for specified users or groups of users.Availability API
confirm_send_draftRequired before send_draft. Generates a confirmation hash and message for sending a draft email. Must be called before send_draft.-
confirm_send_messageRequired before send_message. Generates a confirmation hash and message for sending an email. Must be called before send_message.-
create_draftCreate a draft email message that can be edited and sent later.Create Draft
create_eventCreate a new calendar event or meeting.Create Event
current_timeReturns the current epoch time (Unix timestamp) and current date in ISO 8601 format.-
epoch_to_datetimeTranslates epoch time (Unix timestamp) into human-readable date-time string.-
get_folder_by_idGet a folder by its ID. Returns folder details including folder ID, name, display name, and other properties.Get Folder
get_grantLook up grant by email address. Returns the corresponding grant ID and provider.Grants API
list_calendarsList all calendars in the user’s account. Returns a list of calendars with their details.List Calendars
list_eventsList all events in a calendar. Returns a list of events with their details including title, start time, end time, participants, and more.List Events
list_messagesList and search email messages. Returns a list of messages with their details including subject, from, to, body, date, and more.List Messages
list_threadsList and search email threads. Returns a list of threads with their details including subject, participants, latest message date, and more.List Threads
send_draftSend an existing draft email that was previously created with create_draft or update_draft. Requires confirm_send_draft to be called first.Send Draft
send_messageSend an email message directly without creating a draft first. Requires confirm_send_message to be called first.Send Message
update_draftUpdate an existing draft email that can be edited and sent later.Update Draft
update_eventUpdate an existing event or meeting.Update Event

The Nylas MCP server enforces a timeout of 90 seconds, consistent with other Nylas APIs. It supports only stateless connections, meaning each request should be independent and not rely on previous interactions.

Recommendations:

  • Timeout Management: Implement logic in your client to handle potential timeouts gracefully. The 90-second timeout applies to all requests, so ensure your client can handle longer-running operations appropriately.
  • Reconnection Strategy: Ensure your client can re-establish connections as needed, given the stateless nature of the server. Since the server is stateless, you don’t need to maintain persistent connections, but you should handle connection failures and retries appropriately.