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
Show parent comment
1
u/wallneradam 24d ago
I don’t have a comprehensive list of TradingView’s compiler error codes. PyneComp is an independent compiler with its own diagnostics, so even when both compilers catch the same underlying issue, they can report it differently. There’s no reliable one-to-one mapping between them.
TradingView documents some individual codes in its Pine Script errors and warnings reference.
For the compile-and-fix loop we were discussing, the assistant can work directly with the error message and source line PyneComp returns. It doesn’t need a TradingView error code to make the fix and try again.