Skip to content
Version v0.1 (draft)
ChangelogContributing

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.

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:

Terminal window
claude mcp add --transport http a2m https://a2m.example.com/mcp \
--header "Authorization: Bearer $A2M_AGENT_TOKEN"

Call a2m_whoami. It returns the agent your credential belongs to. A 401 with APEX_4001 means the credential is missing or wrong.

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.

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.

  • a2m_order_status with the client_order_id returns state, filled_qty, avg_px and fees.
  • a2m_cancel_order with the same id cancels a working order.

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.