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.
Connect to Nylas’s MCP server
Section titled “Connect to Nylas’s MCP server”To connect your MCP-compatible client to the Nylas MCP server, use the following server URL:
https://mcp.us.nylas.comhttps://mcp.eu.nylas.comUnlike 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.
Authentication and data access
Section titled “Authentication and data access”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.
Prompt injection security
Section titled “Prompt injection security”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.
Client setup instructions
Section titled “Client setup instructions”The Nylas MCP server is compatible with various MCP clients. Below are setup instructions for popular clients:
Claude Desktop
Section titled “Claude Desktop”-
Add the Nylas MCP Server:
Open your Claude Desktop configuration file (typically located at
~/Library/Application Support/Claude/claude_desktop_config.jsonon macOS or%APPDATA%\Claude\claude_desktop_config.jsonon Windows). -
Configure Authentication:
Add the Nylas MCP server configuration:
{"mcpServers": {"Nylas": {"command": "npx","args": ["mcp-remote","https://mcp.us.nylas.com","--transport","http-first","--header","Authorization: Bearer YOUR_NYLAS_API_KEY"]}}}Replace
YOUR_NYLAS_API_KEYwith your actual Nylas API key. -
Restart Claude Desktop:
After updating the configuration, restart Claude Desktop to apply the changes.
-
Verify the connection:
In Claude Desktop, go to Settings → Developer → Local MCP servers. The Nylas MCP server should appear and show up as “running”.
Using Claude Desktop with Nylas MCP
Section titled “Using Claude Desktop with Nylas MCP”Once configured, you can use Claude to interact with Nylas’s APIs. For example:
- List emails: “Show me my recent emails”
- Check calendar: “What events do I have today?”
- Create events: “Schedule a meeting tomorrow at 2 PM”
- Send emails: “Send an email to [email protected] about the project update”
Claude will utilize the Nylas MCP server to fetch and display the requested information or perform the requested actions.
Cursor
Section titled “Cursor”-
Add the Nylas MCP Server:
Add the following configuration to your
~/.cursor/mcp.jsonfile (or%APPDATA%\Cursor\mcp.jsonon Windows):{"mcpServers": {"nylas": {"type": "streamable-http","url": "https://mcp.us.nylas.com","headers": {"Authorization": "Bearer YOUR_NYLAS_API_KEY"}}}}Replace
YOUR_NYLAS_API_KEYwith your actual Nylas API key. -
Verify the connection:
Check the MCP settings in Cursor Settings → Tools & MCP. Verify that:
- The Nylas MCP server is turned on.
- There is a green dot in the right bottom of the MCP server icon.
- You can see the MCP tools enabled below the server name.
If all of these are present, Cursor is successfully connected to the Nylas MCP server.
Using Cursor with Nylas MCP
Section titled “Using Cursor with Nylas MCP”Once configured, you can use Cursor’s AI assistant to interact with Nylas’s APIs. The MCP tools will be available in Cursor’s AI chat interface, allowing you to:
- Query email data
- Manage calendar events
- Access contact information
- Perform other Nylas API operations
The AI assistant will automatically use the appropriate MCP tools based on your requests.
Example usage
Section titled “Example usage”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:
-
Your email address — to access your calendar account
-
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.”
Available tools
Section titled “Available tools”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 Name | Description | API Reference |
|---|---|---|
availability | Returns availability information for specified users or groups of users. | Availability API |
confirm_send_draft | Required before send_draft. Generates a confirmation hash and message for sending a draft email. Must be called before send_draft. | - |
confirm_send_message | Required before send_message. Generates a confirmation hash and message for sending an email. Must be called before send_message. | - |
create_draft | Create a draft email message that can be edited and sent later. | Create Draft |
create_event | Create a new calendar event or meeting. | Create Event |
current_time | Returns the current epoch time (Unix timestamp) and current date in ISO 8601 format. | - |
epoch_to_datetime | Translates epoch time (Unix timestamp) into human-readable date-time string. | - |
get_folder_by_id | Get a folder by its ID. Returns folder details including folder ID, name, display name, and other properties. | Get Folder |
get_grant | Look up grant by email address. Returns the corresponding grant ID and provider. | Grants API |
list_calendars | List all calendars in the user’s account. Returns a list of calendars with their details. | List Calendars |
list_events | List 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_messages | List and search email messages. Returns a list of messages with their details including subject, from, to, body, date, and more. | List Messages |
list_threads | List and search email threads. Returns a list of threads with their details including subject, participants, latest message date, and more. | List Threads |
send_draft | Send 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_message | Send an email message directly without creating a draft first. Requires confirm_send_message to be called first. | Send Message |
update_draft | Update an existing draft email that can be edited and sent later. | Update Draft |
update_event | Update an existing event or meeting. | Update Event |
Handling timeouts and reconnection
Section titled “Handling timeouts and reconnection”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.
Next steps
Section titled “Next steps”- Learn more about Nylas authentication to understand how grants work
- Explore the Nylas API reference for detailed API documentation
- Check out best practices for working with Nylas APIs
- Review security best practices for securing your integration