Back to Home
kukapay icon

backtrader-mcp

by kukapay

Overview

An AI-accessible MCP server for Backtrader, enabling agents to run, analyze, and optimize trading strategies through natural language prompts.

Installation

Run Command
uv run main.py stdio

Security Notes

The `run_backtest` tool uses `exec(strategy_code, {}, local_ns)` to execute user-provided Python code directly. This is a critical security vulnerability as it allows arbitrary code execution. An attacker could inject malicious Python code (e.g., `import os; os.system('rm -rf /')`) leading to severe system compromise, data theft, or denial of service if the server is exposed to untrusted input. While the `exec` call uses empty globals, core built-ins and module imports are still accessible.

Similar Servers

Stats

Interest Score42
Security Score2
Cost ClassLow
Avg Tokens700
Stars1
Forks0
Last Update2025-11-27

Tags

Financial TradingBacktestingAI AgentQuantitative FinanceCrypto Trading