# Use the docs with AI agents Source: https://docs.rivermarkets.com/ai-tools Connect Claude, Claude Code, Codex, Cursor or any MCP client to the River Markets docs These docs are password-protected. An AI agent that opens a docs URL directly only sees the login page, so it cannot read anything. Connect it over MCP instead: the agent gets a search tool and full page reads, including the REST and WebSocket references, after a one-time sign-in with the docs password. ## The server ``` https://docs.rivermarkets.com/authed/mcp ``` > [!WARNING] > > Use `/authed/mcp`, not `/mcp`. The plain `/mcp` endpoint only serves the > public pages and will look nearly empty. When you connect, the client opens a browser window asking for the docs password. It is the same password you received at onboarding. Enter it once; the client stores a token and refreshes it on its own. ## Connect your client > [tab] Claude > > Works in Claude on the web and in the desktop app. > > 1. Open **Customize → Connectors** (**Settings → Connectors** on some plans). > 2. Click **Add custom connector**. > 3. Name it `River Markets Docs` and paste the server URL above. > 4. Keep the detected authentication settings and click **Add**. > 5. Sign in with the docs password when the browser window opens. > > In a chat, click the **+** button and enable the connector under > **Connectors**. Claude can now search and read the docs. > > > [!NOTE] > > > > On Team and Enterprise plans only an Owner can add a custom connector. > > Members then find it under **Customize → Connectors** and click **Connect**. > [tab] Claude Code > > ```bash theme={null} > claude mcp add --transport http river-docs https://docs.rivermarkets.com/authed/mcp > ``` > > Then, inside Claude Code, run `/mcp`, pick `river-docs` and follow the > browser sign-in. Add `--scope user` to the command to make the server > available in every project, or `--scope project` to commit it to > `.mcp.json` for your team: > > ```json theme={null} > { > "mcpServers": { > "river-docs": { > "type": "http", > "url": "https://docs.rivermarkets.com/authed/mcp" > } > } > } > ``` > [tab] Codex > > ```bash theme={null} > codex mcp add river-docs --url https://docs.rivermarkets.com/authed/mcp > codex mcp login river-docs > ``` > > Or add it to `~/.codex/config.toml`. The Codex CLI, IDE extension and > desktop app share this file. > > ```toml theme={null} > [mcp_servers.river-docs] > url = "https://docs.rivermarkets.com/authed/mcp" > ``` > [tab] Cursor > > Add the server to `~/.cursor/mcp.json` (everywhere) or `.cursor/mcp.json` > (one project). Cursor prompts for the sign-in the first time it connects. > > ```json theme={null} > { > "mcpServers": { > "river-docs": { > "url": "https://docs.rivermarkets.com/authed/mcp" > } > } > } > ``` > [tab] VS Code > > Run **MCP: Add Server** from the command palette, choose **HTTP** and > paste the server URL, or create `.vscode/mcp.json`: > > ```json theme={null} > { > "servers": { > "river-docs": { > "type": "http", > "url": "https://docs.rivermarkets.com/authed/mcp" > } > } > } > ``` > > Start the server from the file's inline **Start** action and sign in when > the browser opens. > [tab] Other clients > > Any MCP client that supports the streamable HTTP transport and OAuth can > connect with the server URL alone. Loopback redirect URLs are accepted, so > local tools work without registration. # Supported Exchanges Source: https://docs.rivermarkets.com/concepts/exchanges Exchanges available through River Markets # Supported Exchanges River Markets aggregates liquidity across multiple prediction market exchanges through a single API. ## Available Exchanges > [card] Kalshi > > US regulated prediction markets. > [card] Polymarket > > Crypto prediction markets. > [card] Polymarket US > > US regulated prediction markets. > [card] Crypto.com > > US regulated prediction markets on the Crypto.com Derivatives North America exchange > [card] Novig > > US regulated prediction markets on Novig. ## Coming Soon | Exchange | Description | Status | | - | - | - | | Rothera | US regulated prediction markets | Future integration | # Security Source: https://docs.rivermarkets.com/concepts/security How River Markets protects your account, credentials, and data. This page summarizes how River Markets is designed so that even in worst-case scenarios, the blast radius stays small. ## API key signing (Ed25519) API authentication is **asymmetric**. When you create an API key, the server generates an Ed25519 keypair, stores the **public key**, and returns the **private key** to you exactly once. We picked Ed25519 over the alternatives because it signs roughly 30× faster than RSA, has small (32-byte) keys, signs **deterministically** (no random number generator required at signing time, which removes a whole class of implementation bugs), and is hardened against timing and side-channel attacks. * **The private key never traverses the wire** after creation. Every request is signed locally; the server only ever verifies the signature. * **A full database compromise cannot forge requests.** An attacker with read access to our DB sees public keys, which doesn't enable to sign orders. * **Replay protection.** Ed25519 signatures are deterministic — the same request always produces the same signature — so the signature alone is not replay-proof. We dedupe each signature in Redis with a 60-second TTL: a captured request cannot be resubmitted, even within the clock-skew window. * **Rotation is in-place.** Rotating a key swaps the underlying material but keeps the `key_id` stable : you only update one secret, not your config. See [Authentication](/api-reference/authentication) for the protocol details. ## Row-Level Security (RLS) Every table in our database has **Row-Level Security** policies that scope queries to the subaccounts the caller is entitled to. RLS is enforced **at the database layer**, not in application code : so even if a code path forgets to filter, the DB refuses to return rows the caller isn't entitled to. * Each request runs as a `authenticated` role, never as a superuser. * Subaccounts, orders, fills, positions, balances, credentials, withdrawals, all gated by the same identity primitive. * Entitlement is resolved per request from your organization membership and your per-subaccount access grants. Reads and writes are separate permissions, so a read-only member cannot mutate orders even through a buggy code path. The practical effect: there is no API path, supported or otherwise, that can return data from a subaccount you have not been granted access to. ## Organizations and access control Every account belongs to an organization. Individual accounts are a single-member organization and behave exactly as before. Team accounts add: * **Per-subaccount access grants** — each member is granted specific permissions (view portfolio, place orders, manage credentials, manage members) on specific subaccounts. Organization admins have full access to every subaccount. * **Management is human-session-only.** API keys can read and trade; they can never change members, grants, credentials, or keys. * **Immediate revocation.** Blocking a member ends their sessions, closes their live WebSocket connections, and revokes their tokens. Resting orders belong to the organization and keep working — cancel them explicitly if that's not what you want. * **Append-only audit log.** Membership and grant changes are recorded by the database itself, with the actor, the before/after state, and the request context. The log cannot be edited or deleted through any API path. ## Exchange credentials When you add Polymarket or Kalshi credentials to a subaccount, they are **encrypted with asymmetric encryption** before being stored. The decryption key lives only in the trading service that needs them at execution time, they are never in plaintext at rest, never logged, never returned by any API endpoint. * Credentials are bound to the subaccount they were added to. * **Deleting a credential or a subaccount deletes the stored keys.** No archival, no soft delete. A single exchange credential can be deleted from the dashboard once the subaccount has no open orders on that exchange; the deletion is written to the audit log. * Credentials are rotated by replacing them; the old version is overwritten, not retained. ## Transport All traffic, REST, WebSocket, and database connections , runs over TLS. The API and the database are not reachable on the public internet without TLS termination. ## Database hardening Beyond RLS, the database instance is locked down at the platform level: * Dangerous procedural languages (`plpython3u`, `plperlu`, `plsh`) are removed and revoked at install time, no path to OS-level execution from a SQL injection, even if one existed. * Function creation is audited via DDL event triggers. * The service-account role used by the API has `BYPASSRLS` revoked, so it cannot accidentally read across users. ## What this means for you * Treat your API private key like a password: store it in an env var or secret manager, never in source control. * Rotate keys if you suspect exposure, rotation is instant and atomic. * Exchange credentials added via the dashboard are safer than committing them to your own configuration, since we encrypt them and never let them out of the trading service. # Introduction Source: https://docs.rivermarkets.com/introduction Unified prime brokerage for prediction markets # Welcome to River Markets River Markets provides a unified prime brokerage interface for prediction markets, including: * **Liquidity aggregation** across multiple exchanges * **Smart order routing** to get the best execution * **Market and data search** with unified identifiers * **Portfolio management** with subaccounts ## Supported Exchanges | Exchange | Markets | Status | | - | - | - | | Kalshi | US regulated prediction markets | Available | | Polymarket | Crypto prediction markets | Available | | Polymarket US | US regulated prediction markets | Available | | Crypto.com | US regulated prediction markets | Available | | Novig | US regulated prediction markets | Available | | Rothera | US regulated prediction markets | Future integration | ## How It Works 1. **Search** for markets across all supported exchanges using a single API 2. **Place orders** using unified River IDs — no need to manage exchange-specific identifiers 3. **Track positions** and fills in real-time across your entire portfolio 4. **Manage strategies** with isolated subaccounts > [!NOTE] > > Everything beyond this page needs the docs password you received at > onboarding. To let an AI agent read the docs, see > [Use the docs with AI agents](/ai-tools). > [card] [Quickstart](/quickstart) > > Get up and running in 5 minutes > [card] [API Reference](/api-reference/overview) > > Explore the full API > [card] [Core Concepts](/concepts/river-ids) > > Understand River IDs, subaccounts, and order types > [card] [AI agents](/ai-tools) > > Connect Claude, Codex or Cursor to these docs