Run CEG Broker from Claude, Codex or your own code.

Everything on the admin pages — adding CEG Properties, assigning them, recording payments, paying commissions, reading enquiries — is available as MCP tools and as a REST API. Connect once, then just ask.

Works with Claude and Codex

CEG Broker runs a remote MCP server (Model Context Protocol, Streamable HTTP) at https://www.cegbroker.com/api/mcp, plus a REST API with an OpenAPI 3.1 description. Both use the same API key and run exactly the same code as the website.

Claude CodeRemote MCP (HTTP) with a header✅
Claude DesktopThrough mcp-remote (one config entry)✅
OpenAI Codex CLI / IDERemote MCP (HTTP) with a bearer token✅
Cursor, Windsurf, VS CodeRemote MCP (HTTP) with a header✅
Scripts, Zapier, the Master BrainREST API + OpenAPI✅
claude.ai / ChatGPT web connectorsNeed OAuth sign-in — not supported yet; use a desktop or CLI client—

Setup

1

Create an API key

Sign in as an admin, open Admin → API keys, give the key a name (for example “Raj — Claude Code”), pick the access and click Create key. Copy the key — it starts with cegk_live_ and is shown only once.

  • Read only — look up properties, payments, commissions, submissions and users.
  • Read & write — also add, edit and delete. Every change is recorded as the admin who created the key, and the key stops working if that person stops being an admin.

The Master Brain’s existing CegStake key (cegstake:read) also works here, read-only.

2

Connect your AI tool

Claude Code

terminal
claude mcp add --transport http cegbroker https://www.cegbroker.com/api/mcp \
  --header "Authorization: Bearer cegk_live_YOUR_KEY"

Or share it with a project by adding .mcp.json (each person sets CEGBROKER_API_KEY in their shell):

.mcp.json
{
  "mcpServers": {
    "cegbroker": {
      "type": "http",
      "url": "https://www.cegbroker.com/api/mcp",
      "headers": { "Authorization": "Bearer ${CEGBROKER_API_KEY}" }
    }
  }
}

Claude Desktop

Settings → Developer → Edit Config, add this to claude_desktop_config.json, then restart Claude Desktop. Needs Node.js installed.

claude_desktop_config.json
{
  "mcpServers": {
    "cegbroker": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://www.cegbroker.com/api/mcp", "--header", "Authorization:${CEGBROKER_AUTH}"],
      "env": { "CEGBROKER_AUTH": "Bearer cegk_live_YOUR_KEY" }
    }
  }
}

OpenAI Codex (CLI and IDE extension)

terminal
export CEGBROKER_API_KEY=cegk_live_YOUR_KEY
codex mcp add cegbroker --url https://www.cegbroker.com/api/mcp --bearer-token-env-var CEGBROKER_API_KEY

Or add it to ~/.codex/config.toml:

config.toml
[mcp_servers.cegbroker]
url = "https://www.cegbroker.com/api/mcp"
bearer_token_env_var = "CEGBROKER_API_KEY"

Cursor, Windsurf and other MCP clients

mcp.json
{
  "mcpServers": {
    "cegbroker": {
      "url": "https://www.cegbroker.com/api/mcp",
      "headers": { "Authorization": "Bearer cegk_live_YOUR_KEY" }
    }
  }
}
3

Check it works

Ask: “Using cegbroker, list the CEG Properties.” You should see every property with its price, owner and how much is paid. In Claude Code, /mcp shows the server as connected with 12 tools.

What to ask

Talk to it like a colleague. It looks up ids itself and asks before moving money or deleting.

  • “Which CEG Properties aren't assigned to anyone yet?”list_properties
  • “Show me the payments on the Ocean Bleu 2-bedroom.”get_property
  • “Add Manta Bay Unit 1204 at $545,000, not assigned yet.”create_property
  • “Assign the Ocean Bleu 2-bedroom to Robert.”update_property
  • “Delete the property called Test.”delete_property
  • “Record a $10,000 bank transfer today on the Manta Bay unit.”add_payment
  • “Remove the duplicate $10,000 payment from yesterday.”delete_payment
  • “Give Bettina 2.5% commission on the Ocean Bleu 2-bedroom.”add_commission
  • “Take back the commission I gave Bettina by mistake.”remove_commission
  • “How much commission has Bettina earned in total?”list_commission_payouts
  • “Who enquired about Ocean Bleu this month?”list_submissions
  • “Find Robert's account.”search_users

Safety

  • Commissions are real money. add_commission credits the recipient’s CegStake wallet straight away and emails them; removing a commission or deleting a property debits it back. The tools tell the AI to confirm with you first.
  • Emails go out exactly as on the website: assigning a property and recording a payment email the assigned person.
  • Keys are secrets. Anyone holding a Read & write key can act as you. Use an expiry, give each tool its own key, and revoke a key the moment it may have leaked (Admin → API keys → Revoke).
  • Only the key’s hash is stored. CEG Broker cannot show a key again after it is created.

REST API basics

Base URL https://www.cegbroker.com/api/v1. Send the key as Authorization: Bearer cegk_live_…. Bodies are JSON; dates are YYYY-MM-DD; amounts are USD numbers.

request
curl "https://www.cegbroker.com/api/v1/properties?assignment=unassigned" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY"

Every response uses the same envelope. Lists add meta.total (all matches) and meta.limit.

response
{
  "success": true,
  "data": { "properties": [ … ] },
  "error": null,
  "meta": { "total": 4, "limit": 100 }
}
400Invalid input — the error names the field
401Missing, unknown, revoked or expired key
403The key cannot do this (a read-only key asking for a change)
404The property, payment or commission does not exist
502The database could not complete the request — safe to retry reads
503The key could not be checked right now — retry

Photos: pass image_url (a public https JPEG, PNG, WEBP or GIF up to 5 MB) in JSON, or upload the file as multipart with the JSON in a data field:

multipart upload
curl -X POST "https://www.cegbroker.com/api/v1/properties" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY" \
  -F 'data={"name":"Manta Bay — Unit 1204","price_usd":545000}' \
  -F "image=@unit-1204.jpg"

Operations

Each operation is one REST endpoint and one MCP tool with the same fields. Set CEGBROKER_API_KEY in your shell to run the examples.

Properties

List CEG Properties

Any key
GET/api/v1/propertiesMCP tool list_properties

Every CEG Property, newest first, with price, owner, amount paid, amount pending, % paid and commission totals — the Admin → Deals list.

Ask Claude: “Which CEG Properties aren't assigned to anyone yet?”

FieldTypeInDescription
assignment"all" | "assigned" | "unassigned"queryOnly properties assigned to someone, only unassigned ones, or all Default: "all".
statusstringqueryExact status, e.g. "active"
qstringqueryCase-insensitive match on the property name
limitintegerqueryPage size, default 100, max 500 Default: 100.

* required

curl
curl "https://www.cegbroker.com/api/v1/properties?assignment=unassigned" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY"

Get one property

Any key
GET/api/v1/properties/{id}MCP tool get_property

One property with its full payment history and every commission payout (with their ids).

Ask Claude: “Show me the payments on the Ocean Bleu 2-bedroom.”

FieldTypeInDescription
id*idpathProperty id (from list_properties)

* required

curl
curl "https://www.cegbroker.com/api/v1/properties/8165fbb2-0073-4139-a85d-2e5fdd69c029" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY"

Add a new CEG Property

Read & write key
POST/api/v1/propertiesMCP tool create_property

Add a CEG Property — the Add a new CEG Property pop-up. Assigning a user is optional (they are emailed when assigned). Can also record a payment already received and credit commissions; commissions move real money into wallets, so confirm them with the user first.

Ask Claude: “Add Manta Bay Unit 1204 at $545,000, not assigned yet.”

FieldTypeInDescription
name*stringbodyProperty name, e.g. "Manta Bay — Unit 1204"
price_usd*numberbodyProperty price in USD
unit_nostringbodyUnit number, e.g. "1204" or "Tower B · 1204"
notesstringbodyInternal notes for the admin team — never shown to the assigned user
assigned_user_idid | nullbodyUser the property is assigned to (from search_users). Omit to leave it unassigned; the user is emailed when assigned
commissionsobject[]bodyCommission payouts, each { "user_id": "…", "percentage": 2.5 } or { "user_id": "…", "amount_usd": 5000 }. Each one is credited to the recipient's CegStake wallet immediately — real money; confirm with the user first
fully_paidbooleanbodyRecord a payment for the whole price, dated payment_date or today
initial_payment_usdnumberbodyRecord a payment already received (ignored when fully_paid is true)
payment_datedatebodyDate for the recorded payment, YYYY-MM-DD; default today
payment_notestringbodyNote for the recorded payment, e.g. "Bank transfer"
image_urlhttps URLbodyPublic https link to a JPEG, PNG, WEBP or GIF photo (max 5 MB); it is copied into CEG Broker

* required

curl
curl -X POST "https://www.cegbroker.com/api/v1/properties" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Manta Bay — Unit 1204",
  "price_usd": 545000,
  "assigned_user_id": "3f6c2d1e-9a4b-4c7d-8e2f-1a2b3c4d5e6f",
  "initial_payment_usd": 50000,
  "payment_date": "2026-10-19",
  "payment_note": "Reservation deposit"
}'

Edit a property

Read & write key
PATCH/api/v1/properties/{id}MCP tool update_property

Change a property's name, price, photo or assigned user — the Edit deal pop-up. Only the fields you send change. assigned_user_id: null unassigns; a newly assigned user is emailed.

Ask Claude: “Assign the Ocean Bleu 2-bedroom to Robert.”

FieldTypeInDescription
id*idpathProperty id
namestringbodyNew property name
price_usdnumberbodyNew price in USD. Existing commissions keep their amounts
unit_nostring | nullbodyNew unit number; null or "" clears it; omit to leave as is
notesstring | nullbodyNew internal notes; null or "" clears them; omit to leave as is
assigned_user_idid | nullbodyAssign to this user (emailed when newly assigned); null to unassign; omit to leave as is
image_urlhttps URLbodyReplace the photo with this public https image (max 5 MB)
remove_imagebooleanbodyRemove the current photo

* required

curl
curl -X PATCH "https://www.cegbroker.com/api/v1/properties/8165fbb2-0073-4139-a85d-2e5fdd69c029" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "assigned_user_id": "3f6c2d1e-9a4b-4c7d-8e2f-1a2b3c4d5e6f"
}'

Delete a property

Read & write keyDestructive
DELETE/api/v1/properties/{id}MCP tool delete_property

Delete a property and all its payments. Every commission on it is reversed first (debited back from the wallets). Cannot be undone — confirm with the user.

Ask Claude: “Delete the property called Test.”

FieldTypeInDescription
id*idpathProperty id. Deleting also removes its payments and reverses every commission (debits the wallets back)

* required

curl
curl -X DELETE "https://www.cegbroker.com/api/v1/properties/8165fbb2-0073-4139-a85d-2e5fdd69c029" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY"

Payments

Record a payment

Read & write key
POST/api/v1/properties/{property_id}/paymentsMCP tool add_payment

Record money received for a property — Payments received → Add. The assigned user is emailed. Returns the property with updated paid/pending figures.

Ask Claude: “Record a $10,000 bank transfer today on the Manta Bay unit.”

FieldTypeInDescription
property_id*idpathProperty id
amount_usd*numberbodyAmount received in USD
payment_datedatebodyDate received, YYYY-MM-DD; default today
notestringbodye.g. "Bank transfer · installment 1"

* required

curl
curl -X POST "https://www.cegbroker.com/api/v1/properties/8165fbb2-0073-4139-a85d-2e5fdd69c029/payments" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount_usd": 10000,
  "payment_date": "2026-10-19",
  "note": "Bank transfer · installment 1"
}'

Delete a payment

Read & write keyDestructive
DELETE/api/v1/properties/{property_id}/payments/{payment_id}MCP tool delete_payment

Delete a recorded payment (get its id from get_property). Cannot be undone.

Ask Claude: “Remove the duplicate $10,000 payment from yesterday.”

FieldTypeInDescription
property_id*idpathProperty id
payment_id*idpathPayment id (from get_property)

* required

curl
curl -X DELETE "https://www.cegbroker.com/api/v1/properties/8165fbb2-0073-4139-a85d-2e5fdd69c029/payments/0b7c1a52-3d4e-4f60-9a81-b2c3d4e5f607" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY"

Commissions

Pay a commission

Read & write key
POST/api/v1/properties/{property_id}/commissionsMCP tool add_commission

Credit a commission on a property to a user's CegStake wallet — a percentage of the price or a fixed USD amount. Real money, credited immediately and emailed to the recipient: confirm with the user first.

Ask Claude: “Give Bettina 2.5% commission on the Ocean Bleu 2-bedroom.”

FieldTypeInDescription
property_id*idpathProperty id
user_id*idbodyRecipient user id (from search_users)
percentagenumberbodyShare of the property price, e.g. 2.5 for 2.5%
amount_usdnumberbodyFixed amount in USD instead of a percentage

* required

curl
curl -X POST "https://www.cegbroker.com/api/v1/properties/8165fbb2-0073-4139-a85d-2e5fdd69c029/commissions" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "user_id": "3f6c2d1e-9a4b-4c7d-8e2f-1a2b3c4d5e6f",
  "percentage": 2.5
}'

Remove a commission

Read & write keyDestructive
DELETE/api/v1/properties/{property_id}/commissions/{commission_id}MCP tool remove_commission

Remove a commission credited by mistake: the amount is debited back from the recipient's wallet and the payout deleted. Get the id from get_property. Confirm with the user first.

Ask Claude: “Take back the commission I gave Bettina by mistake.”

FieldTypeInDescription
property_id*idpathProperty id
commission_id*idpathCommission id (from get_property). Removing debits the amount back from the recipient's wallet

* required

curl
curl -X DELETE "https://www.cegbroker.com/api/v1/properties/8165fbb2-0073-4139-a85d-2e5fdd69c029/commissions/5d2e3f40-6a7b-4c8d-9e0f-a1b2c3d4e5f6" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY"

List commission payouts

Any key
GET/api/v1/commissionsMCP tool list_commission_payouts

Every commission paid out from any property, newest first — the Admin → Commission Payouts page.

Ask Claude: “How much commission has Bettina earned in total?”

FieldTypeInDescription
property_ididqueryOnly payouts from this property
user_ididqueryOnly payouts to this user
limitintegerqueryPage size, default 200, max 1000 Default: 200.

* required

curl
curl "https://www.cegbroker.com/api/v1/commissions?user_id=3f6c2d1e-9a4b-4c7d-8e2f-1a2b3c4d5e6f" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY"

Submissions

List form submissions

Any key
GET/api/v1/submissionsMCP tool list_submissions

Enquiry form submissions from the public pages (landing, Manta Bay, Ocean Bleu, …), newest first, with contact details and message — the Admin → Submissions page.

Ask Claude: “Who enquired about Ocean Bleu this month?”

FieldTypeInDescription
sourcestringqueryPage the form was sent from: "landing", "manta-bay", "ocean-bleu", …
qstringqueryCase-insensitive match on name, email, phone, project or message
sincedate-timequeryOnly submissions at or after this ISO time
limitintegerqueryPage size, default 100, max 500 Default: 100.

* required

curl
curl "https://www.cegbroker.com/api/v1/submissions?source=ocean-bleu&since=2026-10-01T00%3A00%3A00Z" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY"

Users

Find a user

Any key
GET/api/v1/usersMCP tool search_users

Search CEG accounts by name, email or company — the user picker. Use it to get the user_id for assigning a property or paying a commission.

Ask Claude: “Find Robert's account.”

FieldTypeInDescription
qstringqueryPart of a name, email or company
limitintegerqueryPage size, default 20, max 100 Default: 20.

* required

curl
curl "https://www.cegbroker.com/api/v1/users?q=robert" \
  -H "Authorization: Bearer $CEGBROKER_API_KEY"

OpenAPI

The full OpenAPI 3.1 description — every path, field, response shape and error — is at https://www.cegbroker.com/api/v1/openapi.json. Load it into Postman, Insomnia or a code generator, or browse it in Swagger Editor. Each operation carries x-mcp-tool with its MCP tool name.