← Back to directory
Q

Quant2Ptrader MCP Server

Community
One-click MCP server that converts JoinQuant strategies to the Ptrade platform
Category
Dev Tools #243 of 438
Stars
★ 72 Popular
Transport
stdio (local process) · Streamable HTTP
Runtime
Node.js
Credentials
No credential needed
License
Other / unspecified
Last commit
⚠
Tools
1
51FMRS · D

A focused migration tool: it leverages API similarity between JoinQuant and Ptrade to auto-handle imports, logging, position access, and history-data calls, producing a risk-annotated report and a directly usable .py file. Practical, but rules are pattern-based, so complex strategies still require human review and backtesting. The repository metadata shows NOASSERTION for license (README states Apache 2.0), so verify licensing before use.

Strongest · Documentation 14/20 Weakest · Reliability 8/20

Reliability
8/20
Security and permissions
9/20
Maintenance
8/20
Documentation
14/20
Setup experience
12/20
Why each score
Reliability 8/20
The README describes both stdio and HTTP startup modes with build/start scripts and shows conversion examples, suggesting a plausible happy path. However, there is no evidence of a CI workflow or an integrated test suite in the repository (the referenced `test_strategy.py` is presented only as a documentation example, not part of automated testing), and no verifiable record of the MCP init/tool-list handshake. The conversion logic is regex-based and no error handling for edge cases (complex syntax, nested calls) is documented. Per the static calibration rule, reliability is capped at 12 without verifiable CI+test evidence; scored 8.
Security and permissions 9/20
The server reads arbitrary file paths supplied by the user/AI (.py/.txt, etc.) and automatically writes converted output back to disk (same directory, current working directory, or a specified output_dir), with no mention of path validation, sandboxing, or a confirmation step before writing. This creates a plausible arbitrary file read/write risk. On the positive side, the tool does not involve network credentials, external API keys, or data exfiltration, and there is no red-line issue (no irreversible delete/pay/remote-command default). Because permission scoping and confirmation are incompletely disclosed, scored 9.
Maintenance 8/20
The GitHub repository metadata lists License as NOASSERTION, while the README claims Apache License 2.0 — a direct inconsistency indicating unclear license governance. The repo has 61 stars and 3 open issues, but the README provides no changelog, release history, or dedicated security-response channel (only an author email). Update cadence and dependency maintenance cannot be verified from the available evidence. Given the license conflict and lack of verifiable maintenance signals, scored 8.
Documentation 14/20
The README is well-structured, covering installation, build, both stdio/HTTP run modes, Claude Desktop client configuration examples, multiple conversion examples, an API compatibility table, known issues, and a roadmap — showing reasonable layering and examples. However, it lacks a formal tool input parameter schema (precise required/optional fields), detailed error-handling behavior, and cost/timeout limit disclosures, so it falls short of full marks. Scored 14.
Setup experience 12/20
Local run instructions (npm install/build) and a ready-to-use npx-based Claude Desktop JSON config are both provided for stdio and HTTP modes, keeping the setup path short and low-friction. However, there is no build artifact verification or CI evidence confirming these steps currently work. Per the static calibration rule, setup is capped at 15 without CI+test evidence; scored 12.

Static review · not runListed 2026-09-07

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesWrites / deletes local files

Best for

  • Quant traders using both JoinQuant and Ptrade who need to migrate strategies
  • Developers who want fast automated API-difference replacements plus clear notes on what still needs manual work

Not for

  • Users needing guaranteed support for JoinQuant research-environment APIs or third-party libraries
  • Anyone expecting production/live trading use without manual review
  • Strategy conversion for platforms other than JoinQuant/Ptrade

Required permissions

  • Reads local strategy files (.py, .txt, .text, .code, .strategy)
  • Writes generated _ptrade.py files to the working directory, the source file's directory, or a specified output_dir

Risks and side effects

  • order_target_percent is converted to order_target_value; target amounts must be calculated manually
  • run_weekly/run_monthly become run_daily and require custom date-check logic inside the function
  • get_fundamentals query syntax may need tweaks; datetime parameters should use string format
  • Some JoinQuant-specific research-environment APIs may not convert fully; custom functions and third-party libraries need manual compatibility checks
  • Converted strategies should be validated with small-scale backtests on Ptrade before any live use

Setup

Before you start

Runtime:Node.js

  1. Clone the repository and run npm install
  2. Run npm run build
  3. Start with npm run start:stdio (recommended) or npm run start:http (serves http://localhost:3000/mcp)
  4. In Claude Desktop's config file (macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.; Windows: %APPDATA%\Claude\claude_desktop_config.), add an mcpServers entry — stdio mode uses command: npx, args: ["-y", "quant2ptrader-mcp"]; HTTP mode uses type: streamableHttp, url: http://localhost:3000/mcp.
claude_desktop_config.json
{"mcpServers":{"quant2ptrader":{"command":"npx","args":["-y","quant2ptrader-mcp"]}}}

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "quant2ptrader": {
      "command": "npx",
      "args": [
        "-y",
        "quant2ptrader-mcp"
      ]
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add quant2ptrader -- npx -y quant2ptrader-mcp

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

The convertStrategy tool should appear in the client's tool list; run it on a strategy containing 'from jqdata import *' and confirm the report shows the import rewritten to 'from ptrade.api import *' and a *_ptrade.py output file path, proving the server works.

Troubleshooting

  1. Ensure npm install and npm run build have completed before starting the desired mode
  2. For stdio failures, verify the Claude Desktop config file path and JSON syntax
  3. For HTTP mode, confirm the server is at http://localhost:3000/mcp and the timeout is sufficient (example: 600)
  4. If file conversion fails, check the extension is one of .py/.txt/.text/.code/.strategy
  5. Review the report's flagged risk items and code preview before running backtests

Things to try

Once connected, you can ask your AI assistant things like:

  • Convert this JoinQuant strategy to Ptrade format: from jqdata import * ...
  • Convert this strategy file to Ptrade format, file path: /home/user/my_strategy.py
  • Convert this file and save it to a specific directory, file: C:\strategies\my_strategy.py, output dir: D:\ptrade_strategies\
  • Convert /home/user/my_strategy.txt and tell me which APIs were changed

Tools 1

convertStrategy writes
Core conversion tool: takes JoinQuant strategy code or a file path (with optional output directory), converts it to Ptrade format, saves a .py file, and returns modification details and compatibility notes.

Use cases

Migrating existing JoinQuant strategies to the Ptrade platform
Resolving common API differences (imports, logging, positions, history data) across strategy files
Requesting strategy conversion in natural language via an AI assistant and getting a runnable .py file

Supported clients

Claude Desktop

Listed from the project's documentation, not tested by this site.

Overview

Quant2Ptrader-MCP is a Model Context Protocol server that automatically converts JoinQuant quantitative strategy code into Ptrade platform format. It accepts code directly or file paths (.py/.txt/.text/.code/.strategy), detects and rewrites differing APIs (imports, logging functions, position access, history data calls, etc.), produces a detailed conversion report with risk notes, and auto-saves the result as a _ptrade.py file. Developed by Xingyu Chen, published on npm as quant2ptrader-mcp, and supports both stdio and HTTP modes.

Similar servers

Context7 80 · B

Upstash's official server providing up-to-date third-party library docs for AI coding assistants

★ 63.3k · Tools 2 Compare with this →

Source revision 2c1c79fc133e Data synced 2026-10-19 Read the FMRS scoring method