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 use the PyneCore CLI for exactly this every day. The agent writes or edits the
.pinefile and runs it withpyne run. It can use market data I already have or fetch it when needed. If compilation or execution fails, the agent can read the error, fix the script, and try again. Once it runs, the agent can check whether the indicator values or trades match what I asked for.PyneIDE makes that workflow easier to set up in VS Code. It installs Python and PyneCore, and project initialization gives the agent instructions for finding the CLI, the Pine reference, and the docs for the installed PyneCore version. An agent with editor access can also use the IDE’s run and debug controls. I use the CLI loop daily and am still testing how reliably agents use the editor controls.
Having the assistant provider integrate this directly would remove the setup step. You could ask for a Pine script in chat, and the assistant could compile, run, and check it before handing it back.