# Mintmark — Complete Agent & Developer Reference (llms-full.txt) > Sovereign EU financial vaults and strictly read-only Streamable HTTP MCP runtime powered by Open Financial Runtime (Apache 2.0). > Canonical origin: https://usemintmark.com > Source repository: https://github.com/franalgaba/finance-mcp ================================================================================ 1. ARCHITECTURE & SECURITY INVARIANTS ================================================================================ - Data residency: Every tenant runs in an isolated Cloudflare Durable Object SQLite database pinned to EU jurisdiction (`jurisdiction("eu")`). - Encryption at rest: Per-tenant HKDF-SHA256 derived keys with AES-256-GCM envelope encryption. - Read-only guarantee: All MVP financial operations are strictly read-only. Zero payment initiation, transfers, or order placement. - Financial precision: All monetary amounts, quantities, and FX rates use exact `DecimalString` values (computed with `decimal.js`). Missing valuations stay `undefined` / listed in `unvaluedItemIds`, never coerced to `"0"`. - Credential isolation: Agents and QuickJS Code Mode programs have zero access to bank credentials, `process.env`, filesystem, or external network hosts. - Ephemeral lifecycle: Headless vaults created via `POST /v1/vaults` expire after 48 hours unless claimed by a human via `claimUrl` (Email Magic Link). Expired unclaimed vaults are purged automatically. - Human authentication: Passwordless Email Magic Link (15-minute single-use token, GET peek + POST consume so email link scanners cannot burn tokens) and OAuth 2.1 PKCE S256 for MCP clients. ================================================================================ 2. DISCOVERY & AUTH ENDPOINTS ================================================================================ - GET https://usemintmark.com/ Landing page (HTML + JSON-LD + Link discovery headers) - GET https://usemintmark.com/llms.txt Concise LLM discovery summary - GET https://usemintmark.com/llms-full.txt This complete technical reference - GET https://usemintmark.com/skill.md Executable agent skill file - GET https://usemintmark.com/.well-known/agent.json Machine-readable agent capability card - GET https://usemintmark.com/.well-known/oauth-authorization-server OAuth 2.1 Authorization Server Metadata (RFC 8414) - GET https://usemintmark.com/.well-known/oauth-protected-resource OAuth 2.1 Protected Resource Metadata (RFC 9728) - GET https://usemintmark.com/robots.txt Crawler policy - GET https://usemintmark.com/sitemap.xml XML sitemap - GET https://usemintmark.com/health Health probe: {"ok":true,"service":"mintmark","runtime":"open-financial-runtime","version":"0.1.0"} - GET https://usemintmark.com/portal Human web portal (Email Magic Link sign-in) - GET https://usemintmark.com/portal/claim?token= Human claim page for agent-provisioned vaults - POST https://usemintmark.com/api/waitlist Early-access waitlist signup ({ email, plan: "pro"|"business"|"api", country?, note? }) ================================================================================ 3. HEADLESS VAULT REST API ================================================================================ All Headless API responses return `Cache-Control: no-store`, `Referrer-Policy: no-referrer`, `X-Content-Type-Options: nosniff`, `X-Frame-Options: DENY`. Bearer tokens are 43-character URL-safe base64 strings matching `^[A-Za-z0-9_-]{43}$`. -------------------------------------------------------------------------------- 3.1 POST https://usemintmark.com/v1/vaults — Provision Isolated EU Vault -------------------------------------------------------------------------------- Auth: None (public when `OFR_PUBLIC_SIGNUP=true`; rate-limited to 5 requests per window per IP). Max request body: 4096 bytes. Strict object (unknown properties are rejected with 400). Request JSON Schema: ```json { "type": "object", "additionalProperties": false, "properties": { "label": { "type": "string", "minLength": 1, "maxLength": 80, "default": "agent-vault" }, "agentId": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$", "default": "default" }, "policy": { "type": "string", "enum": ["read-only", "read-only-strict", "read-only-aggregates"], "default": "read-only" } } } ``` Response 201 Created JSON Schema: ```json { "type": "object", "required": [ "vaultId", "residency", "mcpUrl", "agentId", "policy", "agentToken", "managementToken", "claimUrl", "expiresAt" ], "properties": { "vaultId": { "type": "string", "description": "Tenant ID (prefix t_)" }, "residency": { "const": "eu-durable-object" }, "mcpUrl": { "type": "string", "format": "uri" }, "agentId": { "type": "string" }, "policy": { "enum": ["read-only", "read-only-strict", "read-only-aggregates"] }, "agentToken": { "type": "string", "description": "Bearer token for POST /mcp (shown once)" }, "managementToken": { "type": "string", "description": "Bearer token for /v1/vault* (shown once)" }, "claimUrl": { "type": "string", "format": "uri", "description": "Human claim URL for permanent Email Magic Link ownership" }, "expiresAt": { "type": "string", "format": "date-time", "description": "ISO-8601 UTC expiry (48h after creation unless claimed)" } } } ``` Verified curl example: ```bash curl -sS -X POST https://usemintmark.com/v1/vaults \ -H "Content-Type: application/json" \ -d '{"label":"cfo-agent","agentId":"analyst","policy":"read-only-strict"}' ``` Status codes: - 201 Created: Vault provisioned. - 400 Bad Request: `{"error":"Invalid vault provisioning payload"}` - 405 Method Not Allowed: `Allow: POST` - 413 Payload Too Large: `{"error":"Request body exceeds size limit"}` - 429 Too Many Requests: Rate limit exceeded (includes `Retry-After` header). - 500 Internal Server Error: `{"error":"Unable to provision isolated EU vault"}` - 503 Service Unavailable: `{"error":"Headless vault provisioning is disabled"}` -------------------------------------------------------------------------------- 3.2 GET https://usemintmark.com/v1/vault — Inspect Vault Status -------------------------------------------------------------------------------- Auth: `Authorization: Bearer ` Response 200 OK JSON Schema: ```json { "type": "object", "required": [ "vaultId", "claimed", "residency", "expiresAt", "mcpUrl", "connectionsCount", "accountsCount", "agentsCount" ], "properties": { "vaultId": { "type": "string" }, "claimed": { "type": "boolean", "description": "false while ephemeral; true after human Magic Link claim" }, "residency": { "const": "eu-durable-object" }, "expiresAt": { "type": ["string", "null"], "description": "ISO-8601 UTC timestamp while unclaimed; null once claimed" }, "mcpUrl": { "type": "string", "format": "uri" }, "connectionsCount": { "type": "integer", "minimum": 0 }, "accountsCount": { "type": "integer", "minimum": 0 }, "agentsCount": { "type": "integer", "minimum": 0 } } } ``` Verified curl example: ```bash curl -sS https://usemintmark.com/v1/vault \ -H "Authorization: Bearer $MANAGEMENT_TOKEN" ``` Status codes: - 200 OK - 401 Unauthorized: Missing, malformed, invalid, or expired management token. - 404 Not Found: `{"error":"Vault not found"}` - 405 Method Not Allowed: `Allow: GET` - 410 Gone: `{"error":"Unclaimed vault has expired"}` - 429 Too Many Requests - 503 Service Unavailable -------------------------------------------------------------------------------- 3.3 POST https://usemintmark.com/v1/vault/sources/statement — Import Bank Statement -------------------------------------------------------------------------------- Auth: `Authorization: Bearer ` Max request body: 716800 bytes (700 KiB). Max `statementContent`: 524288 characters. Auto-detected formats: European CSV, OFX, ISO 20022 CAMT.053 (XML), Spanish AEB Norma 43. Request JSON Schema: ```json { "type": "object", "additionalProperties": false, "required": ["name", "statementContent"], "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 120 }, "statementContent": { "type": "string", "minLength": 1, "maxLength": 524288 }, "currency": { "type": "string", "pattern": "^[A-Za-z]{3}$", "description": "Optional ISO-4217 3-letter currency fallback (e.g. EUR)" } } } ``` Response 201 Created JSON Schema: ```json { "type": "object", "required": ["connectionId", "name", "accountsSynced", "transactionsSynced"], "properties": { "connectionId": { "type": "string" }, "name": { "type": "string" }, "accountsSynced": { "type": "integer", "minimum": 0 }, "transactionsSynced": { "type": "integer", "minimum": 0 } } } ``` Verified curl example: ```bash curl -sS -X POST https://usemintmark.com/v1/vault/sources/statement \ -H "Authorization: Bearer $MANAGEMENT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Operating EUR", "currency": "EUR", "statementContent": "Fecha,Fecha valor,Concepto,Importe,Divisa\n15/01/2026,15/01/2026,Cloudflare,-42.50,EUR\n16/01/2026,16/01/2026,Stripe Payout,1200.00,EUR\n" }' ``` Status codes: - 201 Created: Statement parsed, encrypted, and synced into the EU Durable Object. - 400 Bad Request: Invalid JSON schema or unparseable statement content. - 401 Unauthorized: Invalid or missing management bearer token. - 405 Method Not Allowed: `Allow: POST` - 410 Gone: Unclaimed vault has expired. - 413 Payload Too Large: Exceeds 700 KiB limit. - 429 Too Many Requests - 503 Service Unavailable -------------------------------------------------------------------------------- 3.4 Human Ownership Claim Flow -------------------------------------------------------------------------------- 1. Agent hands `claimUrl` (`https://usemintmark.com/portal/claim?token=`) to the human. 2. Human enters their email address; server emails a 15-minute single-use Magic Link. 3. Human opens the email link (GET peeks without burning) and clicks Confirm (POST consumes atomically). 4. Vault transitions to permanent ownership (`claimed: true`, `expiresAt: null`), preserving all imported connections and existing agent tokens. ================================================================================ 4. PRIVACY PROFILES MATRIX ================================================================================ | Profile | Balances & Totals | Transactions | Descriptions / Merchants / Counterparties | Code Mode & Search | | --- | --- | --- | --- | --- | | `read-only` | Visible (masked IBANs) | Visible | Visible (no raw provider IDs) | Full read-only access | | `read-only-strict` | Visible (masked IBANs) | Visible (amounts, dates, categories) | Redacted (descriptions, merchants, Bizum/SEPA names stripped) | Redacted monotonically | | `read-only-aggregates` | Visible (balances & category totals) | Blocked | Blocked | Transactions & events blocked everywhere | ================================================================================ 5. MCP STREAMABLE HTTP GATEWAY (POST https://usemintmark.com/mcp) ================================================================================ Transport: Stateless Streamable HTTP (JSON-RPC 2.0). Required headers: - `Authorization: Bearer ` - `Content-Type: application/json` - `Accept: application/json, text/event-stream` HTTP status codes on /mcp: - 200 OK: JSON-RPC result (or tool error payload with `result.isError = true`). - 401 Unauthorized: Includes `WWW-Authenticate: Bearer resource_metadata="https://usemintmark.com/.well-known/oauth-protected-resource"`. - 403 Forbidden: Cross-origin `Origin` header mismatch. - 405 Method Not Allowed: `GET /mcp` is disallowed on stateless transport (`Allow: POST`). - 429 Too Many Requests: Per-IP rate limit exceeded. Verified JSON-RPC curl examples: ```bash # Initialize session metadata curl -sS -X POST https://usemintmark.com/mcp \ -H "Authorization: Bearer $AGENT_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"agent","version":"1.0"}}}' # List all 11 tools curl -sS -X POST https://usemintmark.com/mcp \ -H "Authorization: Bearer $AGENT_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' # Call get_portfolio_summary curl -sS -X POST https://usemintmark.com/mcp \ -H "Authorization: Bearer $AGENT_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_portfolio_summary","arguments":{}}}' # Call spending_summary curl -sS -X POST https://usemintmark.com/mcp \ -H "Authorization: Bearer $AGENT_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"spending_summary","arguments":{"since":"2026-01-01","until":"2026-01-31"}}}' ``` -------------------------------------------------------------------------------- 5.1 Semantic MCP Tools (Recommended First) -------------------------------------------------------------------------------- 1. `get_portfolio_summary` (readOnlyHint: true) Returns active accounts, cash balances, exact per-currency totals, optional positions valuation, and per-connection `freshness` metadata. Input schema (strict): ```json { "type": "object", "additionalProperties": false, "properties": { "connectionId": { "type": "string", "minLength": 1 }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$" }, "refresh": { "type": "boolean" } } } ``` 2. `list_transactions` (readOnlyHint: true) Returns enriched transactions with cleaned merchant names, spending categories, payment methods, and `freshness` metadata. Blocked under `read-only-aggregates`. Input schema (strict): ```json { "type": "object", "additionalProperties": false, "properties": { "connectionId": { "type": "string", "minLength": 1 }, "accountId": { "type": "string", "minLength": 1 }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$" }, "since": { "type": "string", "format": "date", "description": "YYYY-MM-DD" }, "until": { "type": "string", "format": "date", "description": "YYYY-MM-DD" }, "category": { "enum": [ "dining", "groceries", "travel", "transport_fuel", "shopping", "subscriptions", "insurance", "utilities", "health_personal", "transfers", "income", "fees_refunds", "other" ] }, "merchant": { "type": "string", "minLength": 1, "maxLength": 120 }, "direction": { "enum": ["credit", "debit"] }, "status": { "enum": ["pending", "posted", "cancelled", "failed", "unknown"] }, "paymentMethod": { "enum": ["card", "sepa_direct_debit", "bizum", "transfer", "other"] }, "limit": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 }, "refresh": { "type": "boolean" } } } ``` 3. `spending_summary` (readOnlyHint: true) Returns exact decimal inflows, outflows, net cash flow, category breakdown, top merchants, recurring subscription candidates, and `freshness` metadata (defaults to last 30 days). Input schema (strict): ```json { "type": "object", "additionalProperties": false, "properties": { "connectionId": { "type": "string", "minLength": 1 }, "accountId": { "type": "string", "minLength": 1 }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$" }, "since": { "type": "string", "format": "date", "description": "YYYY-MM-DD" }, "until": { "type": "string", "format": "date", "description": "YYYY-MM-DD" }, "refresh": { "type": "boolean" } } } ``` 4. `list_new_events` (readOnlyHint: true) Returns newly detected financial events (`transaction.created`, `transaction.settled`, `balance.changed`). Input schema (strict): ```json { "type": "object", "additionalProperties": false, "properties": { "connectionId": { "type": "string", "minLength": 1 }, "type": { "type": "string", "minLength": 1 }, "since": { "type": "string", "format": "date-time" }, "limit": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 } } } ``` -------------------------------------------------------------------------------- 5.2 Core Discovery & Sandboxed Code Mode MCP Tools -------------------------------------------------------------------------------- 5. `connections` List active connections and granted capabilities visible to the calling agent. Input: `{ "capability"?: string, "connectorId"?: string }` 6. `search` Discover authorized connector tools matching a query/category. Input: `{ "query": string (min 1), "category"?: string, "limit"?: integer (1..50, default 10) }` 7. `describe` Return metadata, permission, operation type, and JSON Schema for a discovered `toolRef`. Input: `{ "toolRef": string (min 1) }` 8. `execute` (QuickJS WASM Code Mode Sandbox) Execute a TypeScript or JavaScript async body with a `return` statement returning JSON. Input: `{ "code": string (min 1), "language"?: "typescript" | "javascript" (default "typescript"), "timeout_ms"?: integer (100..60000) }` Sandbox globals: - `finance.connections.list(filter?)` - `finance.accounts.list(connectionIdOrFilter?, filter?)` - `finance.balances.list(connectionIdOrFilter?, filter?)` - `finance.positions.list(connectionIdOrFilter?, filter?)` - `finance.transactions.list(connectionIdOrFilter?, filter?)` - `finance.analytics.netWorth(balances, positions, liabilities, valuation)` - `finance.analytics.allocation(positions, valuation, groupBy?)` - `finance.analytics.cashFlow(transactions, { currency, from, to })` - `providers[""].(connectionId, input)` - `console.log(...)` Sandbox hard limits: 10,000 ms ceiling, 32 MiB heap, 512 KiB stack, 512 KiB output, 256 KiB program, 8 concurrent / 128 total bridge calls. Zero access to `fetch`, `process`, `Bun`, filesystem, or secrets. 9. `execution_status` Retrieve status, duration, logs, error, or output of a recent execution owned by this agent. Input: `{ "executionId": string (min 1) }` 10. `workflow` Reports persistent workflow availability. Input (strict): `{}` 11. `submit_feedback` Report missing connectors, bugs, or schema friction once per blocked task (auto-scrubs PII; never include credentials or IBANs). Input (strict): `{ "task": string, "kind": "missing"|"broken"|"confusing"|"idea", "impact": "blocked"|"worked_around"|"friction", "description": string, "proposedFix"?: string, "toolName"?: string }` -------------------------------------------------------------------------------- 5.3 MCP Tool Error Messages (`result.isError = true`) -------------------------------------------------------------------------------- - `"Agent access is unavailable"`: Agent was revoked or token rotated before/during execution. - `"Requested operation is unavailable under this agent policy"`: Denied by privacy profile or deny-by-default policy (`POLICY_DENIED`). - `"Provider rate limit exceeded; retry later"`: Upstream bank/provider rate limit (`RATE_LIMITED`). - `"Requested tool or connection is unavailable"`: Missing or inactive connection/tool (`TOOL_UNAVAILABLE`). - `"Tool call requires owner approval (approvalId: ...)"`: Operation requires explicit human approval (`APPROVAL_REQUIRED`). - Schema validation error string: Invalid arguments (`INVALID_INPUT`). ================================================================================ 6. MCP CLIENT INTEGRATION SNIPPETS ================================================================================ Remote OAuth 2.1 URL (Claude, ChatGPT, Cursor — browser consent with per-client privacy profile): https://usemintmark.com/mcp Headless Bearer Token Config (Claude Code / Cursor / Codex / OpenClaw): ```json { "mcpServers": { "mintmark": { "url": "https://usemintmark.com/mcp", "headers": { "Authorization": "Bearer ${MINTMARK_AGENT_TOKEN}" } } } } ```