Metadata-Version: 2.5
Name: applygenie-mcp
Version: 0.3.0
Summary: ApplyGenie — Your magical AI assistant that grants your job wishes. MCP server for desktop automation, job scraping, application tracking, form filling, and mock interview preparation.
Author-email: Tanishq Mangal <tanishkmangal3@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: applygenie,automation,copilot,interview,job-application,mcp,scraper,tracker
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business
Requires-Python: >=3.10
Requires-Dist: beautifulsoup4>=4.12
Requires-Dist: fastmcp>=2.0
Requires-Dist: httpx>=0.24
Requires-Dist: mss>=9.0
Requires-Dist: pillow>=10.0
Requires-Dist: pydantic>=2.0
Requires-Dist: pygetwindow>=0.0.9
Requires-Dist: pynput>=1.7
Requires-Dist: pypdf>=4.0
Requires-Dist: python-docx>=1.0
Requires-Dist: pywinauto>=0.6.8
Provides-Extra: browser
Requires-Dist: playwright>=1.40; extra == 'browser'
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Provides-Extra: full
Requires-Dist: playwright>=1.40; extra == 'full'
Description-Content-Type: text/markdown

# ApplyGenie MCP 🧞‍♂️

> **Your magical AI assistant that grants your job wishes.**  
> A production-grade [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for **autonomous deep job scraping**, **candidate profile & resume ontology mapping**, **resume-to-job matching & tailored pitch generation**, **stealth anti-detection form autofill**, **local application tracking with conversion analytics**, and **personalized Socratic AI mock interview preparation**.

[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![MCP Protocol](https://img.shields.io/badge/MCP-Standard-orange.svg)](https://modelcontextprotocol.io)
[![FastMCP v2](https://img.shields.io/badge/FastMCP-2.0+-green.svg)](https://github.com/jlowin/fastmcp)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI](https://img.shields.io/pypi/v/applygenie-mcp.svg)](https://pypi.org/project/applygenie-mcp/)
[![Total Downloads](https://img.shields.io/pepy/dt/applygenie-mcp?color=blue&label=total%20downloads)](https://pepy.tech/project/applygenie-mcp)
[![Monthly Downloads](https://img.shields.io/pypi/dm/applygenie-mcp.svg?color=blue&label=downloads%2Fmonth)](https://pypi.org/project/applygenie-mcp/)
[![Tests](https://img.shields.io/badge/tests-passing-brightgreen.svg)](docs/live_testing.md)
[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
[![ApplyGenie on MCPRush](https://mcprush.com/badge/applygenie-mcp/compact.svg)](https://mcprush.com/to/applygenie-mcp?ref=badge)
[![M8ven Score](https://m8ven.ai/badge/mcp/eternalcodertanishq3-applygenie-mcp-14u38v)](https://m8ven.ai/mcp/eternalcodertanishq3-applygenie-mcp-14u38v?s=readme)

<!-- mcp-name: io.github.Eternalcodertanishq3/applygenie-mcp -->

---

## 🌟 What is ApplyGenie?

ApplyGenie is the open-source, local-first bridge between job discovery, application submission, funnel management, and interview readiness. It runs locally on your computer as an MCP server, empowering AI coding agents (**Claude Desktop**, **Cursor**, **Google Antigravity**, **Windsurf**, and **VS Code / Cline**) with **62 specialized tools** across 7 operational pillars:

```
┌────────────────────────────────────────────────────────────────────────────────────────┐
│                               APPLYGENIE MCP PIPELINE                                 │
└────────────────────────────────────────────────────────────────────────────────────────┘
       │
       ▼
 [1. DEEP JOB SCRAPER] ──► Extracts Greenhouse, Lever, Workday, Ashby, SmartRecruiters
       │                    Normalizes salary, location, remote policy, skills & perks
       ▼
 [2. RESUME ONTOLOGY]  ──► Deep PDF/DOCX parsing, 300+ skill taxonomy, chronology gaps
       │
       ▼
 [3. JOB MATCHER]      ──► Computes match % (skills, seniority, title), identifies gaps,
       │                    synthesizes customized cover letters & recruiter DMs
       ▼
 [4. STEALTH BROWSER]  ──► Playwright CDP cloaking, Challenge Radar, Fitts's Law Bézier,
       │                    human typing jitter, shadow DOM / iframe form autofill
       ▼
 [5. APPLICATION DB]   ──► SQLite v2, FTS5 full-text search, stage timelines, interview
       │                    notes, funnel conversion metrics, stagnant application alerts
       ▼
 [6. MOCK INTERVIEWS]  ──► 4-rung Socratic coding ladders, behavioral STAR coaching
                            ("I" vs "We" ownership ratio), 4-phase system design state machine
```

---

## 🏛️ System Architecture

```mermaid
graph TD
    subgraph Client["MCP Host Clients"]
        Claude["Claude Desktop"]
        Cursor["Cursor IDE"]
        Antigravity["Google Antigravity"]
        Windsurf["Windsurf"]
        Cline["VS Code / Cline"]
    end

    subgraph FastMCPServer["ApplyGenie FastMCP Server (src/applygenie/server.py)"]
        Router["62-Tool MCP Dispatcher & Pydantic Schema Validator"]
        Safety["Safety Shield & Human-in-the-Loop Auditor"]
    end

    subgraph Pillars["Core Operational Pillars"]
        P1["1. Deep Scraping Engine<br/>(Greenhouse, Lever, Workday, Ashby, Taleo)"]
        P2["2. Profile & Resume Intelligence<br/>(300+ Skill Ontology, Trajectory, Gaps)"]
        P3["3. Resume-to-Job Matching<br/>(Weighted Scoring, Cover Letters, Pitches)"]
        P4["4. Stealth Browser Automation<br/>(CDP Cloaking, Biometric Jitter, Autofill)"]
        P5["5. Application Tracker & Analytics<br/>(SQLite v2, FTS5 Search, Funnel Velocity)"]
        P6["6. Mock Interview Engine<br/>(Socratic Ladders, STAR Coaching, Scorecards)"]
        P7["7. Desktop Control & Vision<br/>(Screenshots, DPI Clicks, Windows)"]
    end

    subgraph Storage["Sovereign Local Storage (~/.applygenie/)"]
        ProfileJSON["profile.json<br/>(Atomic JSON Schema)"]
        DB["applygenie.db<br/>(SQLite v2 + FTS5 Indexing)"]
        Resumes["resumes/<br/>(Target PDF/DOCX Resumes)"]
        Exports["exports/<br/>(Markdown, JSON, CSV Reports)"]
        Logs["logs/<br/>(Safety Action Audit Trails)"]
    end

    Client <-->|JSON-RPC Stdio| FastMCPServer
    FastMCPServer --> Router --> Safety --> Pillars
    P1 --> Exports
    P2 <--> ProfileJSON
    P2 <--> Resumes
    P3 <--> P1
    P3 <--> P2
    P4 <--> P2
    P4 --> P5
    P5 <--> DB
    Safety --> Logs
```

For complete technical specifications, see the [System Architecture Guide](docs/architecture.md).

---

## 🚀 Quickstart & Installation

### Option 1: Run directly with `uvx` (Zero manual setup, recommended)
```bash
uvx applygenie-mcp
```

### Option 2: Install via `pip`
```bash
# Core package
pip install applygenie-mcp

# With full browser automation & stealth dependencies:
pip install "applygenie-mcp[full]"
playwright install chromium
```

---

## ⚙️ Configuration for MCP Clients

### 1. Claude Desktop
Add to your Claude configuration file:
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Linux**: `~/.config/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "applygenie": {
      "command": "uvx",
      "args": ["applygenie-mcp"]
    }
  }
}
```

### 2. Cursor IDE
Navigate to **Settings > Features > MCP > Add New MCP Server**:
- **Name:** `ApplyGenie`
- **Type:** `command`
- **Command:** `uvx applygenie-mcp`

Or configure `.cursor/mcp.json`:
```json
{
  "mcpServers": {
    "applygenie": {
      "command": "uvx",
      "args": ["applygenie-mcp"]
    }
  }
}
```

### 3. Google Antigravity
Add to your workspace `.agents/mcp_config.json` or `~/.gemini/config/mcp_config.json`:
```json
{
  "mcpServers": {
    "applygenie": {
      "command": "python",
      "args": ["-m", "applygenie.server"]
    }
  }
}
```

### 4. Windsurf
Add to `~/.codeium/windsurf/mcp_config.json`:
```json
{
  "mcpServers": {
    "applygenie": {
      "command": "uvx",
      "args": ["applygenie-mcp"]
    }
  }
}
```

### 5. VS Code (Cline / Roo Code)
Add to your extension's `mcpSettings.json`:
```json
{
  "mcpServers": {
    "applygenie": {
      "command": "uvx",
      "args": ["applygenie-mcp"]
    }
  }
}
```

*(Configuration templates are also located in [examples/mcp_client_configs/](examples/mcp_client_configs/).)*

---

## 🛠️ Complete MCP Tool Reference (62 Tools)

### 1. Deep Job Scraping & ATS Extraction Tools (3 Tools)
*Comprehensive documentation available in the [Deep Scraping Guide](docs/deep_scraping_guide.md).*

| Tool | Description |
| :--- | :--- |
| `scrape_job_posting(url, export_format)` | Deeply scrapes structured job postings from Greenhouse, Lever, Workday, Ashby, SmartRecruiters, Taleo, or generic pages. Extracts compensation, skills, requirements, remote policy, and benefits. Optionally exports to Markdown/JSON/CSV. |
| `batch_scrape_jobs(urls, max_concurrency, export_format)` | Concurrently scrapes multiple job postings with per-domain rate limiting, exponential backoff, and progress metrics. |
| `extract_job_details(html_or_text, source_url)` | Extracts structured job posting information from raw HTML or pasted job description text without network overhead. |

### 2. Candidate Profile & Resume Intelligence Tools (9 Tools)
| Tool | Description |
| :--- | :--- |
| `get_user_profile()` | Retrieves the complete candidate profile from `~/.applygenie/profile.json`. |
| `get_user_profile_summary()` | Returns concise summary of candidate credentials, skills count, and experiences. |
| `setup_user_profile(...)` | Initializes or overwrites candidate profile data, URLs, location, and job search defaults. |
| `update_profile_attribute(field_name, value)` | Updates a specific top-level field (e.g. `notice_period`, `willing_to_relocate`, `linkedin_url`). |
| `add_work_experience(...)` | Appends a structured employment or internship record to candidate profile. |
| `add_education_entry(...)` | Appends academic degree qualification to profile. |
| `add_project_entry(...)` | Appends a software portfolio project to profile. |
| `save_portal_custom_answer(question_pattern, answer_text)` | Saves reusable answer for recurring open-ended portal questions (e.g. "Why should we hire you?"). |
| `parse_resume_file(filepath)` | Extracts text from PDF or DOCX resume using `pdfplumber` or `python-docx`. |

### 3. Resume-to-Job Matching & Pitch Tools (3 Tools)
| Tool | Description |
| :--- | :--- |
| `import_resume_to_profile(filepath, overwrite)` | Parses resume file, extracts contact info, categorized skills, and career history, and saves to profile. |
| `match_resume_to_job(job_description_or_url)` | Scores resume against job requirements (0-100%). Computes skill overlap, missing keywords, experience alignment, strengths, and gap recommendations. |
| `generate_tailored_pitch(job_description_or_url, pitch_type)` | Generates customized outreach copy: `"elevator"` (30s pitch), `"recruiter_dm"` (LinkedIn note), or `"cover_letter"` (full letter). |

### 4. Stealth Browser Automation & Form Autofill Tools (12 Tools)
| Tool | Description |
| :--- | :--- |
| `browser_open(url, headless)` | Launches Playwright Chromium with deep CDP cloaking, discrete GPU profiles, and canvas/audio seed hashing. |
| `browser_navigate(url)` | Navigates active browser tab to target URL with automated Challenge Radar monitoring. |
| `browser_get_page_text()` | Extracts visible text content from current webpage. |
| `browser_get_page_screenshot()` | Captures high-res JPEG screenshot of the browser viewport. |
| `browser_get_accessibility_tree()` | Retrieves full ARIA accessibility snapshot to inspect comboboxes, listboxes, and dialogs. |
| `browser_detect_form_fields()` | Detects inputs, textareas, selects, comboboxes, and file uploads across main DOM, Shadow DOM, and iframes. |
| `browser_fill_detected_form(kinetic)` | Autonomously maps candidate profile data to detected inputs. With `kinetic=True`, simulates human cubic Bézier mouse movement and typing jitter. |
| `browser_advance_wizard_step()` | Clicks "Next" or "Continue" in multi-step job application wizards. |
| `browser_upload_resume(filepath)` | Uploads resume PDF/DOCX to detected file input or HTML5 drag-and-drop dropzone across all frames. |
| `browser_upload_cover_letter(filepath)` | Uploads cover letter file to detected cover letter field. |
| `browser_submit_form(confirm=True)` | Clicks submit button (**Requires explicit confirmation `confirm=True`**). |
| `browser_close()` | Closes browser gracefully and releases resources. |

### 5. Job Application Tracker & Analytics Tools (13 Tools)
| Tool | Description |
| :--- | :--- |
| `track_application(...)` | Records a newly submitted application in local SQLite database and initializes timeline tracking. |
| `update_application_progress(application_id, status, notes)` | Updates status (`applied`, `screening`, `interview`, `technical`, `offer`, `rejected`) and logs timeline event. |
| `log_application_stage(application_id, stage, notes)` | Records a stage milestone or interaction in application timeline. |
| `get_application_timeline(application_id)` | Returns chronological stage transition history of an application. |
| `add_interview_round_notes(...)` | Records notes, questions asked, ratings, and follow-up tasks for an interview round. |
| `get_tracked_applications(status, company, limit)` | Lists logged applications with optional status or company filtering. |
| `search_tracked_applications(query)` | Full-text search across company names, roles, notes, and descriptions using SQLite FTS5. |
| `export_applications(format, filepath, ...)` | Exports tracked applications and timelines to JSON or CSV file. |
| `import_applications_data(filepath_or_data, format, ...)` | Imports external applications from JSON or CSV into the tracker database. |
| `get_application_analytics()` | Calculates funnel conversion rates (Applied -> Screening -> Interview -> Offer), total active roles, and top portals. |
| `delete_application(application_id)` | Deletes a tracked job application record by its database ID. |
| `get_weekly_application_velocity()` | Groups application submission counts by week for the last 12 weeks. |
| `get_response_time_analytics()` | Calculates average/median employer response times, time to offer, and flags stagnant applications (> 14 days). |

### 6. Desktop Control & Vision Tools (17 Tools)
| Tool | Description |
| :--- | :--- |
| `screenshot(monitor=0)` | Captures display screenshot encoded as JPEG image. |
| `get_screen_size()` | Enumerates all connected monitors, resolutions, and virtual desktop bounding boxes. |
| `mouse_click(x, y, button, clicks)` | Clicks mouse with DPI scaling correction and rate limiting. |
| `mouse_move(x, y)` | Smoothly moves mouse cursor to target screen coordinates. |
| `mouse_scroll(direction, amount)` | Scrolls mouse wheel up or down. |
| `mouse_drag(start_x, start_y, end_x, end_y)` | Performs click-and-drag between coordinates with corner failsafe monitoring. |
| `get_mouse_position()` | Returns current mouse cursor coordinates `{"x": int, "y": int}`. |
| `type_text_input(text, interval)` | Types text with randomized inter-keystroke jitter (±30%) to simulate human typing cadence. |
| `press_keyboard_key(keys)` | Executes hotkeys (e.g. `ctrl+a`, `tab`, `enter`). Dangerous combos (`alt+f4`) are shielded. |
| `list_open_windows()` | Returns all visible desktop application windows with titles and geometry. |
| `focus_app_window(title)` | Brings target window to foreground via fuzzy title match. |
| `minimize_app_window(title)` | Minimizes target window. |
| `maximize_app_window(title)` | Maximizes target window. |
| `get_current_window()` | Returns info about currently focused active window. |
| `search_windows(pattern)` | Finds windows matching regex or substring. |
| `wait_seconds(seconds)` | Pauses execution safely (capped at 30s). |
| `get_action_history(last_n)` | Inspects safety audit action logs. |

### 7. Mock Interview Preparation Tools (5 Tools)
| Tool | Description |
| :--- | :--- |
| `start_mock_interview(interview_type, company, difficulty)` | Initiates coding, behavioral, or system design interview session tailored to target employer. |
| `get_coding_hint()` | Advances through 4-rung Socratic hint ladder (Conceptual -> Algorithmic -> Data Structure -> Partial Snippet). |
| `analyze_behavioral_star_answer(response_text)` | Evaluates candidate answer for STAR structure and computes the crucial "I" vs "We" individual ownership ratio. |
| `advance_system_design_interview(candidate_response)` | Submits architectural proposal and advances across the 4 design phases. |
| `generate_interview_scorecard(...)` | Produces standardized 1-5 evaluation rubric and final hiring recommendation. |

*(For exhaustive schema definitions, parameter types, return values, and prompt examples, see the [Complete Tools Reference Guide](docs/tools_reference.md).)*

---

## 🛡️ Safety & Human-in-the-Loop Architecture

ApplyGenie enforces strict safety guardrails designed for human collaboration:

1. **Human Confirmation on Form Submission**: Form submission (`browser_submit_form`) requires explicit `confirm=True`. By default, ApplyGenie populates 95% of inputs, takes a visual screenshot for human review, and pauses.
2. **Screen Corner Failsafe**: Moving the cursor to screen corner `(0, 0)` immediately halts all automation via `FailsafeTriggered`.
3. **Local Sovereignty**: All candidate profile data, resume caches, application tracking records, and logs stay on your local disk at `~/.applygenie/`. Zero cloud telemetry or external third-party sync.
4. **Rate Limiting**: Enforces a maximum action frequency (default: 30 actions/min) and minimum delays to prevent runaway loops.
5. **Key Combo Shield**: Dangerous system combinations (`alt+f4`, `ctrl+alt+del`) are blocked by default.

---

## 🧪 Running Tests & Verification

Live verification is mandatory across all ApplyGenie modules. Run the test suite:

```bash
# Run all tests
pytest tests/ -v

# Run scraping engine tests (unit + live HTTP)
pytest tests/test_scraper.py tests/live_test_scraper.py -v

# Run browser automation tests
pytest tests/test_anti_detection.py tests/test_browser_production.py -v

# Run profile & tracker tests
pytest tests/test_profile.py tests/test_tracker.py tests/test_profile_tracker_advanced.py -v

# Run live visual browser form-filling demo
python examples/run_live_browser_demo.py
```

For complete instructions and troubleshooting, see the [Live Testing Guide](docs/live_testing.md).

---

## 📚 Documentation Directory

- 🏛️ [System Architecture](docs/architecture.md) — Comprehensive technical architecture, sequence diagrams, and subsystem breakdown.
- 🛠️ [Complete Tools Reference](docs/tools_reference.md) — Exhaustive reference of all 62 MCP tools, parameters, return schemas, and prompt examples.
- 🕷️ [Deep Scraping Guide](docs/deep_scraping_guide.md) — Guide to ATS platforms (Greenhouse, Lever, Workday, Ashby, SmartRecruiters, Taleo), compensation parsing, and batch scraping.
- 🧪 [Live Testing & Verification](docs/live_testing.md) — Guide for running unit, live HTTP, and Playwright verification suites.
- 🛡️ [Safety & Guardrails](docs/safety.md) — Safety principles, failsafes, and human-in-the-loop policies.

---

## 📄 License

This project is licensed under the **MIT License** — see the [LICENSE](LICENSE) file for details.

Developed with ❤️ by **Tanishq Mangal** (`tanishkmangal3@gmail.com`).
