Skip to content

DAESA24/claude-code-sdk-email-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Email Agent

⚠️ IMPORTANT: This is a demo application by Anthropic. It is intended for local development only and should NOT be deployed to production or used at scale.

This is an in-development IMAP email assistant powered by Claude and the Claude Code SDK.

Still in Development

This agent will be continually developed over time. Currently it can:

  • display your inbox
  • do agentic search to find emails
  • display a 'profile' of you

We'll be building more features and sharing them here as we go.

🔒 Security Warning

This application should ONLY be run locally on your personal machine. It:

  • Stores email credentials in plain text environment variables
  • Has no authentication or multi-user support
  • Is not designed for production security standards

Prerequisites

  • Bun runtime (or Node.js 18+)
  • An Anthropic API key (get one here)
  • Email account with IMAP access enabled

Quick Start

1. Clone and Install

git clone https://github.com/anthropics/claude-code-sdk-demos.git
cd claude-code-sdk-demos/email-agent

2. Install Dependencies

bun install
# or npm install

3. Configure Environment

cp .env.example .env

Edit .env with your credentials (see IMAP Setup below).

4. Run the Application

bun run dev
# or npm run dev

5. Open Browser

Navigate to http://localhost:3000

IMAP Setup Guide

Gmail Setup

Gmail requires an App Password instead of your regular password:

  1. Enable 2-Factor Authentication (required for app passwords):

  2. Generate an App Password:

    • Go to Google App Passwords
    • Select "Mail" from the dropdown
    • Select your device (or choose "Other" and name it "Email Agent")
    • Click "Generate"
    • Copy the 16-character password (you won't see it again!)
  3. Configure .env:

ANTHROPIC_API_KEY=your-anthropic-api-key
EMAIL_USER=[email protected]
EMAIL_PASSWORD=your-16-char-app-password  # NOT your regular password!
IMAP_HOST=imap.gmail.com
IMAP_PORT=993

Features

  • Natural Language Search: Find emails using conversational queries
  • AI-Powered Assistance: Claude helps draft replies, summarize threads, and extract information
  • SQLite Integration: Fast local email caching and search
  • Real-time Streaming: WebSocket-based UI updates
  • Multi-turn Conversations: Complex email workflows with context retention

Resources

Support

This is a demo application provided as-is. For issues related to:

License

MIT - This is sample code for demonstration purposes.

About

Claude Code SDK Demos

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.0%
  • CSS 1.1%
  • Other 0.9%