redline-mcp-server
v1.2.0
Published
MCP server for Redline — enforcement, violation detection, trade logging, and discipline scoring for AI trading agents
Maintainers
Readme
redline-mcp-server
MCP (Model Context Protocol) server for the Redline Trading OS. Exposes enforcement, violation detection, trade logging, discipline scoring, and session management as native MCP tools so any Claude-powered agent can call them without custom integration.
Installation
npm install -g redline-mcp-server
# or use npx without installing
npx redline-mcp-server --key rl_live_xxxxxConfiguration
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
| REDLINE_API_KEY | Yes (if not passed via --key) | — | Your Redline API key (rl_live_…). |
| REDLINE_API_BASE | No | https://tradeintelx.com | Override the API base URL. Use this to point the server at a staging or self-hosted environment. |
Staging / Custom Environments
REDLINE_API_BASE=https://staging.tradeintelx.com \
REDLINE_API_KEY=rl_live_xxxxx \
npx redline-mcp-serverOr with the --key flag:
REDLINE_API_BASE=https://staging.tradeintelx.com npx redline-mcp-server --key rl_live_xxxxxMCP Client Setup
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"redline": {
"command": "npx",
"args": ["redline-mcp-server", "--key", "rl_live_xxxxx"]
}
}
}For staging:
{
"mcpServers": {
"redline-staging": {
"command": "npx",
"args": ["redline-mcp-server", "--key", "rl_live_xxxxx"],
"env": {
"REDLINE_API_BASE": "https://staging.tradeintelx.com"
}
}
}
}Cursor / Other MCP Hosts
{
"mcpServers": {
"redline": {
"command": "node",
"args": ["/path/to/redline-mcp/index.js"],
"env": {
"REDLINE_API_KEY": "rl_live_xxxxx"
}
}
}
}Available Tools
| Tool | Description |
|---|---|
| check_enforcement_state | Account state, canTrade flag, discipline score, and active violations. Call before every trade. |
| get_discipline_score | Discipline score (0–100), band (elite/disciplined/developing/at-risk), 7-day trend, and 10 most recent violations. |
| get_analytics_summary | Performance analytics for a period (7d / 30d / 90d / 1y): win rate, profit factor, avg R:R, P&L, drawdown, top setups. |
| get_violation_risk | Stateless pre-trade violation check — returns clear, riskScore, and specific violations without writing data. |
| log_trade | Log a completed trade (triggers violation analysis and score update). |
| get_fingerprint | Trader DNA fingerprint: inferred style, top setups, session peaks, strengths, and leaks. Use to calibrate agent behaviour. |
| get_bot_config | Bot configuration and cumulative feedback summary (approval rate, decision counts). |
| push_bot_signal | Push a trade signal into the trader's Pending Signals Panel (1-hour TTL). |
| submit_bot_feedback | Record the trader's decision (approved / rejected / modified) on a signal. |
| start_session | Start a trading session with optional contract terms. |
| end_session | End a session and retrieve the P&L, win rate, and violation summary. |
Requirements
- Node.js 18+ (uses native
fetch) - A valid Redline API key (
rl_live_…)
