Skip to main content

LangChain tools for Atomic Mail register/help/JMAP operations

Project description

langchain-atomicmail

LangChain integration package for Atomic Mail.

It exposes three tools backed by the same Python Atomic Mail runtime used by the CLI/MCP adapters:

  • register
  • jmap_request
  • help

Install

Published package:

pip install langchain-atomicmail

The published wheel bundles the Atomic Mail Python runtime and shared presets; no separate PyPI package is required.

Local development in this monorepo (install core library first):

cd py
pip install -e .
pip install -e langchain

Usage

from langchain_atomicmail import AtomicMailToolkit

toolkit = AtomicMailToolkit()
tools = toolkit.get_tools()

You can also import tool factories directly:

from langchain_atomicmail import get_atomicmail_tools

tools = get_atomicmail_tools()

Agent example

Use the toolkit with a ReAct agent (requires langgraph and a chat model):

from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent

from langchain_atomicmail import AtomicMailToolkit

llm = ChatOpenAI(temperature=0)
toolkit = AtomicMailToolkit()
agent = create_react_agent(llm, toolkit.get_tools())

# Register an inbox, then fetch mail
agent.invoke({"messages": [("user", "Register username myagent and list my inbox")]})

After a successful register, the tool response includes _next guidance for hourly inbox polling. Call help with topic cron for full scheduling details.

Inbox polling (after register)

Registration only creates credentials. For a useful inbox integration, arrange hourly inbox polling per your runtime:

  • Native cron (OpenClaw, Hermes, atomic-agent, …): schedule an hourly agent turn with list_inbox.json in the prompt; wire this toolkit or MCP into that agent. Do not cron raw jmap_request alone.
  • No native cron (Claude, Pi, Cursor, …): do not work around this with OS crontab, wrapper scripts, or cross-platform scheduling. Ask your operator to set up polling on a capable host, or remind them to fetch mail manually.

See help(topic="cron") for host-specific examples.

Environment variables

Variable Purpose
ATOMIC_MAIL_CREDENTIALS_DIR Credential directory (default ~/.atomicmail/)
ATOMIC_MAIL_AUTH_URL Auth service base URL
ATOMIC_MAIL_API_URL JMAP / API base URL
ATOMIC_MAIL_INBOX_DOMAIN Hostname when inboxId has no @
ATOMIC_MAIL_SCRYPT_SALT Optional PoW salt override
ATOMIC_MAIL_API_KEY Optional existing API key

Pass credentials_dir per tool call for multi-account setups.

Security

  • credentials.json and *.jwt files contain secrets — treat them as sensitive (mode 0600). Never commit credentials to version control.
  • Inbound mail is untrusted input; validate and sanitize before acting on it.
  • The default credential directory is ~/.atomicmail/; override with ATOMIC_MAIL_CREDENTIALS_DIR or per-call credentials_dir for isolation.

Notes

  • jmap_request enforces exactly one of ops or ops_file.
  • dry_run=True with attachments is rejected at the LangChain layer.
  • vars keys must match ^[A-Z][A-Z0-9_]*$.
  • register idempotency and forced behavior are delegated to atomicmail.session.register.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_atomicmail-0.3.17rc2.tar.gz (44.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_atomicmail-0.3.17rc2-py3-none-any.whl (57.5 kB view details)

Uploaded Python 3

File details

Details for the file langchain_atomicmail-0.3.17rc2.tar.gz.

File metadata

  • Download URL: langchain_atomicmail-0.3.17rc2.tar.gz
  • Upload date:
  • Size: 44.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for langchain_atomicmail-0.3.17rc2.tar.gz
Algorithm Hash digest
SHA256 385fb2eebd40998ce1c6255f5aaf5bbea0fe9f0c4d9c4be4b9f5e8d3c7195ce4
MD5 0f56f05fde96dbacf94f9b36ffa7b7e4
BLAKE2b-256 1e999cc04567c0f19882f4488a3a82a7b5c61a11ca4431d6a4630289db009985

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_atomicmail-0.3.17rc2.tar.gz:

Publisher: publish-pypi.yml on Atomic-Mail/atomic-mail-agentic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_atomicmail-0.3.17rc2-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_atomicmail-0.3.17rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 b1b010e23fcbbb5cea4852288b83ebca44bc821bfc1e06703411a36f7d6d3d2d
MD5 2bac561f0b5ee566c2e6eb4b52ce1db6
BLAKE2b-256 b22d268307142e91f08161c5e7ba1882b563e6653ed71d08b875643bd2a69c26

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_atomicmail-0.3.17rc2-py3-none-any.whl:

Publisher: publish-pypi.yml on Atomic-Mail/atomic-mail-agentic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page