Skip to main content
Glama

AlgoTest Backtester MCP for Termux

This local MCP server controls the already-authenticated AlgoTest Backtester browser profile using Playwright and system Chromium. It is intended for personal use with Claude Code.

Files

Copy algotest-mcp-server.mjs into /root/algotest-mcp/ inside the Debian PRoot environment where Chromium and npm dependencies are installed. The repository also includes login-session.cjs for local hidden-password login and BROWSER_ACCESS.md with the complete Android/Termux/PRoot browser setup.

Related MCP server: browser-mcp-cdp

Install

cd /root/algotest-mcp
npm install --no-audit --no-fund playwright @modelcontextprotocol/sdk zod
# The package is already installed with PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1.

The server expects the persistent login profile at /root/algotest-mcp/profile and Chromium at /usr/bin/chromium. These can be overridden with ALGO_PROFILE and CHROMIUM_PATH.

Create or refresh the local login session

cd /root/algotest-mcp
node login-session.cjs

The helper reads credentials locally, does not print the password, and stores the authenticated Playwright profile under /root/algotest-mcp/profile. Never commit or share that directory.

Test server manually

cd /root/algotest-mcp
node algotest-mcp-server.mjs

The process uses stdio and will appear to wait; press Ctrl+C to stop. Do not type passwords into the server process.

Add to Claude Code

Claude Code commonly supports adding a local stdio MCP server with an mcp add command. From the same Debian shell, try:

claude mcp add algotest-backtester -- node /root/algotest-mcp/algotest-mcp-server.mjs

If your installed Claude Code version uses a different MCP command, run claude mcp --help and add a local server with:

  • Name: algotest-backtester

  • Transport: stdio

  • Command: node

  • Arguments: /root/algotest-mcp/algotest-mcp-server.mjs

Available tools

backtest_strategy is the unified natural-language workflow. It parses a request such as “ETH par last 350 days, 22:00 entry, 07:00 exit, sell ATM call and put, Today expiry,” configures the UI, and returns a preview. It never starts the run unless confirm: true is explicitly supplied by Claude Code after user confirmation.

preview_backtest configures the Backtester and never presses Start Backtest. run_backtest requires confirm: true; without confirmation it only returns the configuration preview. get_results reads the currently visible result page. close_browser closes the browser but preserves the login profile.

Example Claude Code request

ETH ki strategy ko last 350 days par backtest karo: Delta Exchange ETHUSD, intraday, entry 22:00 IST, next-day exit 07:00 IST, sell ATM call and sell ATM put, Today expiry, 1 lot, no stop-loss and no target.

Claude Code should first call backtest_strategy with confirm: false, show the parsed configuration, and ask for confirmation. Only after you approve should it call the same tool with confirm: true.

After reviewing the preview, explicitly ask Claude Code to run it. The tool itself still requires confirm: true as a safety guard.

Important limitations

The browser profile must remain available and the Debian/Termux process must not be killed. OTP, CAPTCHA, session expiry, or a changed AlgoTest UI may require manual intervention. The automation is for Backtester data only; it does not place live orders or deploy an algo. The Today expiry plus a 22:00-to-07:00 overnight window may be rejected by AlgoTest validation; the tool will return the platform's message.

Never share AlgoTest passwords or OTPs in chat. If a session expires, run a separate local login flow and preserve the profile directory.

Available Tools

5 tools
backtest_strategyA

Accept a natural-language strategy request, configure AlgoTest Backtester, and either return a preview or run it when confirm=true. Never performs live trading.

Inputs: request (required), confirm.

close_browserA

Close the local automation browser while preserving the persistent login profile.

Inputs: no named parameters.

get_resultsA

Read the currently visible AlgoTest Backtest result metrics without starting a new run.

Inputs: no named parameters.

preview_backtestB

Configure AlgoTest Backtester in the local browser profile without starting a backtest. Use this first.

Inputs: endDate (required), startDate (required), lots, expiry, +6 more.

run_backtestB

Configure and run AlgoTest Backtester. Requires confirm=true because it consumes a backtest quota. Never use for live trading.

Inputs: endDate (required), startDate (required), lots, expiry, +7 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 5 tools

    Disambiguation2/5

    backtest_strategy overlaps heavily with both preview_backtest and run_backtest, since it can either preview or run a strategy depending on confirm. This makes it unclear when an agent should use backtest_strategy versus the more specific preview/run tools.

    Naming Consistency5/5

    All five tool names follow a consistent snake_case verb_noun pattern: backtest_strategy, preview_backtest, run_backtest, get_results, close_browser. This is predictable and easy to scan.

    Tool Count5/5

    Five tools is well-scoped for a browser-automation backtesting workflow. Each tool maps to a meaningful step in the process without unnecessary bloat.

    Completeness4/5

    The set covers the core workflow: preview, run, retrieve results, and clean up. Minor gaps exist, such as no explicit cancel or historical results retrieval, but agents can likely complete the main backtest lifecycle.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables algorithmic trading on the Shoonya platform through natural language commands, with military-grade encryption for credential security.
      11
      7 npm
      ISC
    • A
      license
      A
      quality
      D
      maintenance
      Drives your real local Chrome with profile isolation, allowing LLMs to interact with your logged-in sessions without modifying your actual profile.
      13
      48 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to control a local Chromium browser via CDP for page snapshots, screenshots, human-like interactions, autonomous crawling, API/GraphQL reconnaissance, authenticated differential testing, and Burp-like intercept, repeater, and intruder workflows with scope enforcement and audit logging.
      MIT