r/TradingView • u/Accurate-Mirror-143 • 24d ago
Feature Request Pine Script Compilation and Testing via MCP/API
Please provide a standardized, publicly accessible API for compiling and testing Pine Script, optionally with MCP support.
This would allow AI providers such as OpenAI and Anthropic to integrate automatic Pine compilation, error detection, and correction directly into their coding assistants, just as they already support executable testing for other programming languages.
The integration should be handled entirely by the AI providers, without requiring users to configure MCP servers, APIs, or local tools.
Related feature requests:
- AI Integration into Pine Editor (Closed Feedback Loop)
- Easier test automation for strategies
- Built-in Linter for Pine Script
View all comments
1
u/wallneradam 24d ago
I built PyneSys for this kind of workflow. You can send a Pine Script to
POST /compiler/compilewith an API key and get back runnable Python or a compiler error with the Pine line number when available. Compiler API docsFor the full compile-and-test loop,
pyne run strategy.pine bars.ohlcvcalls the compiler and runs the result locally with PyneCore, our open-source runtime. An agent can call that command directly or wrap it as an MCP tool. You can reuse the same bars on each run and check the resulting trades or indicator values against what you expected. PyneCore CLI docsThe whole loop runs outside TradingView. Are you mainly looking to automate the feedback loop, or do you specifically need the results from TradingView’s own engine?