Pattern Vista CLI is the command-line interface for the Pattern Vista service, mainly aimed at AI agents and programmatic invocation scenarios, providing historical win rate for candlestick patterns and MA200 deviation ranking data. Its core client, PatternVistaClient, does not depend on the CLI and also supports the MCP server, ensuring that the data returned by the two invocation methods is completely identical.
In terms of purpose, the tool provides three types of data: first, Deviation, with the formula (close − MA200) / MA200, refreshed nightly on each trading day, covering the stock pools of the S&P 500, Nasdaq 100, and major ETFs, and filtering out values distorted by stock splits or otherwise untrustworthy before ranking; second, market breadth (pv stretch, market_stretch), namely the proportion of stocks in the same stock pool whose closing price is above their respective MA200, with one reading per trading day and accompanied by historical data; this data is free for all tiers and matches the public page https://www.pattern-vista.com/market/stretch the published data is the same; third, win rate (hist_win_w20), namely the 20-trading-day historical hit rate for a pattern type since 2025-01-01; the methodology is see https://www.pattern-vista.com/posts/pattern-alpha-backtest。
In terms of usage, users first need to https://www.pattern-vista.com generate an API key (Account → API keys). The authentication resolution order is: --api-key flag → PATTERN_VISTA_API_KEY environment variable → stored configuration. The default output is JSON; add --table to output a human-readable view. When used as an MCP server, if uv is already installed, no additional installation is needed; the configuration method is to put the corresponding configuration into the configuration of an MCP client (such as Claude Desktop, Claude Code, Cursor, and other MCP clients that support stdio transport); it can also be installed or run via a container. When running in a container, the -i parameter must be added, because the transport is stdio, and a server without attached stdin will exit immediately. Authentication resolution in MCP mode is exactly the same as in the CLI. The tool is compatible with two generations of the MCP Python SDK (FastMCP in mcp 1.x and MCPServer in 2.x).
The applicable scenarios are mainly AI agents or programmatic systems obtaining market technical data for parsing, analysis, or display. In terms of limitations: free accounts can see only the first 2 rows of each list, and pattern data does not include hist_win_w20 (the value is null). A paid subscription unlocks the full list (up to 100 rows) and hist_win_w20; the subscription tier is enforced server-side based on the key, and the is_billed field should be checked in the response to avoid mistaking an overly short list for a calm market. Historical performance does not represent future results, and this tool does not constitute investment advice.