← Back to directory
Q

Quant2Ptrader MCP Server

Community
One-click MCP server that converts JoinQuant strategies to the Ptrade platform
GitHub source repository ↗
★ 61 Stars Category · Dev Tools Popular
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.

Reliability
8/20
Security and permissions
9/20
Maintenance
8/20
Documentation
14/20
Setup experience
12/20
Read the FMRS scoring method →

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.

Tools

convertStrategy
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.

Setup

  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"]}}}

Fit and risk

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

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

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 DesktopFull support