Hosted MCP server · #98 most used on Smithery

pinescript

bouch/pinescript

MCP server providing Pine Script v6 documentation for AI assistants. 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

Uses
5.8k
Tools
10
Runs
Hosted
Prompts
3
Listed
6mo ago

Get started

Add it to your agent

npx -y @smithery/cli@latest install bouch/pinescript --client claude

Swap --client claude for cursor, vscode, windsurf or another client. The CLI asks for any required settings.

What it can do

10 tools

list_docsList all available Pine Script v6 documentation files with descriptions. Returns files organised by category with descriptions. For small…

List all available Pine Script v6 documentation files with descriptions. Returns files organised by category with descriptions. For small files use get_doc(path). For large files (ta.md, strategy.md, collections.md, drawing.md, general.md) use list_sections(path) then get_section(path, header).

list_sections1 paramList all section headers in a doc file. Use before get_section() to find the right header. Especially useful for large files like ta.md, …

List all section headers in a doc file. Use before get_section() to find the right header. Especially useful for large files like ta.md, strategy.md, collections.md, drawing.md, general.md which have 50-115 sections each.

ParameterTypeDescription
pathstringDocumentation file path (e.g., "reference/functions/ta.md")
get_doc3 paramsRead a specific Pine Script v6 documentation file. For large files (ta.md, strategy.md, collections.md, drawing.md, general.md) prefer li…

Read a specific Pine Script v6 documentation file. For large files (ta.md, strategy.md, collections.md, drawing.md, general.md) prefer list_sections() + get_section() to avoid loading 1000-2800 line files into context.

ParameterTypeDescription
pathstringRelative path to the documentation file (e.g., "reference/functions/ta.md")
limitintegerMaximum characters to return. Use 30000 for large files to avoid token limits.
offsetintegerCharacter offset to start reading from (default: 0)
get_section3 paramsGet a specific section from a documentation file by its header. Use after list_sections() shows available headers, or after resolve_topic…

Get a specific section from a documentation file by its header. Use after list_sections() shows available headers, or after resolve_topic() / search_docs() identifies the relevant file.

ParameterTypeDescription
pathstringDocumentation file path (e.g., "reference/functions/strategy.md")
headerstringHeader text to find (e.g., "strategy.exit()" or "## strategy.exit()")
include_childrenbooleanInclude nested subsections under the header (default: True)
search_docs2 paramsSearch Pine Script v6 documentation and return matching sections. Finds sections containing the query and returns previews with get_secti…

Search Pine Script v6 documentation and return matching sections. Finds sections containing the query and returns previews with get_section() call hints so you can read the full content.

ParameterTypeDescription
querystringExact string to search for (case-insensitive).
max_resultsintegerMaximum sections to return (default: 5)
get_functions1 paramGet valid Pine Script v6 functions, optionally filtered by namespace. Use before writing Pine Script to see which functions exist. For ch…

Get valid Pine Script v6 functions, optionally filtered by namespace. Use before writing Pine Script to see which functions exist. For checking a single function name, use validate_function() instead.

ParameterTypeDescription
namespacestringFilter by namespace (e.g., "ta", "strategy", "request"). Empty string returns all functions grouped by namespace.
validate_function1 paramCheck if a Pine Script v6 function name is valid.
ParameterTypeDescription
fn_namestringFunction name to validate (e.g., "ta.sma", "strategy.entry", "plot")
resolve_topic1 paramFast lookup for exact Pine Script API terms and known concepts. Use for exact function names and Pine Script vocabulary (e.g., "ta.rsi", …

Fast lookup for exact Pine Script API terms and known concepts. Use for exact function names and Pine Script vocabulary (e.g., "ta.rsi", "strategy.entry", "repainting", "request.security"). For natural language questions, read the docs://manifest resource for routing guidance, then use get_doc() or list_sections() + get_section().

ParameterTypeDescription
querystringExact Pine Script term or known concept keyword.
list_promptsList all available prompts. Returns JSON with prompt metadata including name, description, and optional arguments.
get_prompt2 paramsGet a prompt by name with optional arguments. Returns the rendered prompt as JSON with a messages array. Arguments should be provided as …

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.

ParameterTypeDescription
namestringThe name of the prompt to get
argumentsOptional arguments for the prompt

Ready-made

Prompts

  • debug_errorDebug a Pine Script compilation error.
  • convert_v5_to_v6Convert Pine Script v5 code to v6.
  • explain_functionExplain a Pine Script function in detail.

Readable data

Resources

  • LLM ManifestSTART HERE — routing guide that maps Pine Script questions to documentation files and tool call sequences
  • Pine Script v6 FunctionsComplete list of valid Pine Script v6 functions as JSON