{"_id":"@cardor/email-management","_rev":"4-5bde99c6a3cc4a7914d28c81527fdf4f","name":"@cardor/email-management","dist-tags":{"latest":"3.1.2"},"versions":{"3.0.0":{"name":"@cardor/email-management","version":"3.0.0","keywords":["email","management","modelcontextprotocol","mcp","typescript","nodejs"],"author":{"name":"enmanuelmag@cardor.dev"},"license":"ISC","_id":"@cardor/email-management@3.0.0","maintainers":[{"name":"enmanuelmag","email":"enmanuelmag@gmail.com"}],"bin":{"cardor-email-management":"dist/main.js","cardor-email-management-server":"dist/server.js"},"dist":{"shasum":"bf1c9e8b016ef65f7dff1a4d2c674a5595ae3a8a","tarball":"https://registry.npmjs.org/@cardor/email-management/-/email-management-3.0.0.tgz","fileCount":35,"integrity":"sha512-nHrF5+OMs6k6HInZI7OXsMT/dSKUCanXoKyY4jDIZFvrRoMVPg2lHHZGM9o0yATCnKkrY/q1t6PEOwo2oZHJ7w==","signatures":[{"sig":"MEUCIB6tr3f+BhRR5r1GXwXmJh9i9YkNRb50Zff2DBm2KKBRAiEA4bQj878cmJpZxxuAir/4wGV6wu1YVqRQkIcbJM7ECvY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50371},"main":"dist/main.js","type":"module","types":"./dist/main.d.ts","gitHead":"b7f7562aa33d773a99f689e2e6845eb363257027","scripts":{"dev":"tsx ./src/main.ts","build":"tsc && tsc-alias && ts-add-js-extension --dir=dist","serve":"tsx ./src/server.ts","start":"node dist/main.js","docker:stop":"docker compose down","docker:build":"docker build -t email-management .","docker:start":"docker compose up","docker:remove":"docker compose down --rmi all --volumes --remove-orphans","docker:remove:img":"docker rmi email-management --force","docker:build-and-start":"npm run build:docker && docker compose up -d"},"_npmUser":{"name":"enmanuelmag","email":"enmanuelmag@gmail.com"},"_npmVersion":"11.5.1","description":"A Node.js application for summarizing emails using the ModelContextProtocol (MCP).","directories":{},"_nodeVersion":"24.7.0","dependencies":{"tsx":"^4.20.4","zod":"^3.25.76","cors":"^2.8.5","pino":"^9.9.0","chalk":"^5.6.0","luxon":"^3.7.1","pdf-ts":"^0.0.2","express":"^5.1.0","imapflow":"^1.0.194","tsc-alias":"^1.8.16","node-fetch":"^3.3.2","@types/cors":"^2.8.19","pino-pretty":"^13.1.1","@types/express":"^5.0.3","zod-to-json-schema":"^3.24.6","@modelcontextprotocol/sdk":"^1.15.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.0","typescript":"^5.8.3","@types/jest":"^30.0.0","@types/luxon":"^3.6.2","@types/node-fetch":"^2.6.12","typescript-eslint":"^8.38.0","ts-add-js-extension":"^1.6.6","eslint-plugin-import":"^2.32.0","@tanstack/eslint-config":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/email-management_3.0.0_1756424508669_0.3213152827174002","host":"s3://npm-registry-packages-npm-production"}},"3.1.0":{"name":"@cardor/email-management","version":"3.1.0","keywords":["email","management","modelcontextprotocol","mcp","typescript","nodejs"],"author":{"name":"enmanuelmag@cardor.dev"},"license":"ISC","_id":"@cardor/email-management@3.1.0","maintainers":[{"name":"enmanuelmag","email":"enmanuelmag@gmail.com"}],"bin":{"cardor-email-management":"dist/main.js","cardor-email-management-server":"dist/server.js"},"dist":{"shasum":"da78da6665d09418a7a877c35732c5f39f972633","tarball":"https://registry.npmjs.org/@cardor/email-management/-/email-management-3.1.0.tgz","fileCount":38,"integrity":"sha512-YAmJizVt4oRu+30YZafajxi0M87AfjQHbHwY+Zjt76YKW9edys9ZTTbEEus49BZ0icrFMrOsEoUNueVA/RQK1A==","signatures":[{"sig":"MEYCIQDl0cww+AP9KDubLKbZfO6sI7LbLQwbaDfoHVFdglNdKAIhAP/2Ubrfmj1nqRN8wW4tYl5w5hy6OJs1UrUCZJbawXiY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54219},"main":"dist/main.js","type":"module","types":"./dist/main.d.ts","gitHead":"c4bec8333cf27af32f83005f0b14637c51fc1b2c","scripts":{"dev":"tsx ./src/main.ts","build":"tsc && tsc-alias && ts-add-js-extension --dir=dist","serve":"tsx ./src/server.ts","start":"node dist/main.js","docker:stop":"docker compose down","docker:build":"docker build -t email-management .","docker:start":"docker compose up","docker:remove":"docker compose down --rmi all --volumes --remove-orphans","docker:remove:img":"docker rmi email-management --force","docker:build-and-start":"npm run build:docker && docker compose up -d"},"_npmUser":{"name":"enmanuelmag","email":"enmanuelmag@gmail.com"},"_npmVersion":"11.5.1","description":"A Node.js application for summarizing emails using the ModelContextProtocol (MCP).","directories":{},"_nodeVersion":"24.7.0","dependencies":{"tsx":"^4.20.4","zod":"^3.25.76","cors":"^2.8.5","pino":"^9.9.0","chalk":"^5.6.0","luxon":"^3.7.1","pdf-ts":"^0.0.2","express":"^5.1.0","imapflow":"^1.0.194","tsc-alias":"^1.8.16","node-fetch":"^3.3.2","@types/cors":"^2.8.19","pino-pretty":"^13.1.1","@types/express":"^5.0.3","zod-to-json-schema":"^3.24.6","@modelcontextprotocol/sdk":"^1.15.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.0","typescript":"^5.8.3","@types/jest":"^30.0.0","@types/luxon":"^3.6.2","@types/node-fetch":"^2.6.12","typescript-eslint":"^8.38.0","ts-add-js-extension":"^1.6.6","eslint-plugin-import":"^2.32.0","@tanstack/eslint-config":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/email-management_3.1.0_1756497722216_0.3674709665403426","host":"s3://npm-registry-packages-npm-production"}},"3.1.1":{"name":"@cardor/email-management","version":"3.1.1","keywords":["email","management","modelcontextprotocol","mcp","typescript","nodejs"],"author":{"name":"enmanuelmag@cardor.dev"},"license":"ISC","_id":"@cardor/email-management@3.1.1","maintainers":[{"name":"enmanuelmag","email":"enmanuelmag@gmail.com"}],"bin":{"cardor-email-management":"dist/main.js","cardor-email-management-server":"dist/server.js"},"dist":{"shasum":"ba34680e8eef8486a10201f5220f4722104407f4","tarball":"https://registry.npmjs.org/@cardor/email-management/-/email-management-3.1.1.tgz","fileCount":38,"integrity":"sha512-lnmBdPjnJGYEA9VUiR1jeL4i4Zbgs4x2HKrGd0oYs218gLOfbJpy6iZA5Uj7KXyroQX8KM9EVu5KFyZ+RRkjvg==","signatures":[{"sig":"MEYCIQC0Vynl+zj+s2cOHcCMjzGJaznVd6fawiBHYW2fSEYDTAIhAKfBCgQBuuNjTpCUzBMeox/WJsfjc7BhXbux06hyQV9s","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54200},"main":"dist/main.js","type":"module","types":"./dist/main.d.ts","gitHead":"1ece1bdcd65ad535d96cea278340fe9e50bfb583","scripts":{"dev":"tsx ./src/main.ts","build":"tsc && tsc-alias && ts-add-js-extension --dir=dist","serve":"tsx ./src/server.ts","start":"node dist/main.js","docker:stop":"docker compose down","docker:build":"docker build -t email-management .","docker:start":"docker compose up","docker:remove":"docker compose down --rmi all --volumes --remove-orphans","docker:remove:img":"docker rmi email-management --force","docker:build-and-start":"npm run build:docker && docker compose up -d"},"_npmUser":{"name":"enmanuelmag","email":"enmanuelmag@gmail.com"},"_npmVersion":"11.5.1","description":"A Node.js application for summarizing emails using the ModelContextProtocol (MCP).","directories":{},"_nodeVersion":"24.7.0","dependencies":{"tsx":"^4.20.4","zod":"^3.25.76","cors":"^2.8.5","pino":"^9.9.0","chalk":"^5.6.0","luxon":"^3.7.1","pdf-ts":"^0.0.2","express":"^5.1.0","imapflow":"^1.0.194","tsc-alias":"^1.8.16","node-fetch":"^3.3.2","@types/cors":"^2.8.19","pino-pretty":"^13.1.1","@types/express":"^5.0.3","zod-to-json-schema":"^3.24.6","@modelcontextprotocol/sdk":"^1.15.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.0","typescript":"^5.8.3","@types/jest":"^30.0.0","@types/luxon":"^3.6.2","@types/node-fetch":"^2.6.12","typescript-eslint":"^8.38.0","ts-add-js-extension":"^1.6.6","eslint-plugin-import":"^2.32.0","@tanstack/eslint-config":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/email-management_3.1.1_1756498001135_0.10637647613936796","host":"s3://npm-registry-packages-npm-production"}},"3.1.2":{"name":"@cardor/email-management","version":"3.1.2","description":"A Node.js application for managing email workflows using the ModelContextProtocol (MCP).","type":"module","main":"dist/main.js","bin":{"cardor-email-management":"dist/main.js","cardor-email-management-server":"dist/server.js"},"scripts":{"dev":"tsx ./src/main.ts","serve":"tsx ./src/server.ts","start":"node dist/main.js","build":"tsc && tsc-alias && ts-add-js-extension --dir=dist","docker:build":"docker build -t email-management .","docker:start":"docker compose up","docker:stop":"docker compose down","docker:build-and-start":"npm run build:docker && docker compose up -d","docker:remove":"docker compose down --rmi all --volumes --remove-orphans","docker:remove:img":"docker rmi email-management --force"},"keywords":["email","management","modelcontextprotocol","mcp","typescript","nodejs"],"author":{"name":"enmanuelmag@cardor.dev"},"license":"ISC","dependencies":{"@modelcontextprotocol/sdk":"^1.15.0","@types/cors":"^2.8.19","@types/express":"^5.0.3","chalk":"^5.6.0","cors":"^2.8.5","express":"^5.1.0","imapflow":"^1.0.194","luxon":"^3.7.1","node-fetch":"^3.3.2","pdf-ts":"^0.0.2","pino":"^9.9.0","pino-pretty":"^13.1.1","tsc-alias":"^1.8.16","tsx":"^4.20.4","zod":"^3.25.76","zod-to-json-schema":"^3.24.6"},"devDependencies":{"@tanstack/eslint-config":"^0.3.0","@types/jest":"^30.0.0","@types/luxon":"^3.6.2","@types/node-fetch":"^2.6.12","eslint-plugin-import":"^2.32.0","jest":"^29.7.0","ts-add-js-extension":"^1.6.6","ts-jest":"^29.4.0","typescript":"^5.8.3","typescript-eslint":"^8.38.0"},"_id":"@cardor/email-management@3.1.2","gitHead":"e721252ecf2579718cf7618cbc07c05460e0735b","types":"./dist/main.d.ts","_nodeVersion":"24.7.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-acxqSTE9J6McSYdglIWltRuoiDJ1oW5knhqBLNky15RT3W7cR6diz+zAgYpYHvyf5rYPehpWt0Cs/4z8jMznzg==","shasum":"7b4d05771164485942263625614fc795cfb630e1","tarball":"https://registry.npmjs.org/@cardor/email-management/-/email-management-3.1.2.tgz","fileCount":38,"unpackedSize":54512,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCuSICioY6uv11nhFuh+QGR+ba2opnmAZwS68XkCpOGawIgLv8LtvYgJ8Zn7E34zbMhaPuzkYK953A9EWx9vzV/Mj0="}]},"_npmUser":{"name":"enmanuelmag","email":"enmanuelmag@gmail.com"},"directories":{},"maintainers":[{"name":"enmanuelmag","email":"enmanuelmag@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/email-management_3.1.2_1756498253238_0.8325952092832971"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-28T23:41:48.227Z","modified":"2025-08-29T20:10:53.621Z","3.0.0":"2025-08-28T23:41:48.881Z","3.1.0":"2025-08-29T20:02:02.399Z","3.1.1":"2025-08-29T20:06:41.337Z","3.1.2":"2025-08-29T20:10:53.414Z"},"author":{"name":"enmanuelmag@cardor.dev"},"license":"ISC","keywords":["email","management","modelcontextprotocol","mcp","typescript","nodejs"],"description":"A Node.js application for managing email workflows using the ModelContextProtocol (MCP).","maintainers":[{"name":"enmanuelmag","email":"enmanuelmag@gmail.com"}],"readme":"# Email Management\n\nThis project is designed to summarize emails using a custom IMAP client to connect to the user's email inbox and retrieve relevant messages based on specified criteria.\n\n## Features\n- Connects to an IMAP server to fetch emails.\n- Can filter emails by:\n  - Subject\n  - Date range\n  - Sender email address\n  - Mailbox (default is 'INBOX')\n  \n## Debug\n- Stdio: If you run this server in STDIO mode, all logs are saved in `server.log` file, in the location where you run the command. You can change this, setting the `DEBUG_LOG_FILE` environment variable to a custom path (absolute path).\n- Docker: this mode use STDIO mode, so all logs are saved in `server.log` file, in the location where you run the command. You can change this, setting the `DEBUG_LOG_FILE` environment variable to a custom path (absolute path).\n- Stream: If you run this server in stream mode, all logs are printed to the console.\n\n## Available Tools\n\n- `search-emails`: Get emails from the user's inbox.\n- `mark-emails-as-read`: Mark specified emails as read.\n\n## Usage\n\n### Command (NPM)\n1. Install dependencies `pnpm install -g @cardor/email-summarizer`\n2. Add the configuration to your app client.\n```markdown\n\"email-summarizer\": {\n  \"type\": \"stdio\", // Maybe your client MCP require specific type, like 'stdio'\n  \"command\": \"cardor-email-summarizer\",\n  \"env\": {\n    // Your email address.\n    \"EMAIL_USERNAME\": \"<your-email>\", \n    // Your email app password.\n    \"EMAIL_PASSWORD\": \"<your-app-password>\",\n    // The port for the IMAP server (default is 993).\n    \"EMAIL_PORT\": \"993\",  \n    // The type of email client: gmail, outlook, yahoo, etc (default is 'gmail').\n    \"EMAIL_CLIENT_TYPE\": \"gmail\", \n    // Custom prompt for summarization. Must include `{{emails}}` to insert the email content.\n    \"EMAIL_PROMPT\": \"Summarize the following emails: {{emails}}\", \n    // You can also use a file path to load the prompt content. You must use absolute path.\n    // The file types supported are: .txt, .md, .json or .pdf.\n    // \"EMAIL_PROMPT\": \"file://Absolute/Path/To/Prompt.txt\"\n    // Also you can define a URL to load the prompt content. The URL must return a text content.\n    // The file types supported are: .txt, .md, .json or .pdf.\n    // \"EMAIL_PROMPT\": \"https://example.com/path/to/prompt.txt\"\n  }\n}\n```\n\n### Command (With Docker)\n1. Clone the repository `git clone <repository-url>`\n2. Build the Docker image `pnpm run docker:build`\n3. Add the configuration to your app client.\n```markdown\n\"email-dock\": {\n  \"command\": \"docker\",\n  \"args\": [\n    \"run\",\n    \"-i\",\n    \"--rm\",\n    \"-e\",\n    \"EMAIL_USERNAME=<your-email>\",\n    \"-e\",\n    \"EMAIL_PASSWORD=<your-app-password>\",\n    \"-e\",\n    \"EMAIL_PORT=993\",\n    \"-e\",\n    \"EMAIL_CLIENT_TYPE=gmail\",\n    \"-e\",\n    // Custom prompt for summarization. Must include `{{emails}}` to insert the email content.\n    // As above, you can use a file path or a URL.\n    \"EMAIL_PROMPT=Summarize the following emails: {{emails}}\", \n    \"email-summarizer\",\n  ]\n}\n```\n\n### Stream HTTP requests\nYou can also use the HTTP API to interact with the email summarizer. The API expects the following headers:\n1. Clone the repository `git clone <repository-url>`\n2. Install dependencies `pnpm install`\n3. Build the MCP `pnpm run build`\n4. Start the MCP `pnpm run start`\n5. Use the MCP serve to `http://localhost:5555/mcp`\n  - Send in headers:\n    - `email-username`: Your email address.\n    - `email-password`: Your email app password.\n    - `email-port`: The port for the IMAP server (default is 993).\n    - `email-client-type`: The type of email client (default is 'gmail').\n    - `email-prompt`: Custom prompt for summarization (default is 'Summarize the following emails: {{emails}}'). Must include `{{emails}}` to insert the email content. As above, you can use a file path or a URL.\n\n\n## Future work\n\nI'll be working on:\n- [x] Allow execute action as marking emails as read, deleting, etc.\n- [x] Allow override default prompt for the summarization.\n- [ ] Adding more filters and options for email retrieval.\n- [ ] Allow fetch whole body information of the email (text, HTML, attachments, etc.).\n","readmeFilename":"README.md"}