openportfolio

MCP and agents

Watching a book is only useful if something is actually watching: reconciling after the close, settling a call the day its horizon passes, noticing that a deferred decision came due three weeks ago.

Why there is no API key

Metered inference is the wrong shape for that work. When each run bills per token, every autonomous check becomes a purchase, and a product that spends the operator's money unprompted has to ask first, or batch, or ration. All three turn a portfolio that watches itself into a portfolio that asks permission to look.

So every model call is dispatched to an agent CLI you are already signed in to, with a per-task fallback order. There is no provider key in this repo and no field to put one in.

This does not make a run free. Subscription plans have rate limits, and the fallback chain exists partly because one provider runs out before the others do. What changes is the kind of limit: quota and wall clock rather than spend, so a run never has to be justified one invocation at a time.

The provider chain

// actor.mts
const ORDERS = {
  sync:    ["codex", "claude"],
  review:  ["claude", "codex"],
  resolve: ["codex", "antigravity", "claude"],
};

Supported today: codex, antigravity (agy), claude. Adding one is an entry in the registry and a spawn shape.

The MCP server

A stdio MCP server exposes 25 tools over exactly one tenant's book, so an agent CLI can read and write it directly rather than through a scraped UI. The service key is injected inline rather than passed on the command line, so no secret reaches argv.

Group Examples
Read the book net worth, accounts, balances, snapshots
Flows record a session, read net buying, read turnover
Forecasts register a call, list due, resolve, read calibration
Decisions defer, list open, list overdue, close with an outcome
Catalysts add a dated event, list what is inside a window
Audit read the append-only log, including what the cron did unattended

There is no order tool, because there is no order function to expose.