Skip to content

MCP server ​

Qian ships an MCP server, so any AI agent that speaks the protocol can launch tokens, trade, and read market data on Qian across every chain it supports.

It runs on your machine and signs with your key. Qian never sees the key and never holds funds. Every token you launch through it has its liquidity locked forever in QianLocker, same as a launch from the website.

Published as @qianexchange/mcp on npm. Source lives on git.qian.ag, MIT-licensed.

Setup ​

Add it to your MCP client (Claude Desktop, Cursor, or any other):

json
{
  "mcpServers": {
    "qian": {
      "command": "npx",
      "args": ["-y", "@qianexchange/mcp"],
      "env": { "QIAN_KEY": "0x<your-agent-wallet-private-key>" }
    }
  }
}

Drop QIAN_KEY for read-only mode. Market data still works; only launching, trading, and fee claims need a key. Fund a dedicated hot wallet with what the agent is allowed to spend and nothing more.

Tools ​

Reads, no key required:

  • list_tokens, get_token, get_trades, get_holders for market data
  • my_positions for holdings, ETH value, and PnL of any address
  • quote_buy, quote_sell to preview a trade at the live price
  • pending_fees for a token's unclaimed creator fees

Writes, signed with QIAN_KEY:

  • my_wallet for your address and ETH balance on each chain
  • buy, sell to buy and sell tokens, with slippage protection and auto-approve
  • launch_token to deploy a token: name, symbol, image, socials, FDV tier, creator fee, and an optional dev buy
  • collect_fees to claim your creator fees

Tokenized stocks (Robinhood Chain):

  • list_stocks, quote_stock to browse and price, no key required
  • buy_stock, sell_stock to trade via QianRWARouterV3 (non-US persons only; see Tokenized stocks)

x402 payments (v0.2.0):

  • x402_wallet shows the payment wallet's address and USDC balances
  • x402_pay fetches a URL and, on an HTTP 402 challenge, pays the requested USDC (Base or Arc testnet) by signing an EIP-3009 authorization, then retries. It never pays above the max_amount_usdc cap you pass. The signing key comes from X402_PRIVATE_KEY, then QIAN_KEY, else the server generates a burner wallet at ~/.qian/mcp-wallet.json — fund it with a few USDC and treat it as float.

x402_pay works against any x402-compliant endpoint, not just Qian's. Qian's API serves its own paid routes the same way: api.qian.ag/x402/trending returns the top tokens by 24h volume across every chain, and api.qian.ag/x402/price?chain=<slug>&token=<address> returns a spot price. Each answers with a 402 challenge naming the exact USDC amount, payable on Base or Arc testnet; x402_pay settles it and returns the data in one call.

QianPay (v0.3.0, Base):

  • create_payment_link, create_invoice, create_subscription_offer to bill in USDC. Funds settle to your QIAN_KEY wallet.
  • pay_dashboard, set_pay_profile, create_api_key, revoke_api_key, set_webhook, rotate_webhook_secret for the merchant account
  • get_payment_link, get_subscription_offer, get_subscriptions to read state, no key required
  • pay_link to settle a link or invoice in USDC, and subscribe, cancel_subscription, charge_subscription for subscriptions

The server signs a short-lived session with QIAN_KEY for merchant calls, so nothing is custodial. QianPay links settle in USDC through the QianPay contract, a separate rail from x402.

Quotes and thin pools ​

quote_buy and quote_sell read the canonical Uniswap quoter directly, so they need no key and no approval. A buy always returns a price. A sell can revert when the pool holds little ETH, and that is worth understanding before you wire an agent to trade.

A Qian launch seeds one-sided liquidity (all token, no ETH) over a fixed price range. ETH enters the pool only as people buy. Until enough has, a large sell asks for more ETH than the pool contains, and the swap reverts with a not-enough-liquidity error rather than filling at a punishing price. Sell a smaller amount, or wait for buy volume to deepen the pool. This is how the pool is built, not a limit the MCP adds.

Contracts are MIT-licensed and verified on-chain.