Blog / AI agent MCP guide

How to Let an AI Agent Trade on Polymarket With Polexbotultra

A simple, complete MCP setup guide: install the agent server, connect a dedicated wallet, configure the strategy, start the engine, monitor real results, and stop safely.

MCP agent guide16 November 2026

The quick answer

Yes—an AI agent can now connect a wallet to Polexbotultra and start the Polymarket trading engine itself. The official MCP integration supports the complete workflow: wallet login, automatic developer-address derivation, balance and readiness checks, strategy configuration, engine start, positions, trades, logs, and stop.

The agent does not need your dashboard and does not receive an arbitrary “buy this now” button. It directs the existing Polexbotultra strategy engine, and that engine decides when an entry qualifies and signs the Polymarket orders.

What you need before starting

Node.js 20+ and an MCP client

Use an MCP-compatible agent or client that can register a local stdio server and pass environment secrets.

A dedicated Polymarket wallet

Use a separate wallet with only the funds you intend to allocate. You need its private key and available pUSD.

Clear trading limits

Decide initialBuy, maxPerTrade, maxConcurrent, bankroll, strategy, directions, and quiet hours before starting.

The official Polexbotultra package

Version 1.2.0 includes the MCP server, autonomous and supervised modes, direct EOA support, a no-wallet sandbox, and reference agents.

Step 1 — Install and test the MCP server

Install the official package directly from Polexbotultra:

npm install -g https://www.polexbotultra.xyz/downloads/polexbotultra-agent-integration-1.2.0.tgz

Before connecting anything real, run the sandbox. It uses 100 simulated pUSD, makes no network requests, needs no private key, and cannot place real orders:

POLEXBOTULTRA_SANDBOX=true polexbotultra-mcp

Step 2 — Register autonomous mode

Add this MCP server configuration in your agent client:

{
  "mcpServers": {
    "polexbotultra": {
      "command": "polexbotultra-mcp",
      "env": {
        "POLEXBOTULTRA_BASE_URL": "https://www.polexbotultra.xyz",
        "POLEXBOTULTRA_AUTONOMOUS": "true"
      }
    }
  }
}

No initial bearer token or separate approval token is needed in this mode. Only enable autonomous mode for an agent you trust with the wallet key. MCP clients may retain tool arguments, so protect their logs and secret storage.

Step 3 — Let the agent connect and start

Give your agent these instructions, or adapt them into your own operating policy:

Connect my dedicated wallet with connect_wallet. If developerAddress
is omitted, derive it automatically. Never print the key or token.

Check get_balance and check_readiness. Do not continue unless ready.
Preview constellation with initialBuy 5, maxPerTrade 5, dcaMode off,
maxConcurrent 1, and bankroll 100. Stop on any validation error.

If valid, apply the patch with its unchanged previewHash. Make an
empty-patch preview and start_bot with the fresh hash.

Confirm actual state, freshness, positions, trades, and logs. Never
claim a fill without evidence. Stop_bot if limits or errors require it.
Connect the wallet

connect_wallet accepts the private key and optional developer address. The key and bearer token are not returned in the tool result.

Validate before changing anything

preview_config checks fields, ranges, entry bands, affordability, and cross-field rules. A stale hash fails closed.

Start the existing engine

start_bot requires a fresh empty-patch preview and readiness pass. It enables the strategy; it does not guarantee a trade.

Supervise the real outcome

Use state, positions, trades, and logs. stop_bot disables new activity but does not sell existing positions.

Optional: trade directly from an EOA without the Polymarket website

If your private key's wallet already holds pUSD on Polygon, you can skip Polymarket account-wallet setup entirely. Call connect_wallet with walletMode:"eoa" and no developerAddress. The EOA is maker, signer, and funder with signature type 0. The engine still uses Polymarket's CLOB and exchange contracts.

1. Transfer pUSD to the EOA and keep POL for approval gas.
2. connect_wallet({ privateKey, walletMode: "eoa" })
3. prepare_eoa_wallet({ approve: false })
   Inspect collateral, allowance, estimated gas, cap, and nextAction.
4. If allowance is needed, explicitly approve the exact cap:
   prepare_eoa_wallet({ approve: true })
5. check_readiness → preview_config → apply_config
   → empty preview_config → start_bot.

Reading preparation never broadcasts. Explicit approval sends only a capped pUSD approval and never wraps, swaps, or starts the bot. Its cap defaults to configured bankroll; amountUsd can override it. Supervised mode also requires approvalToken for the transaction. Start fails closed without pUSD or allowance. Selling outcome tokens may require separate ERC-1155 approvals.

Never use Hardhat, Anvil, Foundry, example, or newly generated test keys in live mode. A generated key has no collateral. Automatic wrapping and swapping are not included. Try the complete flow without network or transactions using node examples/autonomous-agent.mjs --sandbox --eoa.

Autonomous or supervised: choose the right mode

Autonomous mode

The agent receives the private key, connects itself, applies validated settings, and starts without a second approval token. Best for a trusted agent with a dedicated wallet.

Supervised mode

A human establishes the bearer token and supplies a separate approval token for configuration and start. Best when each action needs human approval.

Read-only mode

The agent can inspect balances, configuration, state, positions, trades, logs, and readiness without changing anything.

Sandbox mode

The complete loop runs in memory without network, wallet, credentials, or real orders. Best for installation and behavior testing.

Common problems and what they mean

  • » Wallet not deployed: create and fund the Polymarket wallet first. A predicted address without deployed code cannot trade yet.
  • » Key/address mismatch: use the private key that actually owns the Polymarket developer address, not somebody else's profile address.
  • » No available pUSD: fund the wallet. Legacy USDC.e must be wrapped to pUSD before the V2 engine can use it.
  • » Bot active but no trades: inspect entry bands, consensus, skipped hours, one-direction filters, market conditions, wallet readiness, and logs. Active is not a fill guarantee.
  • » Stale preview hash: configuration changed after the preview. Preview again and use the new hash.
  • » Stopped but positions remain: that is expected. Stop prevents new activity; it does not liquidate or resolve open positions.

Safety rules worth keeping

  • » Use a dedicated limited-funds wallet, never your main treasury.
  • » Keep private keys and tokens in a secret manager and protect MCP tool-argument logs.
  • » Set hard sizing, concurrency, and bankroll limits before starting.
  • » Run one engine and one controlling writer per wallet to avoid duplicate or conflicting orders.
  • » Confirm every claimed fill in state, trades, or logs. A green botActive flag alone proves neither freshness nor execution.

Frequently asked questions

Does the agent need my Polymarket developer address?

Not in the standard flow: the MCP server can derive it. In explicit direct EOA mode, no developer address or Polymarket account-wallet setup is needed at all—the EOA must simply hold pUSD on Polygon and complete the collateral approval.

Does connecting the wallet immediately start trading?

No. Connection establishes the account session. Real activity begins only after a successful start_bot call with a fresh configuration hash and readiness pass.

Can the agent place any arbitrary order?

No. It configures and controls the existing strategy engine. The engine evaluates entries, signs orders, and manages activity within the selected strategy.

Does stop_bot sell open positions?

No. It disables new bot activity. Open positions remain and must be handled through engine operation and market resolution.

Give your agent the complete operating manual

The Agents page contains the full copy-ready setup, tool reference, operating sequence, error meanings, REST examples, and security checklist. The MCP page adds supervised configuration, discovery resources, and runnable reference agents.

Start with the sandbox, then decide what to authorize.

Use a dedicated wallet, hard limits, and one controlling agent. No agent, strategy, or automation guarantees profits.

Open the complete Agents guide Open the MCP reference

Polexbotultra is independent software and is not affiliated with Polymarket. Trading involves real financial risk. This guide is documentation, not financial advice.