Skip to main content
Glama
JobMailGate MCP

JobMailGate MCP

Official
by madics
README.md
# JobMailGate MCP

Give your agent the email context it needs to track job applications, through searches scoped to your job catalog.

A local MCP server that connects a job catalog in Google Sheets or Excel to relevant Gmail correspondence. Your coding agent interprets messages, separates application attempts, and records statuses, application dates and selection phases with evidence.

The server does not call a language model or run a periodic worker. Gmail access is read-only. Validated spreadsheet changes are applied without a second confirmation dialog.

## What you need

- Python 3.13 or 3.14 and [uv](https://docs.astral.sh/uv/getting-started/installation/).
- A Gmail account and your own Google Cloud OAuth desktop application.
- A Google Sheets document you can edit, or a local `.xlsx` workbook.
- An MCP client that can start a local stdio server.

## Install

Clone this repository, open a terminal in it, then run:

```powershell
uv sync --locked
uv tool install . --python 3.13
jobmailgate --help
```

If `jobmailgate` is not found, run `uv tool update-shell`, reopen the terminal and try again. Every command also works as `uv run python -m jobmailgate` from the checkout.

## Configure and authorize

Google requires you to configure an OAuth application before it can grant local software access. Gmail and Sheets use **separate tokens**. The Sheets flow grants `drive.file` access to the selected document, not general Drive browsing.

Follow the [complete setup guide](docs/setup.md) to create your Cloud project, enable the APIs, register your account as a test user, configure the document and authorize access. Do not skip those steps or make the sheet public.

After setup, your MCP client starts the server using:

```text
jobmailgate --config C:/private/jobmailgate.json serve --api-version v2
```

Use an absolute configuration path. For clients that launch from a checkout:

```text
uv run --project C:/tools/jobmailgate-mcp python -m jobmailgate --config C:/private/jobmailgate.json serve --api-version v2
```

Configure the executable and each argument separately in your MCP client. `uv`, `jobmailgate` and the configuration file must be accessible to that client process. OAuth authorization is a one-time interactive setup, not something the agent repeats on every tool call.

## First use

Ask your agent:

> Use the job tracker MCP to check jobs whose status is `3 Cekam`. Read candidate headers first, inspect relevant messages, preserve separate application attempts, save dates and sources even when the status stays unchanged, and apply validated changes. Do not apply an age-based rejection rule unless I request it.

The usual workflow is:

```text
list_jobs -> search_jobs -> list_header_candidates -> read_candidate_messages
          -> assign_candidate_messages -> propose_changes -> apply_changes
          -> complete_job_analysis
```

Pass the returned `run_id` through the workflow. Reading a message does not finish its analysis. Completion verifies that the reported facts are actually saved. Unknown dates stay empty with an explanation.

For recovery without contacting Gmail, use `search_jobs(mode="cached")` and `read_candidate_messages(cache_only=true)`. Missing cached bodies fail explicitly rather than fetching silently.

## Updating from 0.1

The project is now **JobMailGate MCP** (`jobmailgate-mcp`). The new command and Python module are `jobmailgate`. Existing `jobtracker` launchers, `server.py`, `JOB_STATUS_*` variables and `job-status.json` files remain supported. Existing authentication and state directories are reused. See [naming compatibility](docs/migration.md#jobmailgate-naming).

**0.2 defaults to MCP v2.** V2 uses structured `proposal` and `facts` objects, renames the proposal tool to `propose_changes`, and adds `get_run_status`.

Existing clients can keep the original interface during the entire 0.2.x series:

```text
jobmailgate --config C:/private/jobmailgate.json serve --api-version v1
```

Keep your existing configuration, tokens and state directory. The database is backed up and migrated at startup. See [migration and recovery](docs/migration.md) before upgrading a live installation. Pending legacy proposals retain their original checks.

## Documentation

- [Setup and configuration](docs/setup.md)
- [MCP tools and contracts](docs/tools.md)
- [Architecture and trust boundaries](docs/architecture.md)
- [Migration and recovery](docs/migration.md)
- [Troubleshooting](docs/troubleshooting.md)
- [Contributing and checks](CONTRIBUTING.md)
- [Changelog](CHANGELOG.md)

## Development

```powershell
uv sync --locked
uv run ruff check .
uv run ruff format --check .
uv run mypy
uv run coverage run -m unittest discover -s tests
uv run coverage report
uv build --no-build-isolation
```

Offline tests use synthetic accounts and spreadsheet doubles. `jobmailgate sheets-verify` is an explicit live check: it creates and modifies a separate copy and verifies that the source is unchanged. It never performs the test writes on the active document.

Private configuration, spreadsheets, credentials, databases and execution logs do not belong in Git or release artifacts. The default audit may contain complete email contents; see the architecture guide for local storage and retention.

Licensed under [MIT](LICENSE).