Alpaca MCP server for AI agents

Live

API KEY

BROKERAGE TRADING

Accounting & Finance

Alpaca gives your agent brokerage access in your Alpaca account: read the account, positions, orders, and portfolio history, pull stock bars, quotes, snapshots, and news, manage watchlists, and place, replace, and cancel orders.

  • Per-user credentials: each call uses the actual user's API key, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Alpaca
agent · Acme Q3
Run
What positions do I hold right now?
S
alpaca_positions_list
137ms
Brokerage agent
You hold 4 open positions: AAPL, MSFT, NVDA, and SPY. The tool returned quantity, side, and market value for each.
Sources: Alpaca positions, 1 account
alpaca
4 positions
18:29
Message Claude...

Tools your brokerage agent reaches for on Alpaca, scoped per user.

CALL ANY TOOL
30 tools for trading in Alpaca: read the account, positions, orders, and portfolio history, pull stock bars, quotes, and news, manage watchlists, and place, replace, and cancel orders.
alpaca_account_activities_list
List account activities
List account activities such as order fills, dividends, fees, interest and cash transfers, newest first. Returns an array of activities with id, activity_type, date or transaction_time, symbol, qty, price, net_amount and order_id. Use this to reconcile trades and cash movements. Use alpaca_orders_list for order status and alpaca_portfolio_history_get for equity over time.
Parameters
Name
Type
Required
Description
activity_types
string
Optional
Comma-separated activity types to include, such as FILL (order fills), DIV (dividends), TRANS (cash transactions), FEE, INT (interest), JNLC (cash journals) or CSD (cash deposits). Cannot be used with category. Example: FILL,DIV
after
string
Optional
Only return activities created after this time. Format YYYY-MM-DD or RFC 3339. Example: 2026-10-01T00:00:00Z
category
string
Optional
Activity category: trade_activity (fills) or non_trade_activity (cash, dividends, fees and other entries). Cannot be used with activity_types. Example: trade_activity. One of: `trade_activity`, `non_trade_activity`.
date
string
Optional
Only return activities created on this date (creation date, not settlement date). Format YYYY-MM-DD or RFC 3339. Example: 2026-11-02
direction
string
Optional
Sort order by activity time: asc or desc. Default: desc. Example: desc. One of: `asc`, `desc`.
order_id
string
Optional
Only return activities for this order ID, for example the fills that make up an order. Example: 61e69015-8549-4bfd-b9c3-01e75843f47d
page_size
integer
Optional
Maximum activities to return, 1 to 100. Default: 100. Example: 50
page_token
string
Optional
Pagination token: the ID of the last activity on the previous page. Example: 20261102093000000::8e2b3c3f-6a37-4c6f-9d1c-0d9b5c9a1f00
until
string
Optional
Only return activities created before this time. Format YYYY-MM-DD or RFC 3339. Example: 2026-11-01T00:00:00Z
alpaca_account_configurations_get
Get account configurations
alpaca_account_get
Get account
alpaca_asset_get
Get asset
alpaca_assets_list
List assets
alpaca_calendar_get
Get calendar
alpaca_clock_get
Get clock
alpaca_news_list
List news
alpaca_option_contracts_list
List option contracts
alpaca_order_cancel
Cancel order
alpaca_order_create
Create order
alpaca_order_get
Get order
alpaca_order_replace
Order replace
alpaca_orders_cancel_all
Orders cancel all
alpaca_orders_list
List orders
alpaca_portfolio_history_get
Get portfolio history
alpaca_position_close
Close position
alpaca_position_get
Get position
alpaca_positions_close_all
Positions close all
alpaca_positions_list
List positions
alpaca_stock_bars_get
Get stock bars
alpaca_stock_latest_quotes_get
Get stock latest quotes
alpaca_stock_snapshots_get
Get stock snapshots
alpaca_watchlist_asset_add
Add watchlist asset
alpaca_watchlist_asset_remove
Remove watchlist asset
alpaca_watchlist_create
Create watchlist
alpaca_watchlist_delete
Delete watchlist
alpaca_watchlist_get
Get watchlist
alpaca_watchlist_update
Update watchlist
alpaca_watchlists_list
List watchlists
Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Alpaca tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["alpaca"], toolNames: [
    "alpaca_positions_list",
    "alpaca_stock_latest_quotes_get",
    "alpaca_orders_list"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "List my open positions, get the latest quotes for those symbols, and show my open orders" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["alpaca"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "List my open positions, get the latest quotes for those symbols, and show my open orders" }],
  tools,
});

// Execute the tool call with the user's vaulted Alpaca API key
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["alpaca"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "List my open positions, get the latest quotes for those symbols, and show my open orders" }],
  tools,
});

// Tool call runs with the user's vaulted Alpaca API key
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["alpaca"] }, pageSize: 100,
});

const agent = new Agent({
  name: "brokerage_agent",
  model: "gemini-2.5-pro",
  instruction: "Alpaca tools scoped to this user",
  tools,
});

await agent.run("List my open positions, get the latest quotes for those symbols, and show my open orders");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Alpaca tool. Click to copy, paste into your agent, done.
Account and positions
Copy the prompt
Copied
Show my account and trading configuration.
Copy the prompt
Copied
List all my open positions.
Copy the prompt
Copied
Show my equity and profit and loss over the last month.
Market data
Copy the prompt
Copied
Get the latest bid and ask for these 3 symbols.
Copy the prompt
Copied
Show daily price bars for this symbol over the last 30 days.
Copy the prompt
Copied
List the latest news articles for this symbol.
Orders and watchlists
Copy the prompt
Copied
List my open orders.
Copy the prompt
Copied
Place a limit order for this symbol at this price.
Copy the prompt
Copied
Create a watchlist with these symbols.
SEE HOW AUTH WORKS
Each user connects their own Alpaca API key ID and secret key once, and Scalekit sends them with every call. Keys stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
Alpaca
once. We tie it to their identity and the access they approved, with no shared bot account and no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Alpaca
credential lives in a vault scoped to them. User A's data is never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tenants:
isolated
3
Resolve
When your agent calls a
Alpaca
tool, we fetch the right credential server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Alpaca
tool call is logged: who triggered it, which tool ran, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other accounting and finance connectors.
GTM and RevOps Teams
Revenue forecast commentary
Pulls open pipeline from Salesforce and HubSpot, calculates coverage against quota, flags at-risk stages, posts commentary to Slack, and logs every snapshot to Google Sheets.
GTM and RevOps Teams
Competitive intelligence briefing agent
Scans Gong calls for competitor mentions, matches each one to its Notion battlecard, and DMs every affected rep a single Slack digest per cycle. Every call runs as the PMM who owns the briefing, never a shared bot.
Test other agents
See the same per-user auth pattern across other accounting and finance connectors.
GTM
Revenue forecast agent
Score pipeline coverage against quota across Salesforce and HubSpot, post forecast commentary to Slack, log snapshots to Sheets.
GTM
Competitive intelligence briefing agent
Scan Gong calls for competitor mentions, match each one to its Notion battlecard, and DM every affected rep a single Slack digest.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared key for Alpaca looks fine in a demo. In production every order looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared key
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Alpaca today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Alpaca as the user or through a shared key?
As the user. Each user connects their own Alpaca API key ID and secret key once, and Scalekit sends them with every call. Audit logs attribute every order and watchlist change to that user, not a shared service account.
Where is the Alpaca API key stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. To rotate them, the user reconnects with a new API key ID and secret key. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in Alpaca?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the read and market data tools without alpaca_order_create, alpaca_orders_cancel_all, alpaca_position_close, or alpaca_positions_close_all. Scalekit also enforces scope checks before every API call.
What happens when a user revokes Alpaca access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
Can the agent place orders?
Yes. alpaca_order_create places stock, option, or crypto orders, alpaca_order_replace changes an open order, and alpaca_order_cancel cancels one. Leave those tools out of listScopedTools for a research agent that should only read.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""alpaca"": {
""url"": ""https://mcp.scalekit.com/alpaca"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.alpaca]
url = ""https://mcp.scalekit.com/alpaca""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""alpaca"": {
""url"": ""https://mcp.scalekit.com/alpaca"",
""type"": ""http""
}
}
}