Skip to content
Alpaca logo

Alerts to orders

Automate AI agent alerts to Alpaca

Nyria lets an AI agent trade your Alpaca account over MCP.

Stocks and ETFsOptions up to 4 legsCrypto spot
My strategies, then Create strategy: a strategy name typed in, AI Agent (MCP) picked as its alert source, then Next to what it trades, where Stocks is picked

Setup steps

Add a Nyria strategy's MCP server URL to Claude or Cursor. Then connect your Alpaca account in Nyria with an API key. Each agent alert becomes an order in your own Alpaca account. Test it free on Nyria Paper or on an Alpaca paper account first.

  1. 1Connect Alpaca. In the Alpaca dashboard, switch to Paper or Live and select Generate New Keys. Copy the API key ID and the Secret key. Alpaca shows the secret once. In Nyria, open Integrations and select the Alpaca card. Select Connect paper account or Connect live account, then Accept and continue. Paste both values.
  2. 2Create an AI Agent strategy. In Nyria, select Create strategy and pick AI Agent (MCP) as the alert source. Choose stocks, options or crypto as the asset type, then select Create draft. On the Integration tab's Alert format card, select Check format. Once every example passes, the strategy turns Active and can take a bot.
  3. 3Connect your AI agent. Select Show URL and copy the MCP server URL. In Claude, add it as a custom connector and choose No sign in. Cursor reads it from mcp.json. ChatGPT connects it on Business, Enterprise and Edu plans. On Business, an admin or owner adds it. Keep it private, because the token inside is the key.
  4. 4Preview, then test on paper. Ask the agent to preview an alert, such as OPEN AAPL LONG. A preview shows how Nyria reads it and places nothing. Send real alerts to a Nyria Paper bot before a live one. The Logs tab shows every alert the agent sends.
  5. 5Deploy a bot. On the strategy, select Deploy bot. Pick the Alpaca account on the Account step and set a Budget per entry. Live bots need a Nyria Pro plan or a Premium strategy you have bought. The next alert becomes an order.

What an AI agent alert must say

Nyria needs the ticker, the side, and whether it opens or closes a position. It reads plain text or JSON in your own wording. There is no template to follow. For options, Provided in alert reads the strike, expiry and call or put. From my rules picks the contract.

Your agent sends each alert as one message, in plain text or JSON. A clear format, such as OPEN SPY LONG, is read directly. Other wording goes to an AI model, so have the agent preview it first.

An alert cannot set the size: each bot's budget per entry does. Exits come from your exit alerts.

A stock entry

OPEN NVDA LONG

Buy NVDA. The alert carries no size. Each bot sizes it from its own settings.

An exit

CLOSE NVDA LONG

Close the NVDA position, matched against what the bot is holding.

What Alpaca does with it

Alpaca connects with an API key, not a sign-in. A paper key works only on paper and a live key only on live. The same strategy can run on both.

Options go to Alpaca as single legs or spreads up to 4 legs. A spread is one order. Options trading must be turned on in the Alpaca account. Alpaca paper reaches Options Level 3, which covers four-leg structures.

Alpaca trades crypto spot in the pairs it lists. A crypto alert can open and close a coin position. Crypto orders go to Alpaca as good till canceled.

Each alert becomes a market or a limit order, as the strategy sets it. Duration is Day, GTC or fill or kill. Options orders go as Day. Crypto orders go as GTC. On live accounts, stops and targets are exit alerts. Alpaca paper takes stop, trailing stop, bracket and OCO orders on stocks and ETFs. Trailing stops need a trail of 0.1% or more. Alpaca paper takes stop-limit orders and percent-of-account sizing on spot crypto. An exit alert can flatten a position. A bots list in the alert picks which bots trade.

Questions

Can an AI agent trade my Alpaca account?
Yes, over Nyria's MCP server. An agent such as Claude or Cursor sends alerts to a Nyria strategy. A bot on your Alpaca account places each one as a real order.
Does Alpaca have its own MCP server?
Yes, Alpaca's official MCP server trades with your API key and secret. On Nyria, the agent's alerts go to a strategy, and each bot sets the size.
How do I cut the agent off?
Select Rotate token on the strategy's Integration tab and confirm. The old URL stops working at once. Then paste the new URL into any client you still use.
How does Nyria store my Alpaca key?
The key is stored encrypted at rest. It reads the account and places and cancels orders. Revoke it in the Alpaca dashboard any time.
Can I test before trading real money at Alpaca?
An Alpaca paper account connects the same way as a live one. The same strategy can run on both, each bot in its own size.
How fast does an alert become an order?
Sub-second, alert to order.

From the sources

Next

AI agent alerts, by account

Alpaca orders, by alert source

Send your first AI agent alert

Trade and test free on paper. No card required.