MCP Server
Connect AI assistants to Cotrader's stock screening, pattern detection, and market data via the Model Context Protocol.
1. What is MCP?
The Model Context Protocol (MCP) is an open standard that lets AI assistants call external tools. Cotrader's MCP server gives your AI assistant direct access to stock screening, chart pattern detection, and market data — so you can ask questions in plain English and get real-time results without leaving your AI workflow.
With the Cotrader MCP server connected, you can ask your AI assistant things like:
- • "Find stocks with RSI under 30 that are above their 200-day moving average"
- • "Detect chart patterns on AAPL and tell me about support/resistance levels"
- • "Scan the market for stocks forming double bottom patterns"
- • "Show me the last 90 days of price data for NVDA"
2. Available Tools
The Cotrader MCP server exposes five tools that your AI assistant can call:
screen_stocksScreen stocks using natural language queries. Supports 35+ technical indicators, 20+ fundamental metrics, and chart pattern filters (trendlines, support/resistance, MACD divergence, and more).
Parameters:
query (string, required) Natural language screening query
maxResults (int, default 50) Maximum results to returndetect_patternsDetect chart patterns for a specific stock. Returns support/resistance levels, trendlines, channels, double/triple bottoms, pennants, head & shoulders, and MACD divergences.
Parameters:
symbol (string, required) Ticker symbol (e.g., "AAPL")
patternTypes (string, optional) Comma-separated types to detect (omit for all)
days (int, default 90) Lookback period in trading daysPattern types:
horizontal_levels
rising_trendline
descending_trendline
channel
multi_bottom
pennant
head_shoulders
macd_divergencescan_patternsScan the entire stock universe for a specific chart pattern. Returns top matches ranked by pattern strength.
Parameters:
patternType (string, required) Pattern type to scan for
topN (int, default 20) Number of top matches
days (int, default 200) Lookback period in trading dayssearch_symbolsSearch for stock ticker symbols by name or symbol prefix.
Parameters:
query (string, required) Search term (e.g., "AAPL" or "Apple")
limit (int, default 10) Maximum results (1-50)get_stock_barsGet historical daily OHLCV price bars for a stock symbol.
Parameters:
symbol (string, required) Ticker symbol (e.g., "MSFT")
days (int, default 90) Trading days of history (max 365)3. Setup: Claude Desktop
Add Cotrader as a connector in Claude Desktop using the built-in UI.
- 1. Open Claude Desktop → Settings → Connectors → Add custom connector
- 2.
Set the Name to
Cotrader - 3. Set the URL to:
- 4. Click Add and restart Claude Desktop.
Note:
Replace YOUR_API_KEY with your actual API key from the
API Keys page. The connection is over HTTPS so your key is encrypted in transit.
4. Setup: Claude Code / VS Code / Cursor
Claude Code (CLI)
Add the Cotrader MCP server with a single command:
claude mcp add cotrader \
--transport http \
--url https://api.getcotrader.com/mcp \
--header "X-API-Key: YOUR_API_KEY"VS Code (Copilot Chat)
Add to your .vscode/mcp.json:
{
"servers": {
"cotrader": {
"type": "http",
"url": "https://api.getcotrader.com/mcp",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}Cursor
Add to your .cursor/mcp.json:
{
"mcpServers": {
"cotrader": {
"url": "https://api.getcotrader.com/mcp",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}5. Example Conversations
Once connected, just ask your AI assistant in plain English. Here are some examples of what you can do:
Screening for oversold stocks
The AI calls screen_stocks with your query, scans 11,000+ stocks, and returns a table of matches with their indicator values.
Analyzing chart patterns
The AI calls detect_patterns and returns support/resistance levels, trendlines, channels, and formations found in the price data.
Scanning for setups across the market
The AI calls scan_patterns to find stocks across the entire universe that match the pattern, ranked by strength.
Screening with MACD divergence
The AI calls screen_stocks which combines indicator conditions with chart pattern detection — filtering 11,000+ stocks for both technical criteria and MACD divergences.
Multi-step research
The AI chains multiple tool calls — screening first, then running pattern detection on each result — to give you a complete analysis.
6. Get an API Key
You need a Cotrader API key to connect your AI assistant. Create one from the API Keys page — the free tier includes 10 screens per day.
Note: Your API key is shown only once when created. Store it securely. If lost, revoke it and create a new one.
Ready to connect your AI assistant?