Get started
Quickstart
Connect an MCP client to an A2M server and walk through check, place, status and cancel.
This walks through the MCP binding. https://a2m.example.com/mcp is a placeholder: replace it with the endpoint of the A2M server you have been given access to. There is no public A2M endpoint yet.
1. Connect your MCP client
Section titled “1. Connect your MCP client”If your client supports OAuth for remote MCP servers, give it the URL alone. It will discover the authorization server from the protected-resource metadata and open a sign-in page.
If it only supports headers, use an agent token from an environment variable. Never paste a token into a config file you commit.
Cursor (.cursor/mcp.json):
{ "mcpServers": { "a2m": { "url": "https://a2m.example.com/mcp", "headers": { "Authorization": "Bearer ${env:A2M_AGENT_TOKEN}" } } }}Claude Code:
claude mcp add --transport http a2m https://a2m.example.com/mcp \ --header "Authorization: Bearer $A2M_AGENT_TOKEN"2. Who am I
Section titled “2. Who am I”Call a2m_whoami. It returns the agent your credential belongs to. A 401 with APEX_4001 means the credential is missing or wrong.
3. Watch a rejection
Section titled “3. Watch a rejection”Ask for something your mandate does not allow, with a2m_check:
{ "intent_id": "qs-0001", "venue": "hyperliquid", "instrument": "ETH", "side": "buy", "qty": "5", "order_type": "limit", "limit_price": "2000"}Expect a REJECT with a code such as A2M_FAT_FINGER_QTY. That is the protocol working.
4. Place a small order
Section titled “4. Place a small order”Use a quantity and price inside your mandate, a fresh intent_id, and a2m_place_order. On ACCEPT the tool sends the signed decision to the executor and returns the order. Use values your venue and mandate accept; the ones above are only an example.
If the verdict is PENDING_APPROVAL, poll a2m_approval_status, then call a2m_submit_decision with the decision and signature exactly as returned.
5. Follow and cancel
Section titled “5. Follow and cancel”a2m_order_statuswith theclient_order_idreturns state,filled_qty,avg_pxand fees.a2m_cancel_orderwith the same id cancels a working order.
6. Try tampering
Section titled “6. Try tampering”Take a signed ACCEPT, change qty, and pass it to a2m_submit_decision. The executor answers A2M_BAD_SIGNATURE (HTTP 422) and nothing reaches the venue.