A CLI for coding agents and humans, directly mirrored as an MCP server for chat agents.
Unofficial; not affiliated with or endorsed by Benchling, Inc. Benchling is a trademark of Benchling, Inc.
An electronic lab notebook is a scientific record, so letting an AI agent write to one directly is hard to trust. benchling-tools is a JSON-first command-line tool for a Benchling tenant that coding agents and people run directly. Each CLI command is also a tool on a local Model Context Protocol (MCP) server, so chat agents get the same commands, arguments, and replies. It uses the public Benchling API only and never automates the browser. It covers six change families: template-based entry creation, document text, unstructured tables, entry fields, assay results, and containers. Every change is first previewed as an immutable, checksummed plan, and a separate, explicit step applies it. You can keep several environments, each saved with benchling-tools auth login with its client secret in the OS keychain. Both interfaces return one versioned JSON envelope and stable exit codes.
No public Python API. benchling-tools has no public Python API. Its Python modules are internal and may change in any release. To script Benchling from Python, use the official Benchling SDK. A public Python API may be added if there is enough interest; open a GitHub issue to say you want one.
A scripted playback of the offline fixture demo (no credentials, no network). The demo page has the full transcript and the asciinema cast.
Python 3.11 or newer and uv are required. The distribution and the command are both named benchling-tools, published on PyPI. Install it with uv tool install, or run it without installing with uvx benchling-tools.
uv tool install benchling-tools benchling-tools --help From a checkout, use uv tool install ., or uv run benchling-tools after uv sync (add --extra dev for the test and lint tools); uv sync does not put benchling-tools on PATH.
Create the Benchling app and grant it project access first; see the setup guide. Then run benchling-tools auth login in your own terminal. The client secret is read from a hidden prompt, or from stdin with --secret-stdin, and is never accepted as an argument. It goes to the OS keychain; there is no plaintext fallback.
benchling-tools auth login --env dev # Tenant URL: https://your-tenant.benchling.com # Client ID: your-app-client-id # Client secret (not echoed): benchling-tools auth status benchling-tools doctor --env dev The toolkit acts as the app, with the app's permissions and audit identity, not the signed-in browser user. Login without a terminal, environment names, auth status --check, and auth logout are in the reference.
Linux servers and agent machines often have no unlocked Secret Service on the session bus, and benchling-tools will not write the client secret to a plaintext file. Install gnome-keyring and dbus, unlock a keyring, and run the login in that session. A long-lived bus for MCP, later shells, and cron is needed too. The commands are in the reference.
There is no default environment: pass --env NAME (or -e) on every API command. Every command prints a versioned JSON envelope; diagnostics go to stderr.
benchling-tools entry resolve EXP-0001 --env dev benchling-tools entry inspect etr_abc123 --env dev benchling-tools entry list --project src_example --modified-after 2026-01-01 --env dev benchling-tools results tables etr_abc123 --env dev benchling-tools results tables etr_abc123 --name-prefix "Panel Testing" --where "Processing run=RUN_ID" --env dev benchling-tools results diff --left EXP-1 --right EXP-2 --key Well --resolve-barcodes --env dev benchling-tools export --kind table --part docpart_table1 --format csv --output measurements.csv --env dev benchling-tools changes plan --entry etr_abc123 --family table --spec examples/table-set-cells.json --env dev benchling-tools changes apply PLAN_ID --env dev benchling-tools changes status PLAN_ID --env dev benchling-tools changes status --task TASK_ID --wait --env dev Every command, the six change families, spec shapes, result uploads and attachments, pending results, and the canned examples are in the CLI and MCP reference.
For example, resolve a handle with benchling-tools users get HANDLE --env dev, then use the returned ID with benchling-tools entry list --creator USER_ID --folder lib_example --env dev. Handles may also be passed directly to --creator or --author. To get the newest entry a user created, run benchling-tools entry list --creator USER_ID --sort created-desc --limit 1 --env dev.
For result uploads, preview defaults a missing projectId to the entry's project and refuses the plan if none is available. An explicit projectId: null requests creator-only access, but some tenants reject it. Apply checks every batch before uploading attachments; if a result creation fails after an upload, the error identifies unlinked blobs.
Preview also refuses a result upload that would push any results table past Benchling's 1,000-row table limit, with details.reason table_capacity_exceeded, before any file is staged. Run benchling-tools results capacity ENTRY --spec FILE --env dev to see the same numbers first. 500 records per table in one plan is this toolkit's own batch size; Benchling documents 4,000 results per bulk-create request.
To check a push the toolkit did not make, pass the JSON body an SDK client sent to POST /assay-results:bulk-create: benchling-tools results verify --payload body.json --created-after 2026-11-19T00:00:00Z --env dev (or --id ID for each created result, V2 or V3). It reports matched, mismatched, missing, and extra rows and pending versus accepted, the same report as results verify PLAN_ID. --entry ENTRY drops accepted records of other entries but keeps pending ones, which have no entry until accepted. Nothing is saved.
One server serves every environment saved with auth login. The client config carries no secrets; the server reads the same environments.json file and OS keychain as the CLI.
{ "mcpServers": { "benchling-tools": { "command": "uvx", "args": ["benchling-tools", "mcp", "serve"] } } } Each CLI command is one tool named after its command path (benchling-tools entry get is entry_get), with the same arguments, defaults, and envelope. Commands that need a terminal or change local credentials have no tool. On Linux, add DBUS_SESSION_BUS_ADDRESS to the config's env block. The naming rule, the Linux config, and tool details are in the reference.
The full safety model, design tradeoffs, exit codes, and known limitations are in the reference. The threat model covers what these controls do not protect against.
If you use this software, please cite it. GitHub's "Cite this repository" button uses CITATION.cff for jmamodeo/benchling-tools.
Both files in this release have provenance metadata.
benchling eln cli mcp model-context-protocol lab-automation laboratory-informatics
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Both files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Nov 23, 2026 2 release files Full provenance




