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 分