Skip to content
Docs
Developers

Connect an AI client

Install the Edel skills, connect to the public MCP server and authenticate with a scoped API key.

Install the Edel skills

The Edel skills teach a coding agent or AI assistant how to use the public Edel API safely: REST, WebSockets, MCP tools, agents, deposits and withdrawals. Install them with one command:

Install the edel-markets skill
npx skills add Edel-Finance/edel-ai-config --skill edel-markets

What a skill does and does not do

A skill is instructions, not a credential. Installing it does not create an account, sign you in or give the agent permission to trade or move money. The skill tells the agent to read the authentication guide before any private call, to start with read-only checks, and to stop for you at every passkey step.

Connect to the public MCP server

The Edel MCP server is a remote Streamable HTTP service at the path /mcp. Send your API key as an Authorization bearer header on every request, including market tools; public REST market reads need no key. It runs on TestNet and DevNet; MainNet has no public MCP yet. Find the URL for your network in the Networks table.

Load the key from your client's secret store, never from a prompt, a command-line argument or a committed file.

Client configuration shape: no real credential
{
  "mcpServers": {
    "edel": {
      "url": "<MCP URL for your network>",
      "headers": {
        "Authorization": "Bearer <key from your client secret store>"
      }
    }
  }
}

Authenticate with an owner-approved key

An AI client gets its API key through a one-time browser approval by the account owner:

  • 01The client calls POST /v1/agent-connect/start with a clientName and the scopes it needs. The answer has a verificationUrl, a userCode and a connectCode.
  • 02The owner opens the URL, signs in, checks the code, the account and the scopes, and approves with a passkey. The client never asks for the passkey.
  • 03The client calls POST /v1/agent-connect/complete with the connectCode every intervalSeconds. It answers approved with the key exactly once. The grant ends after ten minutes.

A key expires after 24 hours by default and after 7 days at most. The owner can revoke it at any time. When it expires, run the approval again.

ScopeUse it for
readAccount, positions, orders, fills and previews.
tradePlacing and cancelling orders, after the owner approves the action.
agentsOpt-in. Managing the owner's in-app agents. TestNet and DevNet.
fundingOpt-in. Preparing deposits, withdrawals and agent funding. It never signs: the owner signs every funding step in the browser.

Quick examples

These examples use TestNet, which is open with test money: set EDEL_API_URL to https://testnet.edel-api.xyz. For another network, take its REST URL from Networks. Read a market without a key, then start a read-only grant:

Read a TestNet market, request a read key, then collect it after approval
curl --fail-with-body --silent "$EDEL_API_URL/v1/markets/BTC-USDCX-PERP/stats"

curl --fail-with-body --silent --request POST "$EDEL_API_URL/v1/agent-connect/start" \
  --header 'content-type: application/json' \
  --data '{"clientName":"my-assistant","scopes":["read"]}'

curl --fail-with-body --silent --request POST "$EDEL_API_URL/v1/agent-connect/complete" \
  --header 'content-type: application/json' \
  --data "{\"connectCode\":\"$CONNECT_CODE\"}"

First calls after connecting

  • 01Call edel_connect to confirm the key, its account and its scopes.
  • 02Call edel_status to check account readiness.
  • 03Check the venue status with edel_system_status (REST GET /v1/system/status). Treat status_unknown as unavailable.
  • 04Read markets with edel_markets and edel_price. These are snapshots: use WebSockets for live data.

When a request answers 429 with a Retry-After header, wait that many seconds. Otherwise wait for the rate window to reset, at most 60 seconds.

References