Add v0.1.0 read-only IMAP surface #1
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/imap-blade-mcp!1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/v0.1-read-surface"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
imap-blade-mcpv0.1.0: a read-only IMAP MCP server over the Stallariemail-v1contract, first target the Linux grokbot hosts. Eleven tools, stdio only, TLS always,EXAMINEplusBODY.PEEKonly, credential from an owner-only file read at login time, every body wrapped in untrusted-content markers. No SMTP, no write path, no HTTP transport, no CI files (the.woodpeckerrider is the architect's).Six commits on
feat/v0.1-read-surfacefrom the bootstrap onmain: scaffold and config, session and MIME, the tools and--check, unit tests, GreenMail integration harness, docs.Toolchain: system Python 3.14.7, uv 0.12.17; project venv Python 3.12.12 (
.python-version= 3.12, the floor). Container runtime for integration: Podman 5.8.7 (Docker daemon not running; the script prefers Podman and falls back to Docker).Acceptance checklist
make checkpasses on a clean clone. Cloned the branch into a scratch directory,make install, then:make test-integrationpasses against GreenMail. Imagegreenmail/standalonepinned by digestsha256:309ba544ea482e5d4265d09921cdab07c8dad2cc4481d715c9b8ff5d3f0a149f, IMAPS on 127.0.0.1:3993 with the repo test CA asca_file: A stale-id integration test was added during the red-side work; the finalmake test-integrationrun:24 passed in 9.55s.expose = ["mail_search"]. Guarded bytests/test_tool_surface.py::test_default_config_registers_exactly_elevenand::test_expose_single_tool_registers_one.tools/listbyte count recorded in the README and guarded. 13004 bytes (ListToolsResult,by_alias=True,exclude_none=True);RECORDED_TOOLS_LIST_BYTES = 13004with a +10% guard intest_tools_list_byte_budget. Longest description 285 chars (limit 400), longest parameter description 69 (limit 120).src/is empty. (no output; grep exit 1 = no match).tests/test_hygiene.pyruns the same patterns plus eval/exec/pickle, HTTP transport calls and imapclient write methods on every test run.--checkagainst GreenMail exits 0; a 0644 credential exits 2. Also covered byTestCheckCommandin the integration suite (exit 0, 2, 4 wrong password, 3 hostname mismatch via127.0.0.1).docs/deploy-linux.mdcovers all seven sections: install (uv tool from the tag, wheel fallback, no Nix), bot user, credential file (sops-nix,op read/op inject, systemdLoadCredential=, keyring not used headless), least privilege, client entry with noenvblock and the Grok-client caveat, smoke, rollback.Red-side results
Method for each (red) item: remove the guard in source with a one-line mutation, run the test(s) that own the item, show the failure naming the offender, restore the file, re-run to green. Items 8, 9, 11 to 18 are covered by the unit and integration suites without a red-side run.
(red) 1 TLS required: STARTTLS pre-check removed
Guard removed:
Test run with the guard removed:
Guard restored; same selection:
(red) 2 certificate failure: hostname check and CERT_REQUIRED removed
Guard removed:
Test run with the guard removed:
Guard restored; same selection:
(red) 3 credential handling: group/world bits allowed on the credential file
Guard removed:
Test run with the guard removed:
Guard restored; same selection:
(red) 4 scrubbing: scrub() bypassed on the error path
Guard removed:
Test run with the guard removed:
Guard restored; same selection:
(red) 5 no side effects: SELECT instead of EXAMINE and BODY[] instead of BODY.PEEK[]
Guard removed:
Test run with the guard removed:
Guard restored; same selection:
(red) 6 message identity: UIDVALIDITY comparison removed
Guard removed:
Test run with the guard removed:
Guard restored; same selection:
(red) 7 schema guard: a host parameter added to mail_mailboxes
Guard removed:
Test run with the guard removed:
Guard restored; same selection:
(red) 10 parser bounds: nesting bound raised from 32 to 1000
Guard removed:
Test run with the guard removed:
Guard restored; same selection:
Dependencies
Runtime, all from the fixed-decisions list, nothing added:
fastmcp>=3.1.0,<4imapclient>=4.1,<5ssl_context, EXAMINE, PEEK, raw command pathpydantic>=2.0.0,<3extra="forbid"and parameter schemasstallari-mcp-helpers>=0.1.1,<1.0meta_envelope/append_metaaudit tail (DD-338)Dev and test groups:
ruff,mypy,pytest,pytest-asyncio.pip-auditruns viauvx, not installed.uv.lockis committed.Server quirks found against GreenMail
BODY[1]<0>{64}), which the imapclient response parser rejects as "uneven number of response items". All fetches now go through imapclient's raw command path and that exact byte pattern is normalised before parsing. Compliant servers are unaffected.FROMsearch matches the address only, not the display name. The integration test searches by address.auth_error(exit 4) through the generic login-failure path rather thanauthenticationfailed. The RFC 5530 mapping is exercised by the unit suite's scripted server.Open items for the operator
docs/deploy-linux.md§5 gives the generic stdio stanza and says so.v0.1.0once merged; the install line in the deploy doc points at the tag. Not done here per the brief..woodpecker/*rider to be added by the architect fromfastmail-blade-mcp(ADR-0021). No CI files in this PR.tests/fixtures/tls/(ca.key,localhost.key,greenmail.p12with passwordchangeit). They sign onlyDNS:localhostfor the loopback and GreenMail tests and are documented intests/fixtures/tls/README.md. Say if you would rather they were generated at test time.--checkand a handful of tool calls against a real Dovecot or iCloud mailbox before deployment would be the first live exercise of those paths.make test-integrationneeds Podman or Docker and pulls the digest-pinned image on first run.🤖 Generated with Claude Code