damien_list_emailsLABSCO SUMMARY
Several services, and some tools delete mail permanently.
This is not a single binary — a CLI, an MCP server and an adapter all have to be running, which is what the start script is for. Once up, the range is unusual: rules with a dry-run mode, thread-level operations, and vacation, IMAP and POP settings that most Gmail servers leave out. Treat the irreversible tools accordingly — damien_delete_emails_permanently and damien_delete_thread_permanently do exactly what their names say.
What it is
A multi-part Gmail platform: a Python CLI, an MCP server and a Node adapter. Tools cover core email operations, drafts, threads, labelling, filtering rules and account settings, plus an analysis layer that detects patterns, suggests rules and creates them from plain language.
What you get
- Email listed with pagination and read in full, metadata or minimal form —
damien_list_emails,damien_get_email_details - Drafts created, listed, inspected, edited, sent and deleted —
damien_create_draft,damien_list_drafts,damien_get_draft_details,damien_update_draft,damien_send_draft,damien_delete_draft - Bulk actions on messages: trash, label, mark read or unread, and permanent deletion —
damien_trash_emails,damien_label_emails,damien_mark_emails,damien_delete_emails_permanently - Thread-level work: list, inspect, relabel, trash and delete —
damien_list_threads,damien_get_thread_details,damien_modify_thread_labels,damien_trash_thread,damien_delete_thread_permanently - Filtering rules listed, inspected, added, deleted and applied with a dry-run mode —
damien_list_rules,damien_get_rule_details,damien_add_rule,damien_delete_rule,damien_apply_rules - Inbox analysis, rule suggestions, and rule creation from a sentence, with large-scale and background variants for big mailboxes —
damien_ai_analyze_emails,damien_ai_suggest_rules,damien_ai_create_rule,damien_ai_get_insights,damien_ai_optimize_inbox,damien_ai_analyze_emails_large_scale,damien_ai_analyze_emails_async - Background jobs tracked, fetched, cancelled and listed —
damien_job_get_status,damien_job_get_result,damien_job_cancel,damien_job_list - Account settings: vacation responder, IMAP and POP access read and updated —
damien_get_vacation_settings,damien_update_vacation_settings,damien_get_imap_settings,damien_update_imap_settings,damien_get_pop_settings,damien_update_pop_settings
Requirements
Python 3.11+ with Poetry, Node.js 18+ with npm, Gmail API credentials, and an OpenAI API key for the AI features; AWS credentials are optional and only enable the Lambda path. Run poetry install in the CLI and MCP server directories and npm install in the adapter, start everything with ./scripts/start-all.sh, then authenticate with poetry run damien login. The client points at the adapter with DAMIEN_MCP_SERVER_URL set to http://localhost:8892 and DAMIEN_MCP_SERVER_API_KEY.
Setup effort
Build from source — git clone https://github.com/ivan-rivera-projects/Damien-Email-Wrestler.git
USE CASES
Clearing out months of promotions
Query the ones you mean, dry-run the rule, then trash them in bulk rather than one screen at a time.
Writing and sending from the conversation
Draft the reply, review it, and send it without opening the mail client.
Turning a habit into a filter
Describe the rule in a sentence, have it created, and apply it with the dry-run first.
Analysing a large mailbox without timing out
Start the analysis as a background job and collect the result when it finishes.
63 tools
Listed in project docs. Your client may show a different list.
damien_get_email_detailsdamien_trash_emailsdamien_delete_emails_permanentlydamien_label_emailsdamien_mark_emailsdamien_archive_emailsdamien_unarchive_emailsdamien_add_stardamien_remove_stardamien_snooze_emailsdamien_unsnooze_emailsdamien_move_to_inboxdamien_count_emails_by_labeldamien_get_all_emails_by_labeldamien_create_draftdamien_list_draftsdamien_get_draft_detailsdamien_update_draftdamien_send_draftdamien_delete_draftdamien_list_threadsdamien_get_thread_detailsdamien_modify_thread_labelsdamien_trash_threaddamien_delete_thread_permanentlydamien_list_rulesdamien_get_rule_detailsdamien_add_ruledamien_delete_ruledamien_apply_rulesdamien_ai_analyze_emailsdamien_ai_analyze_emails_large_scaledamien_ai_analyze_emails_asyncdamien_ai_suggest_rulesdamien_ai_quick_testdamien_ai_create_ruledamien_ai_get_insightsdamien_ai_optimize_inboxdamien_ai_pattern_detectiondamien_ai_sentiment_analysisdamien_ai_priority_scoringdamien_ai_automation_opportunitiesdamien_ai_bulk_operationsdamien_job_get_statusdamien_job_get_resultdamien_job_canceldamien_job_listdamien_trash_emails_by_querydamien_smart_trash_marketingdamien_smart_cleanupdamien_execute_cleanupdamien_organize_emailsdamien_create_labeldamien_delete_labeldamien_list_labelsdamien_smart_ruledamien_get_vacation_settingsdamien_update_vacation_settingsdamien_get_imap_settingsdamien_update_imap_settingsdamien_get_pop_settingsdamien_update_pop_settingsBEFORE YOU INSTALL
What to know first
Tools you get
63 tools named in the project's documentation.
Requires
- Python 3.11+ with Poetry
- Node.js 18+ with npm
- Gmail API credentials (a credentials file from Google Cloud Console)
- An OpenAI API key for the AI features
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
You clone this one yourself.
Server setup
git clone https://github.com/ivan-rivera-projects/Damien-Email-Wrestler.git
cd Damien-Email-Wrestler
cp .env.example .envIn .env, point DAMIEN_GMAIL_CREDENTIALS_PATH at your Gmail API credentials file, add your OpenAI API key, and set DAMIEN_MCP_SERVER_API_KEY to a random key — openssl rand -hex 32 makes one
cd damien-cli && poetry install && cd ..
cd damien-mcp-server && poetry install && cd ..
cd damien-smithery-adapter && npm install && cd ..Start the services — the script also builds the adapter's dist/ files:
./scripts/start-all.shSign in to Gmail:
cd damien-cli && poetry run damien loginMCP Clients
Claude Desktop
{
"mcpServers": {
"damien-email-wrestler": {
"command": "node",
"args": [
"./damien-smithery-adapter/dist/index.js"
],
"cwd": "<YOUR_PATH_TO_DAMIEN_EMAIL_WRESTLER>",
"env": {
"DAMIEN_MCP_SERVER_URL": "http://localhost:8892",
"DAMIEN_MCP_SERVER_API_KEY": "<YOUR_DAMIEN_MCP_SERVER_API_KEY>"
}
}
}
}Set cwd to the full path of your Damien-Email-Wrestler clone, and DAMIEN_MCP_SERVER_API_KEY to the same key you put in .env. The services from ./scripts/start-all.sh must be running.