vaderyang/jmap_mcp_server
If you are the rightful owner of jmap_mcp_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server for interacting with Jmap Server via JMAP protocol, supporting email, calendar, and contacts.
connect_jmap
Connect to your Jmap Mail server.
get_mailboxes
Retrieve all mailboxes from the server.
get_emails
Get emails from a specific mailbox or all emails.
search_emails
Search emails by text query.
send_email
Send a new email.
JMAP MCP - Jmap Server Integration
A Model Context Protocol (MCP) server for interacting with Jmap Server via JMAP protocol, supporting email, calendar, and contacts.
Demo
Here's the JMAP MCP server working with Claude Desktop:
The screenshots show the MCP tools successfully retrieving and searching email data from a JMAP server, demonstrating seamless integration between Claude Desktop and your email system.
Configuration
Environment Variables (Recommended)
The server can be configured using environment variables passed through MCP client configuration:
JMAP_BASE_URL
- Base URL of your Jmap Mail server (e.g.,https://mail.example.com
)JMAP_USERNAME
- Username/email for authenticationJMAP_PASSWORD
- Password for authenticationJMAP_ACCOUNT_ID
- (Optional) Specific account ID to use
These should be configured in your MCP client's configuration file (see examples below).
Config File (Fallback)
If environment variables are not set, the server will look for configuration files in:
- Path specified by
JMAP_CONFIG_PATH
environment variable jmap-config.json
in current working directory.jmap-config.json
in user's home directory
Example config file:
{
"baseUrl": "https://mail.example.com",
"username": "user@example.com",
"password": "your-password",
"accountId": "account123"
}
Features
- Auto-connects on startup if configuration is provided
- Supports comprehensive JMAP operations:
Email Operations
- Get mailboxes
- Get emails
- Search emails
- Send emails
- Mark as read/unread
- Delete emails
Calendar Operations
- Get calendars
- Get calendar events
- Create calendar events
- Update calendar events
- Delete calendar events
Contact Operations
- Get address books
- Get contacts
- Search contacts
- Create contacts
- Update contacts
- Delete contacts
Usage
The server will automatically attempt to connect using the configured credentials on startup. If successful, all email operations will be available immediately.
If no configuration is provided or connection fails, you can use the connect_jmap
tool to establish a connection manually.
Installation
Prerequisites
- Node.js 18+
- npm or yarn
- Access to a Jmap Mail server with JMAP enabled
Setup
- Clone the repository:
git clone https://github.com/vaderyang/jmap_mcp_server.git
cd jmap_mcp_server
- Install dependencies:
npm install
- Build the project:
npm run build
Usage
Running the MCP Server
The server communicates via stdio and is designed to be used with MCP-compatible clients:
npm start
For development with auto-reload:
npm run dev
Configuration with Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json
on macOS):
{
"mcpServers": {
"jmap-mail": {
"command": "node",
"args": ["/path/to/jmap-mcp-server/dist/index.js"],
"env": {
"JMAP_BASE_URL": "https://mail.example.com",
"JMAP_USERNAME": "user@example.com",
"JMAP_PASSWORD": "your-password",
"JMAP_ACCOUNT_ID": "account123"
}
}
}
}
Alternative: Using Config File
If you prefer not to put credentials in the Claude Desktop config, you can omit the env
section and use a config file instead:
{
"mcpServers": {
"jmap-mail": {
"command": "node",
"args": ["/path/to/jmap-mcp-server/dist/index.js"],
"env": {
"JMAP_CONFIG_PATH": "/path/to/your/jmap-config.json"
}
}
}
}
Configuration with Cursor
For Cursor, add the MCP server configuration to your workspace or global settings:
{
"@mcp": {
"jmap-mail": {
"command": "node",
"args": ["/path/to/jmap-mcp-server/dist/index.js"],
"env": {
"JMAP_BASE_URL": "https://mail.example.com",
"JMAP_USERNAME": "user@example.com",
"JMAP_PASSWORD": "your-password",
"JMAP_ACCOUNT_ID": "account123"
}
}
}
}
MCP Configuration Reference
For detailed setup instructions, refer to the official documentation:
Claude Desktop
- Official Documentation: Claude Desktop MCP Guide
- Configuration Location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
Cursor
- Official Documentation: Cursor MCP Setup
- Configuration: Add MCP servers through Cursor's settings or configuration files
General MCP Resources
- MCP Official Website: modelcontextprotocol.io
- MCP GitHub Repository: github.com/modelcontextprotocol
- Sample MCP Servers: github.com/modelcontextprotocol/servers
Available Tools
connect_jmap
Connect to your Jmap Mail server. This is not required for other tools calling.
Parameters:
baseUrl
: Base URL of your Jmap server (e.g.,https://mail.example.com
)username
: Your email/usernamepassword
: Your password
get_mailboxes
Retrieve all mailboxes from the server.
get_emails
Get emails from a specific mailbox or all emails.
Parameters:
mailboxId
(optional): Specific mailbox IDlimit
(optional): Maximum number of emails (default: 50)
get_email_by_id
Retrieve a specific email by its ID.
Parameters:
emailId
: The email ID
search_emails
Search emails by text query.
Parameters:
query
: Search query stringlimit
(optional): Maximum results (default: 20)
send_email
Send a new email.
Parameters:
to
: Array of recipient email addressessubject
: Email subjecttextBody
(optional): Plain text bodyhtmlBody
(optional): HTML bodycc
(optional): CC recipientsbcc
(optional): BCC recipientsinReplyTo
(optional): Message ID for repliesreferences
(optional): Reference message IDs
mark_as_read
Mark emails as read.
Parameters:
emailIds
: Array of email IDs
mark_as_unread
Mark emails as unread.
Parameters:
emailIds
: Array of email IDs
delete_emails
Delete emails (moves to trash).
Parameters:
emailIds
: Array of email IDs
Calendar Tools
get_calendars
Retrieve all calendars from the server.
get_calendar_events
Get calendar events from a specific calendar or all calendars.
Parameters:
calendarId
(optional): Specific calendar IDlimit
(optional): Maximum number of events (default: 50)
create_calendar_event
Create a new calendar event.
Parameters:
calendarId
: Calendar ID to create the event intitle
: Event titledescription
(optional): Event descriptionstart
: Event start time in ISO 8601 format (e.g., "2024-01-15T10:00:00Z")end
: Event end time in ISO 8601 format (e.g., "2024-01-15T11:00:00Z")location
(optional): Event locationparticipants
(optional): Array of participant email addressesshowWithoutTime
(optional): Whether this is an all-day event (default: false)
update_calendar_event
Update an existing calendar event.
Parameters:
eventId
: Event ID to updatetitle
(optional): New event titledescription
(optional): New event descriptionstart
(optional): New event start time in ISO 8601 formatend
(optional): New event end time in ISO 8601 formatlocation
(optional): New event locationparticipants
(optional): New array of participant email addresses
delete_calendar_event
Delete a calendar event.
Parameters:
eventId
: Event ID to delete
Contact Tools
get_address_books
Retrieve all address books from the server.
get_contacts
Get contacts from a specific address book or all address books.
Parameters:
addressBookId
(optional): Specific address book IDlimit
(optional): Maximum number of contacts (default: 50)
search_contacts
Search contacts by text query.
Parameters:
query
: Search query to find contactslimit
(optional): Maximum number of results (default: 20)
create_contact
Create a new contact.
Parameters:
addressBookId
: Address book ID to create the contact infirstName
(optional): Contact first namelastName
(optional): Contact last nameemails
(optional): Array of email objects withtype
andvalue
phones
(optional): Array of phone objects withtype
andvalue
addresses
(optional): Array of address objects withtype
,street
,city
,state
,country
,postalCode
company
(optional): Contact company/organizationjobTitle
(optional): Contact job titlenotes
(optional): Contact notes
update_contact
Update an existing contact.
Parameters:
contactId
: Contact ID to updatefirstName
(optional): New contact first namelastName
(optional): New contact last nameemails
(optional): New array of email objects withtype
andvalue
phones
(optional): New array of phone objects withtype
andvalue
addresses
(optional): New array of address objects withtype
,street
,city
,state
,country
,postalCode
company
(optional): New contact company/organizationjobTitle
(optional): New contact job titlenotes
(optional): New contact notes
delete_contact
Delete a contact.
Parameters:
contactId
: Contact ID to delete
Example Usage
Once connected to Claude with this MCP server, you can use natural language commands like:
Emails:
- "Show me my recent emails"
- "Search for emails about 'project update'"
- "Send an email to about the meeting"
- "Mark all unread emails as read"
Calendar:
- "Show me my calendars"
- "Get my calendar events for this week"
- "Create a meeting for tomorrow at 2 PM"
- "Update the project review meeting location"
Contacts:
- "Show me all my contacts"
- "Search for contacts named John"
- "Create a new contact for Jane Smith"
- "Update Alice's phone number"
JMAP Protocol
This server implements the JMAP protocol for modern email, calendar, and contact operations:
- JMAP Core (
urn:ietf:params:jmap:core
) - JMAP Mail (
urn:ietf:params:jmap:mail
) - JMAP Calendars (
urn:ietf:params:jmap:calendars
) - JMAP Contacts (
urn:ietf:params:jmap:contacts
)
Jmap Configuration
Ensure your Jmap Mail server has JMAP enabled in the configuration:
[server.listener.jmap]
bind = ["0.0.0.0:8080"]
protocol = "jmap"
tls.implicit = false
[jmap]
default-language = "en"
Security Considerations
- Credentials: The server requires username/password authentication
- TLS: Always use HTTPS endpoints for production
- Network: Ensure proper firewall rules for JMAP port access
- Authentication: Consider using application-specific passwords if available
Development
Project Structure
jmap-mcp-server/
āāā src/
ā āāā index.ts # Main server implementation
āāā dist/ # Compile