Guide / Checked Nov 2026
How do I build an AI trading agent with Claude?
Split the work. Claude decides and Nyria places. Create a strategy with AI Agent (MCP) as the alert source, deploy a paper bot on Nyria Paper, and connect Claude as a custom connector or with Claude Code. Claude sends an alert such as buy AAPL; the bot places the order and sets the size. Preview before anything goes out, read back orders and positions, and script read-only runs with claude -p until you trust it.
Official documentation
Build the agent in six steps
- 1
Create the strategy
Select Create strategy and choose AI Agent (MCP) as the alert source. Open the Integration tab and select Show URL. The URL ends in a 64-character token that works for this one strategy.
- 2
Deploy a paper bot
Select Deploy bot and pick Nyria Paper. Set Budget per entry. That setting, not Claude, decides how much each entry buys. Nyria Paper is free on every plan.
- 3
Connect Claude
In Claude, go to Customize, then Connectors, and add a custom connector with the strategy URL and No sign in. In Claude Code, run the claude mcp add command below.
- 4
Set the send tool to Needs approval
Open the connector's Tool permissions. Leave the read tools on Always allow and set nyria_send_alert to Needs approval, so Claude asks before an alert reaches a bot.
- 5
Preview, then send one
Ask Claude to list your bots, then preview the alert buy AAPL. A preview places nothing. When the parse reads right, let it send a single alert and open the strategy's Logs tab.
- 6
Read back, then script it
Ask Claude for recent orders and open positions after each send. Once the log looks clean, run it with claude -p and only read tools allowed, on a strategy with paper bots only, and check the Logs tab shows no sent alert.
Commands to copy
Connect Claude Code
claude mcp add --transport http nyria https://api.nyria.io/mcp --header "Authorization: Bearer YOUR_TOKEN"
YOUR_TOKEN is the token from Show URL. Keep it out of git.
A read-only scripted run
claude -p "List my bots, then read my open positions and recent orders. Send nothing." \ --allowedTools "mcp__nyria__nyria_list_bots,mcp__nyria__nyria_positions,mcp__nyria__nyria_recent_orders,mcp__nyria__nyria_strategy_info"
nyria_send_alert isn't on the list, so a default run denies the send. A permissions allow rule or a mode that auto-approves would change that, so use a paper-only strategy for the first runs. Leave --bare off; it skips MCP servers. Exit code 0 means success.
What Claude can and can't do
- Claude names the trade and the side. The bot sets size from Budget per entry.
- Eight tools in all. One sends and seven read. No tool creates bots, changes settings or rotates the token.
- Allowed instruments, trading window and direction rules still apply to Claude's alerts.
- Sending the same alert twice in a row sends it once. Change the wording to scale in. Bursts are refused; send a steady stream.
- Live bots place market and limit orders. Nyria attaches no stop order to a live entry.
Before a live bot
- Read the Logs tab on the strategy and on the bot after every session.
- Test any JSON alert text in the alert tester before Claude uses it.
- Rotate token on the Integration tab cuts Claude off at once.
Questions
- Which Claude plans can add Nyria?
- Anthropic lists custom connectors for Free, Pro, Max, Ultra, Team and Enterprise. Free users get one custom connector. On Team, only Owners add them.
- Does Claude Code need the connector too?
- No. Claude Code adds the server with claude mcp add and a bearer header. The same token works in both, and both reach the same strategy.
- Can Claude run on a schedule and trade by itself?
- claude -p runs it from any scheduler you set up. A run needing approval is denied unless something approves it, so keep nyria_send_alert off the allowed list and the strategy on paper bots until the read-only runs look right.
- What if Claude sends a wrong alert?
- An agent can send a wrong or duplicate alert. A paper bot only simulates it. On a live bot, close the position at your broker if you need to be flat now, then rotate the token.
Next
- Paste an alert into the alert tester to see how Nyria reads it.
- Step by step for one account: how to automate Webhook to Alpaca.
- Step by step for one account: how to automate Webhook to Schwab.
Guides
How do I connect Claude to Nyria through MCP?
A custom connector with your strategy's MCP URL, or one Claude Code command.
Read guideHow do I connect Claude or ChatGPT to my broker?
Claude or ChatGPT sends the alert over MCP, and a Nyria bot places the order at your broker.
Read guideCan an AI agent read my positions and orders?
Seven read tools list positions, orders and status as plain text.
Read guideHow do I test an AI trading agent on paper?
Forward test each model on its own paper strategy, same settings, written pass rule.
Read guideTry a paper bot first
No card required. Paper is free. Live trading from $15 a month.