Backtrader MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| BACKTRADER_MCP_RUNTIMES | Yes | JSON object mapping runtime IDs to absolute Backtrader source root paths (e.g., {"default":"/absolute/backtrader/source/root"}). | |
| BACKTRADER_MCP_STATE_ROOT | Yes | The absolute path to the private state root directory. | |
| BACKTRADER_MCP_SOURCE_ROOTS | Yes | JSON object mapping source root IDs to absolute read-only paths (e.g., {"market_data":"/absolute/read-only/csv"}). | |
| BACKTRADER_MCP_TARGET_ROOTS | Yes | JSON object mapping target root IDs to absolute paths (e.g., {"strategies":"/absolute/generated/strategies"}). |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| doctorA | Diagnose package dependencies, configured roots, and Backtrader runtimes. |
| inspect_datasetA | Inspect a confined local CSV without registering it. |
| register_datasetB | Normalize a confined CSV into the immutable content-addressed store. Requires an explicit canonical column map (datetime/open/high/low/close/ volume/openinterest). Identical content maps to the same dataset ID. |
| register_local_datasetA | Register one or more local feeds from a hash-bound DataSpec v1. |
| preview_datasetA | Return a bounded preview of an immutable dataset. |
| derive_tabular_datasetA | Run one product-owned tabular transform into a new immutable dataset. |
| get_catalog_snapshotA | Read the bundled immutable strategy catalog snapshot. |
| search_strategy_catalogA | Search deterministic built-in patterns by text and archetype. |
| refresh_strategy_catalogA | Refresh one AST root, or rebuild both metadata corpora when package_root_id is set. |
| inspect_strategyB | Inspect bundled or source-attached strategy metadata without importing it. |
| list_strategy_templatesA | List the fourteen archetype/output-profile scaffold templates. |
| create_strategy_draftB | Create a private single-test or Python-bundle draft. |
| validate_strategy_specA | Validate and canonicalize StrategySpec against its immutable dataset. |
| get_strategy_draftB | Read a private draft with exact file hashes. |
| update_strategy_draftB | Update one editable draft file with optimistic concurrency. Requires the current revision and exact file hash; stale values are rejected with a conflict error. |
| validate_strategy_draftB | Statically validate a draft and issue an exact hash-bound capability. Parses and compiles AST without importing the candidate. Every call creates a new validation record and capability. |
| apply_strategy_repairB | Apply an exact-hash repair and invalidate the old validation capability. |
| list_target_treeA | Read a confined target directory tree as relative-path to sha256. |
| prepare_strategy_changesA | Prepare an exact diff; this does not approve or write the target. |
| apply_strategy_changesA | Apply only an exact change with a trusted local CLI approval record. |
| prepare_strategy_runA | Freeze exact run inputs and return a signed plan requiring local approval. |
| start_strategy_runA | Consume a distinct local execution approval and launch a durable job. |
| get_run_statusA | Read the durable state of a product-owned asynchronous run. |
| cancel_strategy_runB | Cancel a queued or running product job. |
| get_run_resultA | Read the normalized result and Markdown report for a successful job. |
| list_jobsA | List durable jobs newest-first with pagination metadata. |
| get_run_logsA | Read bounded tails of a job's private log files. |
| compare_strategy_runsB | Compare canonical metrics and provenance using comparison-profile-v1. |
| render_strategy_reportA | Render a successful canonical result as Markdown or JSON. |
| audit_independenceA | Audit source imports and dynamic execution against product boundaries. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| design_strategy | |
| map_dataset | |
| scaffold_strategy | |
| review_validation | |
| review_change | |
| run_backtest | |
| review_run_result | |
| recover_job |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| product-info | |
| catalog-snapshot | |
| strategy-templates | |
| strategy-contract |
TDQS
Scored across 30 tools
The toolset separates phases clearly (inspect/register/preview, draft/validate/change, prepare/start/run), and most tools have unique resource-action pairings. Minor confusion exists between register_dataset and register_local_dataset, and between inspect_dataset and preview_dataset, since both deal with bounded CSV/dataset inspection.
Almost every tool follows a consistent verb_noun snake_case pattern (register_dataset, preview_dataset, start_strategy_run, get_run_logs). The single outlier 'doctor' breaks the pattern, and 'list_jobs' is slightly less descriptive than the strategy-specific names, but the convention is otherwise uniform.
30 tools is above the 25+ threshold and feels heavy for a typical MCP server, even though the lifecycle is broad. The set could be consolidated into fewer, higher-level tools or grouped behind subresources.
The server covers the full dataset/strategy/run lifecycle: ingest and derive datasets, create/validate/deploy strategy drafts, execute and compare runs, and render reports. Notable gaps are lack of dataset enumeration/listing and no explicit discard/delete operation for strategy drafts, though immutability and approval flows mitigate this.