trading-swarm-mcp
Summary: A read-only, zero-trust quant research and backtest-forensics MCP server that audits strategies, gates risk, and validates orders/sizing/portfolios locally with no live trading.
Audit backtests: run a preflight → quote → run → status → report/compare pipeline over returns/trades CSVs or inline rows, flagging lookahead bias, cost decay, Sharpe significance, and outlier concentration (local free; hosted 20 credits).
Audit feature manifests for lookahead leakage, banned actuals sources, pre-tape features, and universe coverage.
Cost-check edges: convert gross bps into net and round-trip cost under a pessimistic spread/slippage/adverse-selection model.
Validate orders against house floors (25% max position, 60% gross cap), with optional per-fund overrides and deviation reporting.
Explain position sizing (ATR sizing, notional cap, overnight-gap halving, weekend headroom, trail stops).
Plan pre-trade rebalances: drawdown circuit breaker, PSI drift guard, turnover buffer, spread gate, sequenced sells before buys.
Optimize portfolio weights via vol-target momentum, HRP, or shrinkage MVO with defensive cash sweep.
Validate strategy genomes (canonical genome_hash) and check promotion readiness with audit_request/cloud_job specs.
Hosted point-in-time data (with
SWARM_MCP_ACCESS_TOKEN): as-filed SEC EDGAR fundamentals, insider/institutional, regime, andpit.analysissignificance testing.Safety: all tools are read-only, never place/route orders, and local path/cache tools are workspace-jailed and offline-only.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@trading-swarm-mcp Audit this AAPL order: 200 shares, would be 22% of equity"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
quant-swarm — Zero-Trust Backtest Forensics & Point-in-Time Market Data (MCP)
Audit trading backtests locally for lookahead bias, Newey-West + Benjamini-Hochberg overlap-adjusted significance, outlier concentration, and realistic transaction-cost decay—100% offline and free—and query as-filed Point-in-Time SEC EDGAR & macro signals with zero restatement leakage.
30-Second Quickstart (No Account or API Key Required Locally)
Claude Code
claude mcp add quant-swarm -- uvx quant-swarmCursor / Claude Desktop / Windsurf (mcp.json)
{
"mcpServers": {
"quant-swarm": {
"command": "uvx",
"args": ["quant-swarm"]
}
}
}Remote Streamable-HTTP (claude.ai, ChatGPT, Web MCP Connectors)
https://mcp.1.21initiative.com/mcp(Metadata & tools/list require no auth; tool execution uses OAuth 2.1 PKCE or Authorization: Bearer <SWARM_MCP_ACCESS_TOKEN> from 1.21initiative.com/mcp/. Specialist HTTP endpoints: /mcp [12 core tools], /mcp/data [16 tools], /mcp/warden [12 tools], /mcp/gym [11 tools] — local-disk cache.* and local-filesystem audit.* path tools are intentionally omitted on HTTP.)
Related MCP server: Momus-MCP
First Prompt to Try
"Run
audit.backteston./returns.csvand./trades.csvassuming 3 bps spread and 5 bps slippage across 25 parameter trials. Check whether net Sharpe survives 2x cost stress and Newey-West + Benjamini-Hochberg adjustment."
Sample Verdict Returned (0 credits, 0 bytes sent off your machine):
{
"tool": "audit.backtest",
"overall_assessment": "PROBLEMS_OBSERVED",
"metrics": {
"sharpe_gross_annualized": 2.14,
"sharpe_net_annualized": 0.31,
"newey_west_t_stat": 1.18,
"bh_q_value": 0.42,
"breakeven_cost_multiplier": 1.12,
"top5_pnl_share_pct": 68.4
}
}Default core Profile (12 High-Signal Tools, ~2.4k Schema Tokens)
uvx quant-swarm loads a lean 12-tool core profile so your coding agent never suffers tool-catalog context bloat:
Surface | Tools Included in Default | Auth / Metering |
Free Offline Backtest & Risk Forensics |
| Free & 100% Offline ( |
Hosted Point-in-Time ( |
|
|
Specialist Profiles (--profile)
Need the full 48-tool local stdio specialist suites (step-by-step audit.preflight/quote/run/compare, local SQLite cache management, portfolio optimization, symbolic alpha formula evaluation, or optional experimental Shadow Tournament benchmarking)?
uvx quant-swarm --profile full # All 48 local stdio tools across Warden, Data & Gym (39 on remote HTTP)
uvx quant-swarm --profile warden # Equivalent to swarm-warden-mcp (18 stdio tools; 12 on /mcp/warden HTTP)
uvx quant-swarm --profile data # Equivalent to swarm-data-mcp (19 stdio tools; 16 on /mcp/data HTTP)
uvx quant-swarm --profile gym # Equivalent to swarm-gym-mcp (11 tools on both stdio and /mcp/gym HTTP)Point-in-time data, for real
Every hosted dataset (market.fundamentals_pit, market.insider_institutional_pit, market.supply_chain_pit, market.macro_nowcast) is indexed strictly by its public filing or release timestamp (available_at <= as_of)—never restated fiscal-period archive dates—and returns derived ratios, z-scores, and percentiles rather than raw vendor series.
PIT significance, explained (pit.analysis)
pit.analysis evaluates cross-sectional Spearman rank IC per (dataset | metric | horizon) family with size/sector neutralization, Newey-West (Bartlett) overlap-adjusted t-statistics, Benjamini-Hochberg q <= 0.05 multiple-testing control, staleness caps, and a shuffled-date placebo gate (SIGNIFICANT, NOT_SIGNIFICANT, NOT_JUDGED, or UNVERIFIED).
Plans
Free Offline (
stdio, no token): Unlimited localaudit.backtest,warden.*,cache.*, and inline-barsgym.*runs (0 credits).Free Hosted Token (
SWARM_MCP_ACCESS_TOKEN): 250 relay calls/month (10 symbols/call) + 100 bonus Pro trial credits on signup at 1.21initiative.com/mcp/.One-Time Credit Packs (No Subscription):
10,000credits (£19 / ~$24) or100,000credits (£149 / ~$189), valid 90 days (1 credit per relay call, single-shot Pro tool, or hosted gym episode).
Security, Privacy & Agent Honesty Rules
Strict Transport Isolation: Local file-path auditing (
audit.backtest,audit.preflight,audit.quote,audit.run,audit.report,audit.compare) and local SQLite cache controls (cache.warm,cache.stats,cache.offline) exist only onstdioand are jailed to your active workspace (SWARM_ALLOWED_WORKSPACEorcwd). Remote HTTP (https://mcp.1.21initiative.com/mcp) accepts only bounded inline CSV/row payloads (<= 250 KB) with zero server disk I/O and enforces per-token burst rate limits.Zero Order Execution: Read-only diagnostic and research tools only—never places, modifies, or routes live orders. Diagnostic evidence only, not investment advice.
Recommended Agent Rule: When calling any
quant-swarmtool, instruct your agent to quote its verdict verbatim and never upgrade a raw p-value into a significance claim whenbh_q_value > 0.05orINSUFFICIENT_EVIDENCEis returned.
Documentation & Links
Product & API Keys: https://1.21initiative.com/mcp/
Source & Issues: https://github.com/blink1217/trading-swarm-mcp
License: MIT (
swarm_mcpwrapper/tools) AND Source-Available (swarm_mcp/vendored/guardrails/LICENSE.md).
Available Tools
18 toolsaudit.backtestQuant Swarm Audit — One-Shot Backtest ForensicsARead-onlyIdempotentInspect
Runs a complete zero-trust backtest forensic audit in a single call at 0 credits.
Evaluates lookahead leakage, Newey-West HAC t-stat, Benjamini-Hochberg q-value, Deflated Sharpe, 1x/2x cost survival, drawdown tails, and top-5 trade concentration locally.
Inputs: num_trials, spread_bps, trades_csv, returns_csv, +13 more. Returns: how, mode, tool, error, +56 more
audit.backtest_inlineQuant Swarm Audit — Inline Backtest Forensics (Remote Safe)ARead-onlyIdempotentInspect
Runs a one-shot backtest forensic audit over inline CSV or row arrays with zero server disk I/O.
Built for remote HTTP connectors (claude.ai, ChatGPT, web MCP): evaluates Newey-West HAC significance, BH q-value, cost survival, concentration, and PIT leakage up to 250 KB.
Inputs: num_trials, spread_bps, trades_csv, returns_csv, +10 more. Returns: how, mode, tool, error, +56 more
audit.compareQuant Swarm Audit — Compare Before/After Audit BundlesARead-onlyIdempotentInspect
Compares two completed audit jobs (version A vs version B or before/after remediation). Returns a structured diff of Sharpe, net edge, cost sensitivity, drawdown, trade concentration, and resolved vs new warnings.
Inputs: job_id_a (required), job_id_b (required), output_html_path. Returns: how, mode, tool, error, +56 more
audit.preflightQuant Swarm Audit — Preflight & Scope MatrixARead-onlyIdempotentInspect
Validates strategy returns, trades, benchmark, cost assumptions, and feature manifests locally at 0 credits. Returns a Coverage & Scope Matrix separating available checks, NOT_TESTED checks, and an outbound data preview.
Inputs: trades_path, trades_rows, returns_path, returns_rows, +7 more. Returns: how, mode, tool, error, +56 more
audit.quoteQuant Swarm Audit — Deterministic Quote & Approval TokenARead-onlyIdempotentInspect
Prices a validated preflight manifest before execution. Returns the deterministic execution plan, runtime estimate, exact credit/GBP cost, and an input-bound approval_token.
Inputs: mode, trades_path, trades_rows, preflight_id, +10 more. Returns: how, mode, tool, error, +56 more
audit.reportQuant Swarm Audit — Export Reproducible Evidence ReportARead-onlyIdempotentInspect
Generates the structured JSON audit bundle, reproducibility manifest, and shareable HTML/Markdown reports. Every finding includes category (OBSERVED_PROBLEM | SENSITIVITY_WARNING | INSUFFICIENT_EVIDENCE | PASSED | NOT_TESTED), evidence, impact, next experiment, and limitation.
Inputs: job_id (required), output_html_path, output_json_path, output_markdown_path. Returns: how, mode, tool, error, +56 more
audit.runQuant Swarm Audit — Execute Strategy AuditBRead-onlyIdempotentInspect
Executes the Quant Swarm Audit and records a reproducible job bundle. Enforces approval_token verification, idempotency_key deduplication, and max_credits spend cap; never charges on preflight refusals.
Inputs: approval_token (required), idempotency_key (required), mode, max_credits, +13 more. Returns: how, mode, tool, error, +56 more
audit.statusQuant Swarm Audit — Poll Job StatusARead-onlyIdempotentInspect
Polls an audit job by job_id in read-only mode at 0 credits. Returns completion status, overall diagnostic assessment, finding counts by category, and input SHA-256 hash.
Inputs: job_id (required). Returns: how, mode, tool, error, +56 more
warden.audit_featuresAudit Feature ManifestARead-onlyIdempotentInspect
Audit a feature manifest for lookahead leakage and provenance violations.
manifest: [{name, source, value_ts, as_of}]. Flags banned actuals sources (open-meteo.archive etc.), features predating tape start, and unknown features fail closed to tier C. Optional coverage check vs MIN_COVERAGE=0.90 for challenger-selected symbols against the archived snapshot universe.
Inputs: manifest (required), tape_started, selected_symbols, snapshot_universe. Returns: how, tool, error, access, +7 more
warden.cost_checkCost CheckARead-onlyIdempotentInspect
Convert a claimed gross edge into net-of-cost reality under the pessimistic fill model.
Spread + slippage + adverse selection are charged at both entry and exit, always against the position — the same model the gym scores every episode with.
Inputs: spread_bps (required), slippage_bps (required), gross_edge_bps (required), adverse_selection_bps (required). Returns: how, tool, error, access, +7 more
warden.defensive_postureCausal Portfolio Defensive Posture ClassifierARead-onlyIdempotentInspect
Classifies portfolio risk posture into Normal, Cautious, Defensive, or CrisisShield.
Uses trailing volatility, efficiency ratio, and drawdown stress to compute the recommended risk-scale multiplier (1.00x down to 0.20x), stop-tightening factor (1.00x down to 0.55x), and effective portfolio stop-heat cap. Pure risk governance.
Inputs: efficiency_ratio_20d, realized_vol_20d_pct, account_daily_pnl_pct, base_max_stop_heat_pct, +3 more. Returns: how, tool, error, access, +11 more
warden.explain_sizingExplain SizingARead-onlyIdempotentInspect
Step-by-step mirror of the live C# risk engine sizing: ATR sizing, position-notional cap, overnight-gap halving, weekend gross headroom. Reports the house floors and any deviation when per-fund overrides are supplied.
Inputs: close (required), atr_14 (required), equity (required), overnight_gap, +3 more. Returns: how, qty, tool, error, +11 more
warden.optimize_portfolioOptimize Portfolio WeightsARead-onlyIdempotentInspect
Computes volatility-targeted dual-momentum, hierarchical risk parity, or shrinkage mean-variance portfolio weights under the house concentration and turnover caps. Residual capital is swept to the defensive cash proxy; never places or routes trades. Pro tool.
Inputs: candidates (required), top_k, method, turnover_cap, +4 more. Returns: how, tool, error, access, +15 more
warden.plan_rebalancePre-Trade Rebalance Risk GateARead-onlyIdempotentInspect
Checks the portfolio drawdown circuit breaker, feature drift guard, 3% turnover drift buffer, and bid-ask spread gate. Sequences sell reductions before buy additions with marketable limit collars; never routes trades.
Inputs: equity (required), target_weights (required), high_water_mark (required), quotes, +7 more. Returns: how, tool, error, access, +12 more
warden.promotion_verdictPromotion Readiness & Prerequisite CheckARead-onlyIdempotentInspect
Deterministic local promotion-readiness & prerequisite check (free, 0 credits). Always returns verdict=INDETERMINATE_LOCAL because promotion selection machinery (Deflated Sharpe, PBO cap, trials ledger) runs server-side only. Validates genome schema, checks Tier-A/B/C mutation eligibility vs champion_genome, returns readiness_status (READY_FOR_HOSTED_TOURNAMENT | BLOCKED_SCHEMA_INVALID | BLOCKED_TIER_B_C_REQUIRES_TAPE), names missing statistical inputs, and emits an audit_request plus cloud_job spec for tournament.submit.
Inputs: challenger_genome (required), champion_genome. Returns: how, why, tool, error, +14 more
warden.prop_challenge_checkProp-Challenge Compliance & Drawdown CheckARead-onlyIdempotentInspect
Checks a proposed trade against TwoStep or OneStep prop-firm drawdown and consistency rules.
Evaluates hard and safe daily loss floors, overall drawdown stop, 30-40% single-day consistency cap, 0.55x Target-Lock Taper when >=70% of profit target is banked, and friction-adjusted trade risk. Pure risk/compliance rules — never places orders.
Inputs: spread_bps, format_type, current_equity, initial_balance, +10 more. Returns: how, tool, error, access, +15 more
warden.validate_genomeValidate GenomeARead-onlyIdempotentInspect
Validate a genome against the bounded schema and return its canonical genome_hash.
The hash is the reproducible strategy identity used as challenger_id in the hosted tournament and in audit_request blocks.
Inputs: genome (required). Returns: how, note, tool, error, +8 more
warden.validate_orderValidate OrderARead-onlyIdempotentInspect
Validate a proposed order against the house floors (max position 25%, gross cap 60%).
order: {symbol, notional, side: buy|sell}; current_positions: {symbol: notional}. Per-fund overrides are allowed but the response always reports the deviation from the house floors. Rejections quote the exact floor — the same function gating live capital.
Inputs: order (required), equity (required), floor_overrides, current_positions. Returns: how, tool, error, access, +10 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
The `audit.*` tools form a clean staged pipeline (preflight → quote → run → status → report → compare), so sequence-adjacent tools are distinguishable by their stage. A few pairs bleed into each other: `audit.backtest` vs `audit.backtest_inline` run the same forensics with different I/O, `warden.validate_genome` is partly subsumed by `warden.promotion_verdict` (which also validates genome schema), and `warden.validate_order` / `warden.explain_sizing` / `warden.prop_challenge_check` all report over risk floors. Descriptions largely resolve these, so an agent can still choose correctly.
Consistent two-namespace dotted convention (`audit.*`, `warden.*`) with lowercase snake_case after the dot, which gives a strong, predictable grouping. The only wobble is verb-vs-noun style: `audit.run`/`warden.validate_order` are verb_noun, while `audit.status`, `audit.quote`, `warden.defensive_posture`, and `warden.promotion_verdict` are noun phrases.
18 tools is on the heavier side but justified by two large sub-domains: an 8-tool audit pipeline and a 10-tool risk/compliance warden. Each tool maps to a distinct operation with little redundancy; the only marginal member is `audit.backtest_inline`, a transport variant of `audit.backtest`.
The audit lifecycle is fully covered end to end (preflight, priced quote, execution with approval token and idempotency, polling, report generation, and job-to-job comparison), and the warden covers order gating, feature leakage, sizing, portfolio construction, rebalance planning, posture, promotion, and prop-firm rules. Gaps are minor but real: no job listing/cancellation, no retrieval of a past job's raw artifacts, and no account/position-state fetch tool, so agents must supply portfolio context themselves.
Maintenance
Related MCP Connectors
A paid remote MCP for hosted MCP server, built to return verdicts, receipts, usage logs, and audit-r
Remote MCP for A2A failure replay MCP, structured receipts, audit logs, and reviewer-ready evidence.
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Trading MCP server for AI agents, with live market data, account reads and controlled execution.
Related MCP Servers
- AlicenseAqualityBmaintenanceLocal-first production-readiness MCP server for AI-built apps. It runs read-only checks, produces an evidence-based readiness score, and guides fixes before launch.1125 npm7Apache 2.0
- AlicenseNot gradedqualityBmaintenanceA local-first, deterministic, read-only MCP server that audits test suites for false-green tests, tautological assertions, and mock-contract drift, ensuring tests truly validate production code. It provides tools to detect test fidelity issues, verify mock drift, and synthesize strict mock contracts.MIT
- AlicenseNot gradedqualityBmaintenanceEnables local static analysis of deployed AI model artifacts over MCP, exposing audit, diff, capabilities, and rule-explanation tools without uploading model bytes.2Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to run local, read-only audits that detect risky GitHub workflows, undocumented environment variables, possible credentials, and conflicting dependency configuration before merging.MIT