{"_id":"@cardor/email-budgetfy","_rev":"2-6f891a1fadd856f60d2fa04db3ae811b","name":"@cardor/email-budgetfy","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@cardor/email-budgetfy","version":"0.1.0","keywords":["cardor","email","budgetfy"],"author":{"name":"enmanuelmag@cardor.dev"},"license":"ISC","_id":"@cardor/email-budgetfy@0.1.0","maintainers":[{"name":"enmanuelmag","email":"enmanuelmag@gmail.com"}],"bin":{"cardor-email-budgetfy":"dist/main.js","cardor-email-budgetfy-server":"dist/server.js"},"dist":{"shasum":"a642d8e8571e84f536918f75e7ede89b1a129c0f","tarball":"https://registry.npmjs.org/@cardor/email-budgetfy/-/email-budgetfy-0.1.0.tgz","fileCount":29,"integrity":"sha512-BQ+MvH65wxV9og60tdmOqz5PKEEH8gLR6ol4+iA+66w1uOrRHqbCaRLsC3Sgoh8HAu0dP1YKb0XKm6UE6ugGxQ==","signatures":[{"sig":"MEUCIQCfYiKT7U6o+PXMLBJDU/dWvU7hzcvg0dZoP6WtAFVV8wIgOlBswVqwQ08I8rMpHlDZsdHmhEdxDukqZgu0mbfKeW0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70657},"main":"dist/main.js","type":"module","types":"./dist/main.d.ts","gitHead":"8facb5609551151e63303745ca04f511cfb4ff2d","scripts":{"dev":"tsx ./main.ts","build":"tsc && tsc-alias && ts-add-js-extension --dir=dist","serve":"tsx ./server.ts","start":"node dist/main.js","docker:stop":"docker compose down","docker:build":"docker build -t email-budgetfy .","docker:start":"docker compose up","docker:remove":"docker compose down --rmi all --volumes --remove-orphans","docker:remove:img":"docker rmi email-budgetfy --force","docker:build-and-start":"npm run build:docker && docker compose up -d"},"_npmUser":{"name":"enmanuelmag","email":"enmanuelmag@gmail.com"},"_npmVersion":"10.9.2","description":"This 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.","directories":{},"_nodeVersion":"22.17.1","dependencies":{"tsx":"^4.20.3","zod":"3.25.76","cors":"^2.8.5","pino":"^9.7.0","chalk":"^4.1.2","luxon":"^3.7.1","pdf-ts":"^0.0.2","express":"^5.1.0","imapflow":"^1.0.191","tsc-alias":"^1.8.16","node-fetch":"^2.7.0","@types/cors":"^2.8.19","pino-pretty":"^13.0.0","@types/express":"^5.0.3","@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-budgetfy_0.1.0_1753837541576_0.8345011761013181","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@cardor/email-budgetfy","version":"0.2.0","description":"This 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.","license":"ISC","author":{"name":"enmanuelmag@cardor.dev"},"type":"module","main":"dist/main.js","bin":{"cardor-email-budgetfy":"dist/main.js","cardor-email-budgetfy-server":"dist/server.js"},"scripts":{"dev":"tsx ./main.ts","serve":"tsx ./server.ts","start":"node dist/main.js","build":"tsc && tsc-alias && ts-add-js-extension --dir=dist","docker:build":"docker build -t email-budgetfy .","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-budgetfy --force"},"keywords":["cardor","email","budgetfy"],"dependencies":{"@modelcontextprotocol/sdk":"1.15.0","@types/cors":"^2.8.19","@types/express":"^5.0.3","chalk":"^4.1.2","cors":"^2.8.5","express":"^5.1.0","imapflow":"^1.0.191","luxon":"^3.7.1","mailparser":"^3.7.4","node-fetch":"^2.7.0","pdf-ts":"^0.0.2","pino":"^9.7.0","pino-pretty":"^13.0.0","tsc-alias":"^1.8.16","tsx":"^4.20.3","zod":"3.25.76"},"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-budgetfy@0.2.0","gitHead":"0e5bd704b8e3b7ae414360c71fe599fdcb3b7dda","types":"./dist/main.d.ts","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-FhR33cbF4l1SiKaaRGYlt7xFfkxmkuk5XFepJZUdg8+R0drpsdAMI+qvGGHdn74UwiUSldatXFuwXIMShVNw5g==","shasum":"0ad75ee6b7eb7ebd69f551ce5f6479d11768e00a","tarball":"https://registry.npmjs.org/@cardor/email-budgetfy/-/email-budgetfy-0.2.0.tgz","fileCount":29,"unpackedSize":76170,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCURIpbMW/cuuMWD9BFr6+XGtuGZoxuBssj1XHrfO9yEQIgRJVnPVKCHmqyrrlzGKRSePDsW2po3PWl60o18ujK7mk="}]},"_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-budgetfy_0.2.0_1753881399346_0.3217049275455748"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-30T01:05:41.449Z","modified":"2025-07-30T13:16:39.727Z","0.1.0":"2025-07-30T01:05:41.747Z","0.2.0":"2025-07-30T13:16:39.531Z"},"author":{"name":"enmanuelmag@cardor.dev"},"license":"ISC","keywords":["cardor","email","budgetfy"],"description":"This 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.","maintainers":[{"name":"enmanuelmag","email":"enmanuelmag@gmail.com"}],"readme":"# Email Budgetfy\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```js\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```js\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"}