Agentic tradingMCPClaudeRisk

How to run a trading agent from Claude in 2026

A step-by-step guide to connecting Claude to a non-custodial trading agent through MCP, setting limits, and placing your first order across multiple markets.

By the Felix team8 min read
Key takeaways
  • 01Claude connects to Felix through MCP, not custom scripts, so the agent reads market data and sends orders in the same chat window you use for analysis.
  • 02Every order is denominated in US dollars, which removes manual contract math but does not remove the risk of losing those dollars.
  • 03The wallet remains non-custodial: the agent can spend within scoped limits but cannot withdraw funds to itself or change owner-approved addresses.
  • 04Paper trading lets you test the full pipeline, including kill switches and exit plans, before the agent ever touches real capital.
  • 05A panic switch flattens positions and revokes the agent's key in one action, because automated trading can lose money quickly and human override must remain instant.

You can run a live trading agent from Claude by connecting the assistant to Felix through the Model Context Protocol, which lets Claude read balances, place dollar-sized orders, and manage positions across stocks, crypto, perpetual futures, options, and prediction markets from a single chat session. The setup takes roughly an hour if you already have a wallet and a clear risk budget. Before the agent touches real capital, you configure scoped keys, budget caps, and a panic switch that flattens positions and revokes access instantly. This walkthrough assumes you are using Claude in 2026 with MCP support enabled and that you understand trading can lose money, including the full amount you allocate.

What do you need before you start?

You need three things: a wallet you control, a Felix API key scoped to trading only, and a written risk policy. The wallet holds your funds non-custodialy; the agent never takes possession of the seed phrase or withdrawal rights. The risk policy is not code. It is a short document that states your maximum daily loss, your largest single position, and the conditions under which you will shut the agent down. Writing this down before you open the MCP connection prevents you from rationalizing larger limits in the moment. If you have not built an LLM trading agent before, read the practical checklist for building your first LLM-powered trading agent before proceeding.

  • ·A wallet with funds you are willing to lose entirely.
  • ·A Felix account with paper trading enabled.
  • ·A scoped API key with trade permissions but no withdrawal permissions.
  • ·A risk policy stating daily budget, per-position cap, and kill criteria.
  • ·Claude Desktop or an MCP-compatible client with tool use enabled.

How do you connect Claude to the trading API?

Claude does not call REST endpoints directly. Instead, it discovers tools exposed by an MCP server that wraps the Felix API. When you paste a market prompt into the chat, Claude decides whether to invoke a tool such as balance retrieval, order placement, or position flattening. The MCP server translates Claude's structured request into the appropriate API call and returns the result in natural language. You install the server by adding its configuration to your Claude Desktop settings and restarting the client. The server runs locally on your machine, which means your API key never leaves your environment. This local architecture is central to the non-custodial design. Even if Felix servers are compromised, your key is not stored on them.

The exact request schema is in the docs; the shape looks like this.

{
  "mcp_server": {
    "provider": "felix",
    "auth": {
      "api_key": "YOUR_KEY"
    },
    "mode": "paper"
  }
}

Once the server is running, Claude lists the available tools in the chat panel. You can ask it to check your balance, fetch a price, or place an order. Because the API normalizes venue-specific contract math, you state order sizes in plain US dollars. If you say "buy two hundred dollars of a crypto asset," the MCP server translates that into the correct number of contracts or shares at the destination venue. You do not need to calculate lot sizes, margin tiers, or tick values. This simplifies prompts but does not remove risk. A two hundred dollar order can still lose two hundred dollars, and leverage on perpetual futures can magnify losses beyond the initial dollar amount if your exit plan fails.

How do you keep the agent inside hard limits?

Safety is not an afterthought; it is the first layer of the connection. Felix uses scoped keys, which means the key you paste into the MCP config can be restricted to specific markets, specific order types, and a maximum daily spend. Even if Claude hallucinates a command or an attacker compromises your local machine, the key itself cannot exceed the scope you defined. You set these limits in the Felix dashboard before generating the key. The wallet remains non-custodial, meaning the agent can initiate trades but cannot withdraw funds to an address you have not pre-approved. If you want to understand how this works without giving up custody, see how to secure an AI trading agent without giving up custody.

  • ·Budget cap: the maximum US dollars the agent can deploy in a day.
  • ·Position limit: the maximum notional size of any single position.
  • ·Market scope: only stocks and crypto, or only prediction markets, depending on your key.
  • ·Exit plan: automated take-profit and stop-loss rules that trigger without further LLM reasoning.
  • ·Panic switch: a one-click flatten and revoke that cancels open orders, closes positions, and disables the key.

Exit plans deserve special attention because they execute at the API level, not inside Claude's reasoning loop. If the market moves against you while Claude is offline or processing a long thought chain, the exit plan still fires. You configure these rules when you authorize the key for live trading. They are independent of the chat session, so a network disconnect between your machine and Claude does not disable your downside protection. For a detailed checklist on setting these up, review how to automate exit plans and take-profit rules for an AI trading agent.

What does the first trading session look like?

Start in paper trading mode. The MCP server supports a paper flag that routes every order to a simulated ledger with real market data. Run the agent for at least several sessions, including volatile periods, to see whether it respects your budget caps and exit plans. Paper trading is not a guarantee of future performance, but it proves the integration works and that your kill switch responds instantly. Only after you observe consistent behavior should you authorize the key for live trading. Many users skip this step because paper trading feels slow, but it is the only way to verify that your guardrails are actually connected.

  1. 01Open Claude and confirm the Felix tool set is visible in the tool panel.
  2. 02Ask Claude to report your current balance and any open positions.
  3. 03Issue a small paper order, for example a ten dollar buy order on a stock or crypto pair.
  4. 04Verify that the order appears in the Felix dashboard with the correct dollar amount and timestamp.
  5. 05Trigger your exit plan manually to confirm it closes the position at the API level.
  6. 06Toggle the key to live mode and repeat with capital you are prepared to lose entirely.

During the first live session, keep the total allocation small. The goal is not profit; it is to confirm that the full loop, from prompt to order to settlement, behaves as expected. Remember that trading can lose money, and an agent can make mistakes or encounter slippage just as a human can. If you are new to automated risk, read how does risk management work for a first-time trading agent before increasing size. It is better to discover a misconfigured limit with ten dollars than with ten thousand.

How do you monitor and stop the agent?

An active agent requires continuous oversight, even if the oversight is passive. The Felix dashboard shows real-time position states, open orders, and remaining budget for the scoped key. You should keep this dashboard visible in a separate window while the agent runs. Audit logs record every tool invocation, including the raw request from Claude and the API response, so you can reconstruct exactly why a trade occurred. If you see unexpected behavior, you have two options. The first is the conversational kill switch: tell Claude to flatten all positions and revoke the key. The second is the dashboard panic switch, which bypasses the LLM entirely and disables the key at the API level. Both actions take effect immediately, though the dashboard switch is more reliable if Claude is in a hung state.

Monitoring also means reviewing Claude's reasoning traces. In 2026, Claude's extended thinking mode may produce long chains of analysis before calling a tool. Read these traces periodically to ensure the agent is interpreting your prompts correctly. A poorly phrased prompt can lead to unintended orders, and the API cannot distinguish between a deliberate strategy and a misunderstood instruction. Prompt engineering is your responsibility, not the model's. If you are unsure whether your prompts are safe, consider whether an AI should write them at all. The article should an AI write the prompts for your trading agent explores this tension in depth.

When should you turn the agent off?

You should turn the agent off when any of your pre-written kill criteria are met. Common criteria include hitting your daily budget cap, encountering a market halt, observing three consecutive failed orders, or simply reaching the end of your designated trading window. Do not let the agent run indefinitely without a scheduled review. Automation magnifies both good and bad decisions, and an agent left unsupervised can accumulate hidden risks through stale positions or expired exit plans. If you stop the session, revoke the scoped key in the dashboard rather than just closing Claude. Closing the chat window does not cancel open orders or prevent the exit plan from firing. The key remains active until you explicitly disable it.

Running a trading agent from Claude in 2026 is technically straightforward because the MCP layer handles authentication, normalization, and schema translation. The difficult part is risk management: defining limits, testing them in paper mode, and enforcing them without exception. The technology is ready. The question is whether your policy is.

Frequently asked questions

Does Claude hold my funds?

No. Claude only invokes tools. Your funds remain in a wallet you control. The scoped API key allows trading within limits but does not allow withdrawals to unapproved addresses.

Can I use this with any market?

Your scoped key determines which markets are accessible. A single key can cover stocks, crypto, perpetual futures, options, and prediction markets, or you can restrict it to just one.

What happens if Claude makes a mistake?

The API enforces hard limits regardless of the LLM's intent. Budget caps, position limits, and exit plans act as guardrails. You can also flatten positions instantly with the panic switch.

Do I need to write code?

No. The MCP server handles the integration. You configure it, set environment variables, and interact with Claude in natural language. Developer knowledge helps but is not required to start.

How is paper trading different from live?

Paper trading uses real market data but simulated funds. It lets you test prompts, limits, and kill switches without risking capital. Live trading uses real money and can lose it.

Can the agent run while I am away?

It can, but you should not leave it unsupervised for long periods. Exit plans run autonomously, but market conditions, prompt drift, and system issues require periodic human review.

Give your agent a key.

One key to trade stocks, crypto, perps, options, and prediction markets. Live after owner authorization.

Keep reading

Not a brokerage, exchange, or investment adviser. Not investment advice. Trading involves risk, including total loss.