A Model Context Protocol (MCP) server that provides tools for interacting with JMAP (JSON Meta Application Protocol) email servers. Built with Deno and using the @htunnicliff/jmap-jam client - Search Emails: Search emails with text queries, sender/recipient filters, date ranges, and keywords - Get Emails: Retrieve specific emails by ID with full details - Get Threads: Retrieve email threads (conve
Add this skill
npx mdskills install wyattjoh/jmap-mcpComprehensive JMAP email server integration with detailed tool documentation and strong validation.
1# JMAP MCP Server23[](https://jsr.io/@wyattjoh/jmap-mcp)4[](https://jsr.io/@wyattjoh/jmap-mcp)5[](https://jsr.io/@wyattjoh)67A Model Context Protocol (MCP) server that provides tools for interacting with8JMAP (JSON Meta Application Protocol) email servers. Built with Deno and using9the [@htunnicliff/jmap-jam](https://jsr.io/@htunnicliff/jmap-jam) client10library.1112## Features1314### Email Management Tools1516- **Search Emails**: Search emails with text queries, sender/recipient filters,17 date ranges, and keywords18- **Get Emails**: Retrieve specific emails by ID with full details19- **Get Threads**: Retrieve email threads (conversation chains)20- **Mark Emails**: Mark emails as read/unread, flagged/unflagged21- **Move Emails**: Move emails between mailboxes22- **Delete Emails**: Delete emails permanently2324### Mailbox Management2526- **Get Mailboxes**: List all mailboxes/folders with hierarchy support2728### Email Composition2930- **Send Email**: Compose and send new emails with support for plain text and31 HTML32- **Reply to Email**: Reply to existing emails with reply-all support3334### Key Capabilities3536- Full JMAP RFC 8620/8621 compliance via jmap-jam37- Comprehensive input validation with Zod schemas38- Pagination support for all list operations39- Rich error handling and connection management40- Functional programming patterns throughout41- TypeScript support with strong typing4243## Installation4445### Prerequisites4647- [Deno](https://deno.land/) v1.40 or later48- A JMAP-compliant email server (e.g., Cyrus IMAP, Stalwart Mail Server,49 FastMail)50- Valid JMAP authentication credentials5152### Setup5354Add the following to your agent of choice:5556```json57{58 "mcpServers": {59 "fastmail": {60 "type": "stdio",61 "command": "deno",62 "args": [63 "run",64 "--allow-net=api.fastmail.com",65 "--allow-env=JMAP_SESSION_URL,JMAP_BEARER_TOKEN,JMAP_ACCOUNT_ID",66 "jsr:@wyattjoh/jmap-mcp@0.1.1"67 ],68 "env": {69 "JMAP_SESSION_URL": "https://api.fastmail.com/jmap/session",70 "JMAP_BEARER_TOKEN": "API_TOKEN"71 }72 }73 }74}75```7677## Usage7879### Environment Variables8081| Variable | Required | Description |82| ------------------- | -------- | --------------------------------------------------------------- |83| `JMAP_SESSION_URL` | Yes | JMAP server session URL (usually ends with `/.well-known/jmap`) |84| `JMAP_BEARER_TOKEN` | Yes | Bearer token for authentication |85| `JMAP_ACCOUNT_ID` | No | Account ID (auto-detected if not provided) |8687### Available Tools8889#### `search_emails`9091Search for emails with various filters.9293**Parameters:**9495- `query` (optional): Text search query96- `from` (optional): Filter by sender email address97- `to` (optional): Filter by recipient email address98- `subject` (optional): Filter by subject text99- `inMailbox` (optional): Search within specific mailbox100- `hasKeyword` (optional): Filter by keyword (e.g., '$seen', '$flagged')101- `notKeyword` (optional): Exclude by keyword102- `before` (optional): Only emails before date (ISO datetime)103- `after` (optional): Only emails after date (ISO datetime)104- `limit` (optional): Max results (1-100, default: 50)105- `position` (optional): Starting position for pagination (default: 0)106107#### `get_emails`108109Retrieve specific emails by their IDs.110111**Parameters:**112113- `ids`: Array of email IDs (1-50 IDs)114- `properties` (optional): Specific properties to return115116#### `get_mailboxes`117118Get list of mailboxes/folders.119120**Parameters:**121122- `parentId` (optional): Filter by parent mailbox123- `limit` (optional): Max results (1-200, default: 100)124- `position` (optional): Starting position for pagination125126#### `get_threads`127128Get email threads by their IDs.129130**Parameters:**131132- `ids`: Array of thread IDs (1-20 IDs)133134#### `mark_emails`135136Mark emails with keywords (read/unread, flagged/unflagged).137138**Parameters:**139140- `ids`: Array of email IDs (1-100 IDs)141- `seen` (optional): Mark as read (true) or unread (false)142- `flagged` (optional): Mark as flagged (true) or unflagged (false)143144#### `move_emails`145146Move emails to a different mailbox.147148**Parameters:**149150- `ids`: Array of email IDs (1-100 IDs)151- `mailboxId`: Target mailbox ID152153#### `delete_emails`154155Delete emails permanently.156157**Parameters:**158159- `ids`: Array of email IDs (1-100 IDs)160161#### `send_email`162163Send a new email.164165**Parameters:**166167- `to`: Array of recipients with `name` and `email`168- `cc` (optional): Array of CC recipients169- `bcc` (optional): Array of BCC recipients170- `subject`: Email subject171- `textBody` (optional): Plain text body172- `htmlBody` (optional): HTML body173- `identityId` (optional): Identity to send from174175#### `reply_to_email`176177Reply to an existing email.178179**Parameters:**180181- `emailId`: ID of email to reply to182- `replyAll` (optional): Reply to all recipients (default: false)183- `subject` (optional): Custom reply subject184- `textBody` (optional): Plain text body185- `htmlBody` (optional): HTML body186- `identityId` (optional): Identity to send from187188## JMAP Server Compatibility189190This server should work with any JMAP-compliant email server, including:191192- [Cyrus IMAP](https://www.cyrusimap.org/) 3.0+193- [Stalwart Mail Server](https://stalw.art/)194- [FastMail](https://www.fastmail.com/) (commercial)195- [Apache James](https://james.apache.org/) (with JMAP support)196197## Development198199### Running in Development200201```bash202deno run --allow-env --allow-net --watch src/mod.ts203```204205### Testing206207```bash208# Test connection209deno run --allow-env --allow-net src/mod.ts210```211212## Architecture213214The server is built using:215216- **[Deno](https://deno.land/)**: Modern JavaScript/TypeScript runtime217- **[@modelcontextprotocol/sdk](https://www.npmjs.com/package/@modelcontextprotocol/sdk)**:218 MCP server framework219- **[jmap-jam](https://jsr.io/@htunnicliff/jmap-jam)**: Lightweight, typed JMAP220 client221- **[Zod](https://zod.dev/)**: Runtime type validation222223## Security224225- All input is validated using Zod schemas226- Environment variables are used for sensitive configuration227- No secrets are logged or exposed in responses228- Follows JMAP security best practices229230## Contributing2312321. Fork the repository2332. Create a feature branch2343. Make changes following the functional programming style2354. Test your changes thoroughly2365. Submit a pull request237238## License239240MIT License - see [LICENSE](LICENSE) file for details.241242## Related Projects243244- [jmap-jam](https://github.com/htunnicliff/jmap-jam) - JMAP client library245- [Model Context Protocol](https://modelcontextprotocol.io/) - MCP specification246- [JMAP RFC 8620](https://datatracker.ietf.org/doc/html/rfc8620) - JMAP core247 protocol248- [JMAP RFC 8621](https://datatracker.ietf.org/doc/html/rfc8621) - JMAP for Mail249
Full transparency — inspect the skill content before installing.