Repository navigation
v0.1.0
Pre-release
Pre-release
First public release, and a pre-release — the package ships as
Development Status :: 3 - Alpha. Tool names, parameters and the response envelope may
still change before 1.0, so pin an exact version if you build on it.
Added
- 12 core tools, offline and free of API keys:
math,datetime,scale,convert,
holidays,numbers,text,collections,validate,random,geo_offline,
encode. Each takes amode, so a client pays for twelve tool descriptions rather than
a hundred. - 4 external tools over key-less public APIs:
weather(Open-Meteo),fx_rate(ECB
reference rates via Frankfurter),geo(geocode, reverse, driving route),url_check. - Optional file tools for agents that cannot open files themselves:
pdf_text,
pdf_info,image_info,image_to_base64,base64_to_file,file_info,read_text,
list_dir, restricted to the paths inLEFTBRAIN_FILE_ROOTS. - One response contract for every tool:
{"ok": true, "result": …, "assumptions": [], "warnings": []}. Failures return
ok: falsewith anerrorcode and a message; an ambiguous input returnsneedswith
the concrete options instead of guessing (IST,03/04/2025,ton,KB).resultis
never null, and exact and decimal forms are returned together so nothing is re-rounded. - MCP servers over stdio:
leftbrain,leftbrain-external,leftbrain-files. - MCP over Streamable HTTP:
leftbrain-serveputs every tool set in one stateless
process —/mcp,/external/mcp, optionally/files/mcp, plusGET /healthzand a
JSON service description at/. Dockerfile and compose file included. - Use from Python without MCP:
import leftbrain as lbgiveslb.math_tool(...)and
friends, andlb.TOOLSmaps every tool name to its function. - Hosted service at https://leftbrain.idlesync.in:
- GitHub sign-in; keys belong to the account's verified primary email.
- API keys prefixed
lblz_, up to 3 per account, 5,000 requests/day and 60/minute, with
quota headers on every response and429plusRetry-Afterwhen a limit is reached. - Dashboard: create a named key (shown once), reveal an existing one again, revoke, and
see today's usage. - Docs with Windows PowerShell / macOS / Linux tabs — quickstart, MCP client setup, a
custom-agents guide, and a copy-paste prompt that configures any coding agent. A
signed-in reader's own key is filled into every example on the page. - A per-tool reference generated from the MCP servers themselves: parameters come from
the published schemas and every example is executed while the page is built, so the
docs cannot drift from the code. - A key-less live demo on the landing page (
numbers,convert,datetime,text).
- Per-user key store on SQLite or Postgres, resolved from
LEFTBRAIN_KEYS_URL,
DATABASE_URLorLEFTBRAIN_KEYS_DB, with aleftbrain-keysadmin CLI (create, list,
enable, disable, revoke, set limits, usage, stats). - Key expiry. Keys are created with a lifetime — 30, 90 (default) or 365 days, or never
(the dashboard and CLI warn that a key which never expires is a liability if leaked).
An expired key is refused with403 {"error": "expired", "message": "key expired on <date>; create a new one at /dashboard"},
drops out of the 3-active cap, and can no longer be shown again. The dashboard shows
when each key expires and flags one within 7 days; the docs key picker skips expired
keys and reminds you when the selected one is about to expire.GET /keys/mereports
expires_atandexpired;leftbrain-keys create --expires 90d|neverand
set <prefix> --expires …manage it from the CLI. Existing keys are migrated with no
expiry. - Deployment guide for a free Northflank sandbox in
docs/deploy-northflank.md.
Changed
- Range parameters use the name their domain already uses rather than
from/to, which
collided with the Python keyword and forced afrom_spelling on the wire:
datetime diff,business_daysandcron_nexttakestart/end;math integrate
takeslower/upper;math limittakespoint;math convert_formtakesform;
geo_offline distanceand externalgeo routetakeorigin/destination. Thefrom,
from_and baretospellings are gone.from_unit/to_unit,from_qty/to_qtyand
from_tz/to_tzare unchanged. - The MCP wrappers accept every parameter their core tool supports, so a tool is not less
capable over MCP than it is from Python.
Fixed
- The GitHub OAuth callback handles malformed or unexpected responses instead of failing
with a server error. - Docs
:::ostab blocks are parsed fence-aware, so a:::inside a code sample no longer
ends the block early. - Static assets are stamped with a content hash, so a stylesheet or script change reaches
browsers without waiting for a version bump.
Security
- Security headers on every response:
X-Content-Type-Options: nosniff,
Referrer-Policy: strict-origin-when-cross-origin,X-Frame-Options: DENYand a
Content-Security-Policy withframe-ancestors 'none'. X-Forwarded-Foris counted from the right usingLEFTBRAIN_TRUSTED_PROXY_HOPS
(default 1), andX-Real-IP/CF-Connecting-IPare ignored — a caller cannot forge the
address a rate limit is keyed on.- The demo endpoint runs behind an allow-list of tools, modes and argument names, an 8 KiB
body cap and per-argument size caps, and never returns a traceback. - Keys are authenticated by comparing a SHA-256 hash. The revealable copy is
Fernet-encrypted under a key derived fromLEFTBRAIN_SECRET; leave that unset and only
the hash is stored. - Anonymous signup is closed unless
LEFTBRAIN_OPEN_SIGNUP=1. Sessions use a signed
cookie, every mutation is CSRF-checked, and any page carrying a key is sent
Cache-Control: no-store.