Developers
Integration Reference
Pemabu exposes a Model Context Protocol (MCP) server for Claude connector integration and a set of public REST endpoints. The flywheel framework — R/R gate, covenant validator, and swing parameter builder — is accessible to Claude via MCP tools.
When to open your workspace
Docs are public. Open your workspace after Flywheel or practice access is provisioned to create MCP OAuth credentials and keys.
Open workspace →MCP Connector for Claude
Add PEMABU as a connector in Claude.ai to query your 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 a Flywheel access subscription.
OAuth discovery endpoint
https://www.pemabu.com/api/mcp/.well-known/oauth-authorization-serverClaude's connector marketplace auto-discovers the authorization and token endpoints from this URL. Add this to the connector configuration when registering PEMABU as a Claude connector.
OAuth flow
- Claude redirects user to
https://www.pemabu.com/api/mcp/oauth/authorize - User authenticates with their PEMABU account
- PEMABU redirects back to Claude with an authorization code (5-minute TTL)
- Claude exchanges the code at
https://www.pemabu.com/api/mcp/oauth/token - PEMABU issues a signed Bearer token (HMAC-SHA256, 1-hour TTL)
- Claude sends
Authorization: Bearer <token>on every MCP call
Available tools
get_flywheel_stateflywheel:readReturns total wealth, monthly yield, exchange-linked margin utilization, active container count, and compounding streak.
get_credit_capacityflywheel:readReturns exchange-linked margin line, amount drawn, available capacity, utilization %, and the 75% covenant limit (your exchange accounts — Pemabu does not lend).
get_open_containersflywheel:readReturns active swing and income containers with price levels, days remaining, and P&L.
check_rr_gateflywheel:readValidates a proposed trade entry/stop/target against the PEMABU R/R gate formula. Equity ≥ 2:1, crypto ≥ 3:1.
validate_swing_covenantsflywheel:readRuns the full covenant checklist for a swing container: macro filter, duration, risk %, strategy-specific conditions, and crypto overlays.
create_swing_parametersflywheel:writeStructures validated swing setup parameters into a broker-formatted HITL output. Status is always 'pending_review' — nothing is submitted automatically.
get_morning_briefflywheel:readReturns a plain-English morning summary: portfolio value, exchange margin utilization, active containers, and swing alerts.
create_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. PEMABU is a tool — not investment advice.REST Endpoints
Full OpenAPI 3.1 spec at /openapi.yaml.
/api/public/pricing/api/public/platform-capabilities/api/contact/api/stripe/create-subscription-checkout/api/mcp/api/mcp/oauth/authorize/api/mcp/oauth/token/api/mcp/.well-known/oauth-authorization-serverRate Limits
| Endpoint | Limit | Window | Scope |
|---|---|---|---|
/api/mcp | 30 requests | 60 seconds | Per IP |
/api/public/* | 120 requests | 60 seconds | Per IP |
/api/contact | 20 requests | 60 seconds | Per IP |
Rate limit headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
API Keys
The public_api_keys table is provisioned in Supabase with RLS and scoped access control (portfolios:read, signals:read, etc.). A key management UI is on the roadmap. For now, the MCP Bearer token flow is the primary programmatic integration surface.
Interested in API key access for a specific integration? 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