PineScript Docs
pinescript-mcp is an MCP server providing Pine Script v6 documentation, validation, and AI-assistance tools to enable accurate Pine Script code generation and prevent hallucinations.
Documentation Access & Navigation:
list_docs()— Browse all available Pine Script v6 documentation fileslist_sections(path)— List section headers within a doc fileget_doc(path)— Read a full documentation fileget_section(path, header)— Read a specific section by its header
Search & Lookup:
resolve_topic(query)— Fast lookup for exact API terms (e.g.,ta.rsi,strategy.entry) or concepts (e.g.,repainting)search_docs(query)— Grep-style search across all documentation
Function Validation & Reference:
get_functions(namespace)— List all valid Pine Script v6 functions, optionally filtered by namespace (e.g.,ta,strategy,request)validate_function(name)— Check whether a function exists in Pine Script v6, with suggestions if invalid
Linting & Code Editing:
lint_script(script)— Static analysis for syntax errors, style issues, and undeclared identifiersedit_and_lint(script_id, edits)— Apply line-level edits to a previously linted script and re-lint (note: removed in v0.7.0; available in earlier versions)
Resources & Prompts:
list_resources()/read_resource(uri)— Access documentation resources by URI (e.g.,docs://manifest,docs://functions)list_prompts()/get_prompt(name, arguments)— Use built-in prompt templates for debugging errors (debug_error), converting v5 to v6 (convert_v5_to_v6), and explaining functions (explain_function)
The server supports multiple integration methods (stdio, HTTP, SSE) and is compatible with clients like Claude, ChatGPT, and Windsurf.
Provides comprehensive access to Pine Script v6 documentation, technical analysis functions, and syntax validation tools, enabling AI agents to accurately generate, debug, and convert TradingView scripts.
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 Docsconvert this v5 script to v6 syntax"
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-mcp
MCP server providing Pine Script v6 documentation for AI assistants (Claude, etc.).
Enables AI to:
Look up Pine Script functions and validate syntax
Access official documentation for indicators, strategies, and visuals
Understand Pine Script concepts (execution model, repainting, etc.)
Generate correct v6 code with proper function references
Quick Start (stdio)
Works with Claude Code, Claude Desktop, Gemini CLI, and any MCP client that supports stdio:
{
"mcpServers": {
"pinescript-docs": {
"type": "stdio",
"command": "uvx",
"args": ["pinescript-mcp"]
}
}
}Public Server (No Install Required)
No Python or uvx needed — connect directly to the hosted server.
Streamable HTTP — Claude Code, Claude Desktop, Cursor, Cline (standard mcpServers with type field):
{
"mcpServers": {
"pinescript-docs": {
"type": "http",
"url": "https://pinescript-mcp.fly.dev/mcp"
}
}
}Windsurf — uses its own serverUrl shape (see Windsurf docs). Edit ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"pinescript-docs": {
"serverUrl": "https://pinescript-mcp.fly.dev/mcp"
}
}
}ChatGPT — no config file. In ChatGPT, go to Settings → Connectors → Create and paste https://pinescript-mcp.fly.dev/mcp into the Server URL field. Developer Mode must be enabled (see OpenAI Developer Mode guide).
Claude.ai — add via the web UI's MCP connector settings, not a JSON file.
SSE (legacy transport, kept for older clients):
{
"mcpServers": {
"pinescript-docs": {
"type": "sse",
"url": "https://pinescript-mcp.fly.dev/sse"
}
}
}Streamable HTTP is preferred — SSE is being phased out across the MCP ecosystem.
Version Pinning
Documentation is bundled in the package — each version contains a frozen snapshot. For reproducible agent behaviour, pin to a specific version:
{
"mcpServers": {
"pinescript-docs": {
"command": "uvx",
"args": ["pinescript-mcp==0.7.0"]
}
}
}Without pinning, uvx pinescript-mcp gets the latest version.
Note: versions before
0.7.0includedlint_scriptandedit_and_linttools that were removed in 0.7.0 (docs-only server). Pinning to 0.6.x will give you those tools back, but the auth gate onlint_scriptwas never completed on the hosted Fly instance, so they'll return auth errors on HTTP. Pin 0.7.0+ for the current, working tool surface.
Available Tools
Tool | Description |
| Fast lookup for exact API terms ( |
| Grep for exact strings across all docs |
| List all documentation files with descriptions |
| List |
| Read a specific documentation file |
| Read a specific section by header |
| List valid functions (ta, strategy, etc.) |
| Check if a function exists in Pine v6 |
| Browse available documentation resources |
| Read a doc resource by URI (e.g. |
| List available prompt templates |
| Render a prompt template with arguments |
Available Prompts
Prompt | Description |
| Analyze a Pine Script compilation error |
| Convert Pine Script v5 code to v6 syntax |
| Explain a Pine Script function in detail |
Available Resources
URI | Description |
| Start here — routing guide for Pine Script questions |
| Complete Pine Script v6 function list (JSON) |
| Any doc file by path (e.g. |
Example Queries
"How do I create a trailing stop in Pine Script?"
"What's the difference between var and varip?"
"Is ta.supertrend a valid function?"
"How do I avoid repainting with request.security?"
Documentation Coverage
The server bundles comprehensive Pine Script v6 documentation:
Concepts: Execution model, timeframes, colors, methods, objects, common errors
Reference: Types, variables, constants, keywords, operators, annotations
Functions: Technical analysis (ta.*), strategies, requests, drawings, collections
Visuals: Plots, fills, shapes, tables, lines, boxes, backgrounds
Writing Scripts: Style guide, debugging, optimization, limitations
Why Use This?
AI models often hallucinate Pine Script functions or use deprecated v5 syntax. This MCP server grounds the AI in actual v6 documentation, preventing:
Made-up function names (e.g.,
ta.hulldoesn't exist, useta.hma)Deprecated syntax from v4/v5
Incorrect parameter orders
Missing required arguments
Skills
Combine with skills for even more control available at bouch.dev/products/pine-strategy-builder.
Development
# Clone and install locally
git clone https://gitlab.com/articat1066/pinescript-v6-mcp
cd pinescript-mcp
pip install -e .
# Run the server
pinescript-mcpLicense
MIT
Maintenance
Latest Blog Posts
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/paulieb89/pinescript-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server