mirror of
https://github.com/Komediruzecki/token-circles.git
synced 2026-10-20 09:46:43 +02:00
Adds a remote MCP server at POST /mcp and a bearer-authed account API, so an agent can read the account, import statements and write back categorizations without a browser session. - 15 tools across read / write / import scopes; stateless streamable-HTTP JSON-RPC. Tokens are tc_pat_-prefixed and stored as a SHA-256 hash (migration 0027). - Auth is an allow-list, not a widening of authenticateRequest: a bearer token reaches /mcp and /api/v1/* and nothing else, with a regression test pinning 401 on the cookie-authed routes. - File bytes never travel through a tool argument. prepare_import returns a 15-minute HMAC-signed, purpose-bound capability URL and the bytes go over plain HTTP; export_snapshot does the same in reverse. - POST /api/v1/import runs the bank adapters before falling back to generic CSV, so the API accepts the files the Bank Imports tab accepts. The detection/parse core moved to shared/bankImport/ for this; its 42-name public surface is unchanged and 14 of the 20 moved files are byte-identical in logic. Verified against a real 94-row Erste statement locally: parsed by the erste adapter at 0.97 confidence, 100% date and amount parse rates, account created and linked, re-import deduped to 0. 624 worker tests / 73 files, 1680 frontend tests / 137 files, both typechecks and lint clean. Deploys to dev only; prod still requires a v* tag.