npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pinescript-mcp

v1.0.0

Published

MCP server for Pine Script development — linting, validation, migration, and templates. No TradingView Desktop required.

Downloads

147

Readme

CI License: MIT npm Node

pinescript-mcp

MCP server for Pine Script development. Lint, validate, migrate, and scaffold Pine Script without needing TradingView Desktop.

8 tools. Zero external dependencies beyond the MCP SDK. Pure static analysis.

Tools

| Tool | Description | |------|-------------| | pine_validate | Parse and validate structure — version, declaration, variables, functions, inputs, plots | | pine_lint | 16 rules across errors, warnings, and info — catches v4/v5/v6 breaking changes, repainting, bad practices | | pine_migrate | Migrate code between v4→v5, v5→v6, or v4→v6 with a full change log | | pine_migration_guide | Get the complete breaking changes guide for a version pair | | pine_template | 7 starter templates — indicators, strategies, libraries, alerts | | pine_reference | Look up built-in functions, variables, and constants by name | | pine_namespace | Browse Pine Script namespaces (ta, math, str, request, strategy) | | pine_repainting_check | Focused repainting analysis — lookahead leaks, timenow, barstate, varip |

Install

npm install pinescript-mcp

Claude Code

claude mcp add pinescript -- npx pinescript-mcp

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "pinescript": {
      "command": "npx",
      "args": ["pinescript-mcp"]
    }
  }
}

Manual

npx pinescript-mcp

Communicates over stdio using the Model Context Protocol.

Lint Rules

Errors

| Rule | Description | |------|-------------| | E001 | Missing //@version=N annotation | | E002 | Missing indicator() / strategy() / library() declaration | | E003 | = vs := reassignment confusion | | E004 | v4 functions used in v5+ (e.g., sma()ta.sma()) | | E005 | security() without request. prefix in v5+ | | E006 | v6 breaking changes (transp removal, when parameter removal) | | E007 | Plot functions called inside user-defined functions |

Warnings

| Rule | Description | |------|-------------| | W001 | request.security() with lookahead_on but no [1] offset (repainting) | | W002 | timenow usage (always repaints) | | W003 | barstate.isrealtime without barstate.isconfirmed guard | | W004 | varip — not reproducible on historical bars | | W005 | More than 40 request.*() calls | | W006 | More than 64 plot calls | | W007 | calc_on_every_tick=true in strategy |

Info

| Rule | Description | |------|-------------| | I001 | Missing title on plot functions | | I002 | Strategy with entries but no exits or risk management |

Migration

Supports v4→v5, v5→v6, and v4→v6 (chained).

v4 → v5 renames 40+ functions:

  • study()indicator()
  • sma()ta.sma(), ema()ta.ema(), rsi()ta.rsi(), ...
  • security()request.security()
  • abs()math.abs(), ceil()math.ceil(), ...
  • tostring()str.tostring()
  • iff(cond, a, b)cond ? a : b
  • resolution=timeframe=

v5 → v6 handles breaking changes:

  • transp parameter removal (flags with TODO)
  • when parameter removal from strategy functions
  • timeframe.period comparison updates ("D""1D")

Templates

  • indicator-basic — Simple overlay indicator
  • indicator-oscillator — Oscillator with overbought/oversold levels
  • strategy-basic — Moving average crossover strategy
  • strategy-rsi-mean-reversion — RSI mean reversion with risk management
  • strategy-breakout — Donchian channel breakout
  • library-basic — Reusable library scaffold
  • alert-setup — Alert condition patterns

Reference

Built-in reference covers 5 namespaces with function signatures, descriptions, and examples:

  • ta — Technical analysis (sma, ema, rsi, macd, bb, stoch, crossover, ...)
  • math — Math functions (abs, ceil, floor, round, sqrt, log, pow, ...)
  • str — String operations (tostring, tonumber, contains, replace, ...)
  • request — Data requests (security, security_lower_tf, currency_rate, ...)
  • strategy — Strategy functions (entry, exit, close, close_all, risk, ...)

Development

git clone https://github.com/edgeless-ai/pinescript-mcp.git
cd pinescript-mcp
npm install
npm test

53 tests across parser, linter, and migrator modules.

License

MIT