pinescript-plugin
Provides Pine Script validation and reference lookup tools for creating TradingView indicators.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pinescript-pluginValidate this Pine Script and show the correct signature for label.new"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
pinescript-plugin
Your agent writes Pine Script it cannot check. This gives it a checker.
Eight of these checks catch code that compiles perfectly and still loses money.
Every AI Pine Script tool on the market ships advice. None of them can verify a single line they produce. That gap is the whole reason this exists.
The problem, precisely
Ask any coding agent for a TradingView indicator. You get code that reads fluently and does not compile.
// Confident. Fluent. Four compile errors.
l = line.new(x1=1, y1=2, x2=3, y2=4, colour=color.red) // it is `color`
plotshape(cond, shape=shape.triangleup) // it is `style=`
v = math.clamp(x, 0, 1) // no such function
b = box.new(left=1, top=2, right=3, bottom=4, textalign=text.align_left)Three properties of Pine make this near-certain:
Parameter names are not guessable.
label.newtakestextalign.box.newtakestext_halign. Nothing about either implies the other.Several functions have two valid call forms.
line.new,label.newandbox.neweach accept achart.pointor independent coordinates. A model that has seen one will insist the other is wrong.The language moves quarterly, in both directions. TradingView added
request.footprint()and multiline strings, then removed the wrapped-line indentation rules in December 2025. Training data goes stale coming and going.
Sparse training data is the root cause, and TradingView say so plainly: the corpus for Python is large enough to generate working code, and for Pine it is not.
Related MCP server: TradingView MCP Server
The expensive half nobody addresses
Compile errors cost a minute. The real damage is code that compiles and is still
wrong: a repainting signal, a ta.* call inside a conditional quietly corrupting
its own history, a strategy that opens positions and never closes them.
"One overlooked mistake, like a repainting signal or scope error, can invalidate months of backtesting." — PickMyTrade
Prose cannot fix that class of bug, because the author already believes the code is right. Detection can. Eight checks ship today:
ID | Catches | Severity |
S1 |
| Warning |
S2 |
| Warning |
S3 | A | Warning |
S5 / S6 | Over 64 plots or 40 | Error |
S7 |
| Error |
S8 | A function defined inside a block | Error |
S9 |
| Warning |
Considered one and decided it is fine? Silence it:
d = request.security(syminfo.tickerid, "D", close) // pine-ignore: S1Syntactic errors are never suppressible. A compile failure is a fact, not a judgement.
What you get
Component | Does |
| Runs every check, returns diagnostics with line numbers |
| The real signature of any v6 built-in, overloads included |
4 skills | Language rules, the fix loop, indicator and strategy patterns |
1 hook | Validates every |
Why trust it
The engine is
pinescript-v6-validator,
the same code running inside a VS Code extension with 1,400+ installs at 4.45
stars. Your agent and your editor read from one implementation, so they cannot
disagree about a file.
Behind it: 457 function signatures from the official reference, a hand-maintained layer for everything TradingView shipped since, explicit overload modelling, and a golden corpus proven able to fail. Reintroduce a fixed bug and the build goes red.
Every Pine example in every skill is extracted and run through that validator in CI. A skill shipping code that fails its own checker would be worse than no skill, so the build blocks it.
Plugin, or VS Code extension?
Both. The distinction matters, because getting it wrong is what makes two tools contradict each other.
pinescript-v6-validator (npm) detection lives here, once
|
+------------+------------+
v v
VS Code extension this plugin
surface: humans surface: agents
squiggles, hover MCP, skills, hookA check is written once, in the engine. The extension renders it as a squiggle. This plugin returns it to the model. Neither reimplements it. The moment the same rule exists twice they drift, and a drifted rule means your agent and your editor disagree about the same file.
Skills are plugin-only. Prose is useless in an editor and is the whole point for an agent. Editor affordances such as formatting and go-to-definition stay in the extension.
Install
One plugin, four coding assistants. Skills live in skills/; each harness reads
its own manifest. The validation engine comes from
pinescript-v6-validator
on npm — no separate checkout required.
Claude Code
/plugin marketplace add jpantsjoha/pinescript-plugin
/plugin install pinescript-plugin@pinescript-plugin-marketplaceAntigravity (Gemini)
agy plugin install https://github.com/jpantsjoha/pinescript-pluginCodex
codex plugin marketplace add https://github.com/jpantsjoha/pinescript-plugin
codex plugin add pinescript-plugin@pinescript-plugin-marketplaceCodex reads AGENTS.md as its always-on contract and discovers skills under
.agents/skills/.
Kimi Code
Kimi reads .kimi-plugin/plugin.json. Point it at the skills directly:
git clone https://github.com/jpantsjoha/pinescript-plugin
kimi --skills-dir ./pinescript-plugin/skillsVerify the install
Ask your agent to validate something deliberately wrong:
//@version=6
indicator("check")
l = line.new(x1=1, y1=2, x2=3, y2=4, colour=color.red)You should get No parameter named 'colour' in 'line.new'. If instead you are
told the script is fine, the MCP server is not connected — check your harness's
MCP configuration.
Harness support
Every row below was verified by installing and running the tools, not by reading a manifest.
Skills | MCP tools | Hook | |
Claude Code | ✅ | ✅ | ✅ |
Antigravity | ✅ | ✅ | — (harness has no hook support) |
Codex | ✅ | ✅ | — |
Kimi Code | ✅ (via | ✅ | — |
Antigravity auditing a script through the plugin, and finding the repainting the author did not:

Two things are worth noticing. The model calls the plugin's own
validatePineScript rather than reasoning about the code from memory — the
verdict comes from the engine, not from the model's recollection of Pine. And it
does not paraphrase the warning: it names the check, states the mechanism
(reading a still-forming higher-timeframe bar), and gives the specific edit.
That is the difference between a skill that explains a diagnostic and one that merely mentions it.
Working on the plugin itself
git clone https://github.com/jpantsjoha/pinescript-plugin
cd pinescript-plugin && npm install && make hooks
make gate # spec · packaging · skills · links · Pine examples · MCP testsWhat's in it
skills/pinescript-v6/ execution model, overloads, anti-repainting, limits
skills/pinescript-validation/ every diagnostic class and its deterministic fix
skills/pinescript-indicator/ validated scaffolds: overlay, oscillator, drawings
skills/pinescript-strategy/ entries, exits, sizing, and the repainting traps
mcp/server.js validate_pine_script + lookup_pine_reference
hooks/ validates every .pine file the agent edits
scripts/ spec, packaging, skill, link and example validation
tests/ MCP behaviour testsmake gate runs everything: Agent Plugins 1.0.0 conformance, multi-client
packaging consistency, skill frontmatter contracts, reference-URL resolution,
embedded Pine validation, and the MCP behaviour tests.
What this does not do yet
Stating it plainly beats you finding out.
Constant and built-in-variable NAMES are not checked.
shape.trianglup,color.greneandplot.style_circlezvalidate clean here and fail on TradingView. Only parameter names are checked, never the values.lookup_pine_referencecovers functions only, so afound: falseforbarstate.islastmeans "not a function", not "not real".One check is specified but not built. S4 (assignment inside
and/or) is a heuristic about intent. Until its false-positive rate measures at zero it stays out. The related shape — ata.*call on the right ofand/or, which v6 short-circuits into a conditional call — escapes S2 for the same reason.Re-declaring a name with
=is a TradingView error and passes here.No type inference. A
seriesvalue passed wheresimpleis required compiles here and fails on TradingView. Fixing that needs an AST the engine does not have.Hooks work in Claude Code only. Antigravity, Codex and Kimi get the skills and the MCP tools. Their harnesses do not load the hook.
A clean validation is not proof the script is right. It means no known defect matched. Backtest assumptions, unconfirmed-bar entries and position sizing remain yours to check.
Related projects
Project | What it is |
The VS Code extension — IntelliSense, hover docs, real-time validation. Source of the engine this plugin uses. | |
Same plugin architecture applied to Google Cloud delivery — solution design, security, SRE, agentic patterns. |
Prior art
TradersPost/pinescript-agents covers similar ground with seven skills and is worth a look. double232/pinescript-skill is one deep skill with a good catalogue of hard language constraints.
The claim here is narrow and checkable. Both are prose. Neither can verify a line of the Pine it produces. This ships the checker.
Contributing
Found Pine that this validator gets wrong? That is the most valuable bug report available. A false positive is worse than a missed error, because it puts red marks on correct code and teaches people to ignore the tool. Open an issue with the smallest script that reproduces it.
Author
Jaroslav Pantsjoha
Website: jpantsjoha.com
GitHub: @jpantsjoha
LinkedIn: in/johas
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityFmaintenanceProvides accurate Pine Script v6 coding assistance through search, completion, and reference lookup tools using a comprehensive Japanese manual database. Enables developers to quickly find functions, constants, annotations, and API specifications for TradingView Pine Script development.1
- Alicense-qualityBmaintenanceEnables trading analysis across Forex, Stocks, and Crypto with 25+ technical indicators, real-time market data, and Pine Script v6 development tools including syntax validation, autocomplete, and version conversion.50MIT
- AlicenseAqualityAmaintenanceProvides comprehensive Pine Script v6 documentation and tools to help AI assistants look up functions, validate syntax, and generate accurate code. It enables linting, version conversion from v5 to v6, and deep conceptual analysis to prevent code hallucinations.107MIT
- Alicense-qualityDmaintenanceEnables AI assistants to look up any Pine Script function, search TradingView documentation, and find code examples in real time.12718MIT
Related MCP Connectors
Real-time market data, screeners, technical analysis & backtesting for stocks, crypto and forex.
Lints + auto-fixes how AI coding agents discover any new product. 24 rules, 6 tools, score 0-100.
Build, validate, and deploy multi-agent AI solutions from any AI environment.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jpantsjoha/pinescript-plugin'
If you have feedback or need assistance with the MCP directory API, please join our Discord server