Skip to main content

Developers

Integration Reference

Lawenots exposes a Model Context Protocol (MCP) server for Claude connector integration and a set of public REST endpoints. The Labs Flywheel framework — R/R gate, covenant validator, and swing parameter builder — is accessible to Claude via MCP tools when private-beta access is provisioned.

When to open your workspace

Docs are public. Sign in after Labs Flywheel or practice access is provisioned to create MCP OAuth credentials and keys.

Open workspace →

MCP Connector for Claude

Add LAWENOTS as a connector in Claude.ai to query Labs Flywheel state, validate swing setups through the R/R gate and covenant system, and structure HITL trade parameters — all in a conversation, without navigating a UI. Requires provisioned Labs Flywheel access (request beta).

OAuth discovery endpoint

https://www.lawenots.com/api/mcp/.well-known/oauth-authorization-server

Claude's connector marketplace auto-discovers the authorization and token endpoints from this URL. Add this to the connector configuration when registering LAWENOTS as a Claude connector.

OAuth flow

  1. Claude redirects user to https://www.lawenots.com/api/mcp/oauth/authorize
  2. User authenticates with their LAWENOTS account
  3. LAWENOTS redirects back to Claude with an authorization code (5-minute TTL)
  4. Claude exchanges the code at https://www.lawenots.com/api/mcp/oauth/token
  5. LAWENOTS issues a signed Bearer token (HMAC-SHA256, 1-hour TTL)
  6. Claude sends Authorization: Bearer <token> on every MCP call

Available tools

get_flywheel_stateflywheel:read

Returns total wealth, monthly yield, exchange-linked margin utilization, active container count, and compounding streak.

get_credit_capacityflywheel:read

Returns exchange-linked margin line, amount drawn, available capacity, utilization %, and the 75% covenant limit (your exchange accounts — Lawenots does not lend).

get_open_containersflywheel:read

Returns active swing and income containers with price levels, days remaining, and P&L.

check_rr_gateflywheel:read

Validates a proposed trade entry/stop/target against the LAWENOTS R/R gate formula. Equity ≥ 2:1, crypto ≥ 3:1.

validate_swing_covenantsflywheel:read

Runs the full covenant checklist for a swing container: macro filter, duration, risk %, strategy-specific conditions, and crypto overlays.

create_swing_parametersflywheel:write

Structures validated swing setup parameters into a broker-formatted HITL output. Status is always 'pending_review' — nothing is submitted automatically.

get_morning_briefflywheel:read

Returns a plain-English morning summary: portfolio value, exchange margin utilization, active containers, and swing alerts.

HITL contractcreate_swing_parameters always produces status: "pending_review". It never submits orders to a broker. The investor reviews, adjusts, or discards the output before any action is taken. LAWENOTS is a tool — not investment advice.

REST Endpoints

Full OpenAPI 3.1 spec at /openapi.yaml.

GET/api/public/pricing
Auth: NoneActive service catalog. Cached 10 minutes.
GET/api/public/platform-capabilities
Auth: NoneCurrent execution mode, paper trading status, and autonomous claims mode.
POST/api/contact
Auth: NoneRequest-access / contact form. Sends operator alert and user confirmation via Resend.
POST/api/stripe/create-subscription-checkout
Auth: SessionCreates a Stripe Checkout session for SaaS subscriptions (Intelligence, Autonomous, Close + Attest, etc.). Price from service catalog.
POST/api/mcp
Auth: Bearer tokenMCP Streamable HTTP endpoint. Requires flywheel_access subscription.
GET/api/mcp/oauth/authorize
Auth: NoneOAuth 2.0 authorization endpoint — entry point for the Claude connector flow.
POST/api/mcp/oauth/token
Auth: NoneExchanges an authorization code for a signed MCP Bearer token (1-hour TTL).
GET/api/mcp/.well-known/oauth-authorization-server
Auth: NoneOAuth 2.0 server metadata (RFC 8414) — used by connector marketplaces for auto-discovery.

Rate Limits

EndpointLimitWindowScope
/api/mcp30 requests60 secondsPer IP
/api/public/*120 requests60 secondsPer IP
/api/contact20 requests60 secondsPer IP

Rate limit headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset

Open verification

Independently verify Close + Attest evidence

Lawenots publishes verification tooling for Close + Attest so operators, firms, and auditors can independently validate evidence packages without a Lawenots account.

These are verification and contract artifacts — not the full product. Reconciliation matching, allocation drift logic, and Labs Flywheel covenant implementations remain proprietary.

Ecosystem & SDKs

Live OpenAPI is served at /openapi.yaml and versioned under Lawenots/openapi. Typed SDKs (@lawenots/sdk for TypeScript, lawenots-sdk for Python) are generated from that spec for firm integrators.

Prefer Claude Desktop? Use the MCP OAuth flow above — HITL swing parameters never auto-submit to a broker.

Lifecycle webhooks (roadmap)

Firm-scale automation will subscribe to signed webhook events. Not yet live — request early access for ingestion, reconciliation, and export notifications.

EventDescription
ingestion.completedBank or on-chain sync finished for an org
reconciliation.completedAccount reconciliation marked complete
period.closedPeriod lock succeeded with readiness score
export.generatedTax or statement export with receipt id
attestation.anchoredSettlement anchor posted to GL (Close + Attest)

Request firm / API access →

API Keys

Books API keys (live): Signed-in operators with org.manage permission can create and revoke keys at /books/settings/api-keys. Keys authenticate the Books public API; only a SHA-256 hash is stored server-side.

Firm portfolio API (REST v1): POST /api/v1/firm/api-keys provisions firm-scoped keys for portfolio sync and tax exports. A dedicated firm settings UI is on the roadmap — use the REST endpoint or contact us for onboarding.

MCP Bearer tokens: Labs Flywheel and allocation connectors use OAuth 2.0 → short-lived HMAC tokens (see MCP section above).

Need a specific integration scope? Request access →

R/R Gate Formula

Equity minimum: 2.0 : 1

Crypto minimum: 3.0 : 1

ratio = (potentialGain − creditCostTotal)

/ (definedRisk + creditCostTotal)

Where:

potentialGain = ((target − entry) / entry) × deployed

definedRisk = ((entry − stop) / entry) × deployed

creditCostTotal = (creditRate / 100) × deployed × (days / 365)

The credit cost is deducted from the numerator and added to the denominator, making the gate progressively harder for longer hold durations and higher borrow rates. Source: lib/mcp/rr-gate.ts

Developers — Lawenots