MCP Mailbox Access Implementation

Add mailbox GDBM access to misc MCP server to expose email metadata, bookings, and job analyses.

Envoy-Specific Context

The email3.meta.gdbm mailbox stores envoy-processed emails. A second separate GDBM file may be created for non-envoy traffic. The MCP tools should support querying mailboxes by name (mailbox_type parameter).

GDBM File Locking - LLM-Aware Design

email3.meta.gdbm is locked only during envoy writes (<100ms). MCP tool returns status='locked' on open failure. LLM client (Claude, etc.) sees the message and automatically retries. Simple, transparent, lets LLM handle retry logic intelligently.

Misc MCP Server Location

/home/john/py/gdata-server/misc_mcp_server.py

GDBM Files to Expose

gdata Module Hierarchy

/home/john/py/gdata/gdata.py provides three classes:

Four New MCP Tools

Implementation Strategy

Implementation Checklist

Key Implementation Pattern

Response Format

All tools return JSON with status field:

Risks & Mitigations

Reference Files

version 5  ·  updated 2026-09-05