
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
pinescript-mcp-server
Advanced tools
MCP server for Pine Script v6 documentation - search, reference lookup, guides, and examples
Give your AI assistant expert-level Pine Script knowledge.
This project lets AI tools like Claude look up any Pine Script function, search TradingView documentation, find code examples, and browse guides — all in real time while you chat. No more hallucinated functions or outdated v5 syntax.
When you ask Claude to help you write a TradingView indicator or strategy, it doesn't always know the correct Pine Script v6 syntax. This server plugs directly into Claude and gives it access to the complete Pine Script v6 reference — 457 functions, 427 variables, and the full user guide — so it can look things up instead of guessing.
It uses something called MCP (Model Context Protocol), which is a standard way to give AI assistants access to external tools and data. You don't need to understand MCP to use this — just follow the install steps below.
You need Node.js version 18 or higher installed on your computer.
Don't have Node.js? Download it from nodejs.org — grab the LTS (Long Term Support) version. The installer will walk you through it.
To check if you already have it, open a terminal and type:
node --version
If you see v18.0.0 or higher, you're good to go.
Pick the method that matches how you use Claude:
If you use Claude Code in your terminal, just run:
claude mcp add pinescript -- npx -y pinescript-mcp-server
That's it. Next time you start a Claude Code session, it will have Pine Script tools available.
pinescript entry inside the existing mcpServers object):{
"mcpServers": {
"pinescript": {
"command": "npx",
"args": ["-y", "pinescript-mcp-server"]
}
}
}
When it restarts, you should see a small tool icon in the chat input area. Click it to confirm the Pine Script tools are listed.
If you're using another tool that supports MCP servers (like Cursor, Windsurf, etc.), point it at:
npx -y pinescript-mcp-server
using the stdio transport. Check your tool's documentation for how to add MCP servers.
Once installed, just chat with Claude normally. It will automatically use the Pine Script tools when relevant. Here are some things you can ask:
ta.rsi, hline, bgcolor, and writes correct v6 codestrategy.exit examples with the right syntaxBehind the scenes, Claude has 5 tools it can call to get accurate Pine Script information. You don't call these directly — Claude picks the right one based on your question. Here's what each one does with real examples of the data they return:
pine_reference — Look up any function or variableThe go-to tool. Give it a function name and get back the full signature, parameters, description, and code example. It even resolves short names automatically.
Ask: "What does ta.rsi do?"
Claude gets back:
# ta.rsi
`ta.rsi(source, length) → series float`
## Parameters
- source (series int/float)
- length (simple int)
## Description
Relative strength index. It is calculated using the ta.rma() of upward
and downward changes of source over the last length bars.
## Example
//@version=6
indicator("ta.rsi")
plot(ta.rsi(close, 7))
## See Also
- ta.rma: Moving average used in RSI. It is the exponentially weighted
moving average with alpha = 1 / length.
Short names work too — asking for "sma" automatically resolves:
"sma" resolves to ta.sma
# ta.sma
`ta.sma(source, length) → series float`
You can also request just the signature (format: "signature") or just code examples (format: "examples") to save tokens.
pine_search — Search all documentation by keywordFull-text search across the entire reference manual and user guide. Results are ranked by relevance using BM25 scoring, with fuzzy matching for typos.
Ask: "Search for bollinger bands"
Claude gets back:
### Result 1 (score: 18.29, source: manual)
**ta.bbw()** — pinescriptv6_complete_reference.md
Bollinger Bands Width. The Bollinger Band Width is the difference between
the upper and the lower Bollinger Bands divided by the middle band.
### Code Example
//@version=6
indicator("ta.bbw")
plot(ta.bbw(close, 5, 4))
### Result 2 (score: 15.06, source: docs)
**Other timeframes and data** — concepts/other-timeframes-and-data.md
...
Each result includes the relevance score, source (reference manual vs. user guide), and the matching content with code blocks preserved.
pine_categories — Browse what's availableDon't know what functions exist? This tool lists all 48 categories and their entry counts, or drills into a specific category to show every function with a description.
Ask: "What categories are available?"
Claude gets back:
# Reference Categories
- adjustment (3 entries)
- alert (3 entries)
- array (56 entries)
- color (24 entries)
- input (13 entries)
- math (28 entries)
- strategy (96 entries)
- ta (67 entries)
- table (23 entries)
... (48 categories total)
Ask: "Show me the ta category"
Claude gets back:
# ta (67 entries)
- ta.accdist: Accumulation/distribution index.
- ta.alma: Arnaud Legoux Moving Average.
- ta.atr: Function atr (average true range) returns the RMA of true range.
- ta.bb: Bollinger Bands. A Bollinger Band is a technical analysis tool...
- ta.cci: The CCI (commodity channel index) is calculated as the difference...
- ta.ema: Exponential moving average...
- ta.rsi: Relative strength index...
- ta.sma: The sma function returns the moving average...
... (67 entries total)
pine_guide — Read user guide topicsRetrieves conceptual guides from the Pine Script user manual — execution model, strategies, plotting, timeframes, and more. These explain how things work, not just function signatures.
Ask: "How does the execution model work?"
Claude gets back:
# concepts > execution-model
Pine Script® relies on an event-driven, sequential execution model to
control how a script's compiled source code runs in charts, alerts,
Deep Backtesting mode, and the Pine Screener.
In contrast to the traditional execution model of most programming
languages, Pine's runtime system executes a script repeatedly on the
sequence of historical bars and realtime ticks in the dataset on which
it runs, performing separate calculations for each bar as it progresses.
...
Set listTopics: true to see all 82 available guide topics grouped by section.
pine_examples — Find code examplesSearches specifically for code blocks across all documentation. Great when you want to see how something is used in practice, not just read about it.
Ask: "Find examples of strategy stop loss"
Claude gets back:
//@version=6
strategy("My strategy", overlay = true, process_orders_on_close = true)
bracketTickSizeInput = input.int(1000, "Stoploss/Take-Profit distance (in ticks)")
longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
if (longCondition)
limitLevel = close * 1.01
strategy.order("My Long Entry Id", strategy.long, limit = limitLevel)
strategy.exit("Exit", "My Long Entry Id", profit = bracketTickSizeInput, loss = bracketTickSizeInput)
These are guided workflows you can trigger. In Claude Code, type the prompt name; in Claude Desktop, they appear in the tool menu.
| Prompt | What It Does |
|---|---|
write_indicator | Walks you through creating a new Pine Script indicator step by step |
debug_strategy | Gives you a systematic checklist for finding bugs in your strategy |
migrate_script | Helps you convert a script from v1–v5 to the latest v6 syntax |
These are reference pages Claude can pull up at any time for quick context:
| Resource | What It Is |
|---|---|
pinescript://manifest | A directory of everything indexed — all 48 categories, function counts, and 82 guide topics |
pinescript://cheatsheet | A quick-reference card with the most common Pine Script v6 syntax patterns |
Node.js isn't installed. Download it from nodejs.org and run the installer. After installing, close and reopen your terminal, then try again.
claude mcp list to check if pinescript appears. If not, run the install command again."sma" instead of "simple moving average calculation""bollinger" finds ta.bb, "macd" finds ta.macdpine_categories to browse what's availableRun this command to verify the server is working:
npx pinescript-mcp-server --check
You should see output like:
Health check passed.
Chunks: 2822
Functions: 899
Guide topics: 82
If that works, the server is fine — the issue is likely in how your AI tool connects to it. Check the config steps above.
Still stuck? Open an issue on GitHub.
This package bundles the complete Pine Script v6 documentation so Claude doesn't need to fetch anything from the internet:
If you want to contribute or run this locally:
git clone https://github.com/TradersPost/pine-mcp.git
cd pine-mcp
npm install
npm run build
npm start
Other useful commands:
npm run dev # Run in development mode (auto-reloads)
node dist/index.js --check # Verify everything loads correctly
node dist/index.js --help # See all CLI options
MIT — free to use, modify, and distribute.
FAQs
MCP server for Pine Script v6 documentation - search, reference lookup, guides, and examples
We found that pinescript-mcp-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.