Pine Script v6 Documentation

io.github.paulieb89由 GitHub 帳號 paulieb89 發布v0.6.17更新於 Oct 24, 2026

Pine Script v6 documentation lookup, function validation, and linting for AI code generation

已驗證Streamable HTTP可網頁執行知識與記憶開發者工具

概覽

AI 產生的概覽

提供內建的 Pine Script v6 文件,讓助理在撰寫指標與策略前查詢函式、閱讀參考章節並驗證函式名稱是否有效。

可以做什麼
在內建的 Pine Script v6 文件中搜尋與解析主題,回傳依符合度排序的章節預覽與後續操作提示。瀏覽並讀取文件檔案,列出檔案章節,並依標題取得指定章節內容。依命名空間列出有效的 v6 函式,並驗證函式名稱,對已棄用或不存在的名稱提供替代提示。列出並渲染內建提示範本,例如分析編譯錯誤或將 v5 程式碼轉換為 v6。
適用情境
適合助理撰寫或審查 Pine Script v6 指標與策略時使用,需要可靠的函式名稱、參數說明與概念解釋,而不是憑空猜測。也適合確認某個函式是否存在,或轉換舊的 v5 程式碼。
執行需求
可以連線託管的遠端端點(streamable HTTP),也可以用 uvx 在本機執行 PyPI 套件(需要 Python 工具鏈)。未宣告需要帳號、API 金鑰或環境變數。文件隨套件內建,本機使用無需網路存取。
安裝前請注意
僅供唯讀的文件查詢,不涉及寫入、付款或憑證。託管端點會接收你的查詢內容,請勿向其傳送敏感程式碼或資料。本機安裝若未固定版本會取得最新版,內建文件快照可能變動;如需可重現行為請固定版本。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Pine Script v6 Documentation,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.paulieb89%2Fpinescript-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "pine-script-v6-documentation": {
      "type": "http",
      "url": "https://pinescript-mcp.fly.dev/mcp"
    }
  }
}

README

pinescript-mcp

[PyPI] [Glama] [smithery badge] [Install in VS Code] [Install in VS Code Insiders] [Install in Cursor] [Install in VS Code (local)]

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:

json
{  "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, mcpServers with type field):

json
{  "mcpServers": {    "pinescript-docs": {      "type": "http",      "url": "https://pinescript-mcp.fly.dev/mcp"    }  }}

Windsurf — uses its own shape (see Windsurf docs). Edit ~/.codeium/windsurf/mcp_config.json:

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.

Version Pinning

Documentation is bundled in the package — each version contains a frozen snapshot. For reproducible agent behaviour, pin to a specific version:

json
{  "mcpServers": {    "pinescript-docs": {      "command": "uvx",      "args": ["pinescript-mcp==0.7.6"]    }  }}

Without pinning, uvx pinescript-mcp gets the latest version.

Available Tools

ToolDescription
resolve_topic(query)Fast lookup for exact API terms (ta.rsi, repainting)
search_docs(query)Grep for exact strings across all docs
list_docs()List all documentation files with descriptions
list_sections(path)List ## headers in a doc file (for navigating large files)
get_doc(path)Read a specific documentation file
get_section(path, header)Read a specific section by header
get_functions(namespace)List valid functions (ta, strategy, etc.)
validate_function(name)Check if a function exists in Pine v6
list_resources()Browse available documentation resources
read_resource(uri)Read a doc resource by URI (e.g. docs://manifest)
list_prompts()List available prompt templates
get_prompt(name, arguments)Render a prompt template with arguments

Available Prompts

PromptDescription
debug_error(error, code)Analyze a Pine Script compilation error
convert_v5_to_v6(code)Convert Pine Script v5 code to v6 syntax
explain_function(name)Explain a Pine Script function in detail

Available Resources

URIDescription
docs://manifestStart here — routing guide for Pine Script questions
docs://functionsComplete Pine Script v6 function list (JSON)
docs://{path}Any doc file by path (e.g. concepts/timeframes.md)

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.hull doesn't exist, use ta.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

bash
# Clone and install locallygit clone https://github.com/paulieb89/pinescript-mcpcd pinescript-mcppip install -e .
# Run the serverpinescript-mcp

License

MIT

來源:README.md,提交 28acf2c

工具

10

list_docs

USE WHEN discovering what Pine Script v6 documentation is available. Returns a categorised list of doc file paths with one-line descriptions. AFTER calling this tool, call get_doc(path) for small files or list_sections(path) then get_section(path, header) for large files (ta.md, strategy.md, collections.md, drawing.md, general.md). Data sourced from bundled Pine Script v6 documentation.

無需輸入參數。

list_sections

USE WHEN navigating a large documentation file before reading a specific section. Returns a newline-separated list of # and ## headers (### excluded) in the file. AFTER calling this tool, call get_section(path, header) with a header from this list. Data sourced from bundled Pine Script v6 documentation.

輸入參數path必填

get_doc

USE WHEN reading the full content of a Pine Script v6 documentation file. Returns the file content; when limit is set, a header shows the char range and offset to continue reading. AFTER calling this tool, use offset=<end> to continue if the header indicates more content is available. For large files (ta.md, strategy.md, collections.md, drawing.md, general.md), prefer list_sections() + get_section() instead. Data sourced from bundled Pine Script v6 documentation.

輸入參數path必填limitoffset

get_section

USE WHEN reading a specific named section from a Pine Script v6 documentation file. Returns the section content from the matched header to the next same-level header, with file path and line range. AFTER calling this tool, call list_sections(path) if the header was not found, or get_section() again with a child header for a narrower subsection. Data sourced from bundled Pine Script v6 documentation.

輸入參數path必填header必填include_children

search_docs

USE WHEN finding documentation sections that match specific terms across all Pine Script v6 docs. Returns up to max_results sections ranked by match count, each with a preview and a get_section() call hint. AFTER calling this tool, call get_section(file, header) for each result you want to read in full. Data sourced from bundled Pine Script v6 documentation.

輸入參數query必填max_results

get_functions

USE WHEN browsing valid Pine Script v6 functions, optionally filtered to a namespace. Returns function names grouped by namespace (e.g. ta.*, strategy.*) or filtered to the requested namespace. AFTER calling this tool, call validate_function(fn_name) to check a specific name, or get_section() to read its documentation. Data sourced from bundled pine_v6_functions.json.

輸入參數namespace

validate_function

USE WHEN confirming a Pine Script v6 function name is valid before using it in code. Returns a valid/invalid verdict with namespace suggestions or known replacement hints (e.g. ta.adx → ta.dmi, security → request.security). AFTER calling this tool, call get_functions(namespace) to list all valid functions in the relevant namespace if the function is invalid. Data sourced from bundled pine_v6_functions.json.

輸入參數fn_name必填

resolve_topic

USE WHEN looking up an exact Pine Script API term or known concept keyword. Returns the best-matching doc paths with matched keywords and a retrieval suggestion (get_doc or list_sections + get_section). AFTER calling this tool, follow the suggestion: call get_doc() for small files or list_sections() + get_section() for large files. For natural language questions use search_docs() instead. Data sourced from bundled TOPIC_MAP and doc file content scan.

輸入參數query必填

list_prompts

List all available prompts. Returns JSON with prompt metadata including name, description, and optional arguments.

無需輸入參數。

get_prompt

Get a prompt by name with optional arguments. Returns the rendered prompt as JSON with a messages array. Arguments should be provided as a dict mapping argument names to values.

輸入參數name必填arguments

版本歷史

1
  1. v0.6.17最新Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分