- Alpaca MCP Server
Content
Alpaca MCP Server
A Model Context Protocol (MCP) server that provides real-time access to cryptocurrency market data through the Alpaca API. This server implements a standardized interface for retrieving cryptocurrency data.
Features
- Daily, weekly, and monthly cryptocurrency time series data
- Latest crypto exchange rates
- Historical bar/candle data
- Built-in error handling and rate limit management
Installation
Using Claude Desktop
Installing via Docker
- Clone the repository and build a local image to be utilized by your Claude desktop client
cd alpaca-mcp
docker build -t mcp/alpaca .
- Change your
claude_desktop_config.jsonto match the following, replacingREPLACE_API_KEYandREPLACE_API_SECRETwith your actual keys:
claude_desktop_config.jsonpath
- On MacOS:
~/Library/Application\ Support/Claude/claude_desktop_config.json- On Windows:
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"alpaca": {
"command": "docker",
"args": [
"run",
"-i",
"-e",
"ALPACA_API_KEY",
"-e",
"ALPACA_API_SECRET",
"mcp/alpaca"
],
"env": {
"ALPACA_API_KEY": "REPLACE_API_KEY",
"ALPACA_API_SECRET": "REPLACE_API_SECRET"
}
}
}
}
Installing via UV (Fast Python Package Installer)
UV is a modern Python package installer that can simplify the installation process. To use UV with alpaca-mcp:
- First, install UV if you don't have it already:
# Using pip
pip install uv
# Using brew on macOS
brew install uv
- Configure your Claude Desktop config file to use UV:
{
"mcpServers": {
"alpaca": {
"command": "uv",
"args": [
"--directory",
"/path/to/alpaca-mcp",
"run",
"alpaca-mcp"
],
"env": {
"ALPACA_API_KEY": "REPLACE_API_KEY",
"ALPACA_API_SECRET": "REPLACE_API_SECRET"
}
}
}
}
- Install the package with UV:
# Clone the repository
git clone https://github.com/berlinbra/alpaca-mcp.git
cd alpaca-mcp
# Install dependencies using UV
uv pip install -e .
- Run the server using UV:
uv run alpaca_mcp/server.py
- For debugging purposes, you can use the MCP inspector:
npx @modelcontextprotocol/inspector uv --directory /path/to/alpaca-mcp run src/alpaca_mcp/server.py
Standard Development Setup
# Clone the repository
git clone https://github.com/berlinbra/alpaca-mcp.git
cd alpaca-mcp
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install the package in development mode
pip install -e .
Available Tools
Currently, the server implements the following tool:
get-crypto-bars: Get historical bar/candle data for cryptocurrencies
More tools will be added in the future.
get-crypto-bars
Input Schema:
{
"symbol": {
"type": "string",
"description": "Cryptocurrency symbol (e.g., BTC/USD, ETH/USD)"
},
"timeframe": {
"type": "string",
"description": "Timeframe for bars (e.g., 1Day, 1Hour, 1Min)",
"default": "1Day"
},
"start": {
"type": "string",
"description": "Start date in YYYY-MM-DD format"
},
"limit": {
"type": "integer",
"description": "Maximum number of bars to return",
"default": 10
}
}
Example Response:
Cryptocurrency bars for BTC/USD (1Day):
Date: 2025-04-10
Open: $68750.12
High: $69200.45
Low: $67900.78
Close: $68900.32
Volume: 12345.67
---
Date: 2025-04-11
Open: $68900.32
High: $70100.55
Low: $68400.21
Close: $69800.44
Volume: 15678.90
Error Handling
The server includes comprehensive error handling for various scenarios:
- Rate limit exceeded
- Invalid API key
- Network connectivity issues
- Timeout handling
- Malformed responses
Error messages are returned in a clear, human-readable format.
Prerequisites
- Python 3.12 or higher
- httpx
- mcp
- alpaca-py
- python-dotenv (for loading environment variables)
License
This MCP server is licensed under the MIT License.
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
WindsurfThe new purpose-built IDE to harness magic
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
CursorThe AI Code Editor
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Playwright McpPlaywright MCP server
ChatWiseThe second fastest AI chatbot™
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题;
Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Serper MCP ServerA Serper MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop
Tavily Mcp
Amap Maps高德地图官方 MCP Server