To give Cursor an email inbox, add nicemails to your mcp.json file with the nicemails MCP server address as its url. Cursor signs in with OAuth: you approve access on the nicemails page in your browser, and Cursor’s agent can then search and read your mailboxes, organize messages and send mail you approve.
~/.cursor/mcp.json to use nicemails in every project, or .cursor/mcp.json in a project folder to use it there only. Create the file if it does not exist, and add nicemails under mcpServers:{
"mcpServers": {
"nicemails": {
"url": "https://nicemails.net/mcp"
}
}
}The desktop app finishes sign-in at http://localhost:8787/callback, and nicemails accepts it, so there is nothing to allow-list. Cloud Agents keep their own MCP sign-ins on Cursor’s servers, so sign in again there if you use them.
An API key suits a machine without a browser, or a project where you want one fixed, narrow credential. Create it first:
Cursor expands ${env:NAME} in url and headers, so the key can stay out of the file. Set NICEMAILS_API_KEY in the environment Cursor starts from, then use:
{
"mcpServers": {
"nicemails": {
"url": "https://nicemails.net/mcp",
"headers": {
"Authorization": "Bearer ${env:NICEMAILS_API_KEY}"
}
}
}
}Do not commit a project .cursor/mcp.json that contains a key in plain text.
Cursor’s agent gets the nicemails tools your permissions allow. There are 8:
list_mailboxes lists the mailboxes the connection can use.list_messages lists one folder of a mailbox, newest first.search searches every folder of the selected mailboxes, including Spam.get_message reads one message without marking it as read.create_mailbox creates a new mailbox (Manage permission, account-wide connection).move moves a message to another folder; flag marks it read, unread, starred or answered.send_message sends from one of your mailboxes (Send permission; new recipients need your approval).In a coding session that looks like: “Open the newest email in the qa mailbox from our staging app and paste the magic link into the end-to-end test,” or “Search for the invoice email template we sent yesterday and compare its subject with the one in the code.”
Check that mcp.json is valid JSON and that url is exactly https://nicemails.net/mcp. Open the Output panel (Cmd+Shift+U), choose MCP Logs and look for connection errors. Restart Cursor after you edit the file.
The connection may not have that permission, or it is limited to another mailbox. Disconnect Cursor under Settings → API keys → Connected apps, then sign in again from Cursor and choose the permissions you need.
Cloud Agents keep their own MCP sign-ins, separate from the ones on your machine, so sign in to nicemails again from there.