How to Deploy Alpaca’s MCP Server Remotely On Claude Mobile App
Source: Dev.to
Overview
The launch of Alpaca’s official MCP Server lets Large Language Model (LLM) clients—such as Cursor, ChatGPT, and Claude—research, analyze, and place orders via natural language or code.
This guide shows how to connect the Model Context Protocol (MCP) server to the Claude Mobile App, with a transparent‑execution flow and an optional “code‑free” path that can later be expanded into full automation.
Prerequisites
| Tool | Details |
|---|---|
| Alpaca API keys | Paper or live‑trading access (optional). See “How to Get Alpaca’s Trading API Key and Start Connect” or “How to Start Paper Trading with Alpaca”. |
| Python | Version 3.10+ |
| Docker | Docker Hub account |
| GitHub | Account for cloning the repo |
| uv | Install via the official guide |
| AI tool (MCP client) | Paid subscription preferred (example uses Claude Pro) |
| Terminal | macOS/Linux or Command Prompt / PowerShell (Windows) |
| Cloud service | AWS, Azure, GCP, Render, etc. (example uses Render) |
What You Can Do
- Retrieve Alpaca account details, portfolio positions, unrealized P&L, market data, and company news.
- Analyze market trends, earnings highlights, and price movements with AI‑assisted reasoning.
- Build & refine trading algorithms in a single, connected workflow.
- Automate repetitive tasks via an AI‑powered CLI (e.g., Claude Code, Gemini CLI).
- Place trades through natural language or programmatically using Alpaca’s Trading API.
Quick Setup Flow
- Install Alpaca’s MCP Server locally and build a Docker image.
- Deploy the Docker image to a cloud service (Render in this guide).
- Connect the remote MCP server to Claude AI (web & mobile).
Each step is detailed below.
1️⃣ Install & Containerize the MCP Server
# Clone the repo
git clone https://github.com/alpacahq/alpaca-mcp-server.git
cd alpaca-mcp-server
Verify Docker Installation
docker version
docker info
Log in to Docker Hub
docker login
# Prompted for Docker Hub username & password
Build & Push the Image
Replace username and custom-docker-image-name with your Docker Hub username and desired image name.
docker buildx build \
--pull \
--platform=linux/amd64 \
-t username/custom-docker-image-name:v1.0.1 \
. \
--push
The tag latest can be used instead of v1.0.1 if you prefer.
Sanity‑Check Locally
docker run --rm -p 8000:8000 \
-e PORT=8000 \
username/custom-docker-image-name:latest \
python -m alpaca_mcp_server.server \
--transport streamable-http \
--host 0.0.0.0 \
--port 8000
You should see output similar to:
INFO: Started server process [1]
INFO: Waiting for application startup.
StreamableHTTP session manager started
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
2️⃣ Deploy the Image to a Cloud Service (Render)
You can use any cloud platform that runs Docker containers; the steps below are for Render.
-
Create a new project on Render’s dashboard.
-
Click “Create new service” → “Web Service”.
-
Choose “Existing Images” and paste the Docker image URL, e.g.:
docker.io/username/custom-docker-image-name:latest -
Select an instance size (Free tier works for this tutorial).
-
Add environment variables required by the MCP server:
Variable Value ALPACA_API_KEYYour Alpaca API key ALPACA_SECRET_KEYYour Alpaca secret key -
In Advanced Settings, set the Docker Command to start the server:
alpaca-mcp-server serve \ --transport streamable-http \ --host 0.0.0.0 \ --port $PORT -
Click “Deploy Web Service”.
After deployment, Render will display logs with a URL similar to:
https://alpaca-mcp-server-v1-0-3latest.onrender.com
3️⃣ Connect the Remote MCP Server to Claude
Add a Custom Connector (Claude Web)
-
Open the Claude web interface.
-
Go to Manage Connectors → Add Custom Connector.
-
Fill in:
-
Connector name:
Alpaca’s MCP Server(or any name you like) -
Remote MCP Server URL:
https://alpaca-mcp-server-v1-0-3latest.onrender.com/mcp
Make sure the URL ends with
/mcp. -
-
Save. You should now see the connector listed as connected.
Verify on Claude Mobile
- Open the Claude mobile app.
- In the chat screen, tap the plus (+) icon next to the message box.
- Scroll down and select Manage Connectors.
- Verify that Alpaca’s MCP Server appears and is enabled.
You’re now ready to issue natural‑language commands (e.g., “Show my portfolio”, “Buy 10 shares of AAPL”) and have Claude route them through the remote MCP server to Alpaca’s Trading API.
🎉 You’re All Set!
You have:
- Containerized Alpaca’s MCP Server.
- Deployed it as a remote service.
- Integrated it with Claude (web & mobile).
From here you can start building AI‑driven trading workflows, automate repetitive tasks, or experiment with fully programmatic strategies—all via natural language or code. Happy trading!
Getting Started with Alpaca’s MCP Server in Claude’s Mobile App
-
Locate the connector
- Open the Connectors list in the Claude mobile app.
- Find Alpaca’s MCP Server under Custom Connectors.
- Tap it to enable and start using it.
-
Confirm the connection
- Verify that Alpaca’s MCP server is connected to the Claude app.
- You’re now ready to leverage AI‑driven trading via the Alpaca Trading API.
Security Considerations for Remote MCP Servers
Running an MCP server publicly introduces several security risks:
- Unauthenticated access – Many early‑stage examples (e.g., FastMCP) are built for local testing and lack authentication or encryption.
- Exposure of credentials – If the server stores Alpaca API keys, anyone who can reach the endpoint could potentially misuse them.
Recommended Safeguards
| Issue | Mitigation |
|---|---|
| Plain‑text traffic | Deploy HTTPS/TLS to encrypt all communication. |
| Unauthenticated requests | Implement a token‑based authentication (e.g., JWT, API keys). |
| Open network exposure | Restrict inbound traffic with firewalls or VPNs, and use IP allow‑lists where possible. |
Taking these steps protects your credentials and ensures that only trusted clients can interact with your MCP server.
Try It Yourself
- Explore the GitHub repository for a ready‑to‑run MCP server implementation.
- Sign up for an Alpaca account if you haven’t already and start paper trading.
Helpful Resources
- Alpaca‑py SDK Documentation – Comprehensive guide to the Python SDK.
- Sign up for an Alpaca Trading API account – Alpaca Registration
- How to Connect to Alpaca’s Trading API – Step‑by‑step connection tutorial.
- How to Start Paper Trading with Alpaca’s Trading API – Learn to test strategies risk‑free.
- Build an MCP‑Based Trading Workflow with Claude and Google Sheets – Automation example.
- Vibe Coding: Build Options Trading Algorithms with Alpaca’s MCP Server & Cursor AI – Video walkthrough.
- API Reference Documentation: About Trading API – Full endpoint reference.
Additional Media
- Alpaca’s MCP Server YouTube Playlist – Curated videos covering setup, security, and advanced use cases.
Tip: Share your experiences, questions, and feedback on our forum, Slack community, or subreddit. Your insights help improve the ecosystem for everyone interested in algorithmic trading with Alpaca’s Trading API.