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:
Public Server (No Install Required)
No Python or uvx needed — connect directly to the hosted server.
Streamable HTTP — Claude Code, mcpServers with type field):
Windsurf — uses its own shape (see Windsurf docs). Edit ~/.codeium/windsurf/mcp_config.json:
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:
Without pinning, uvx pinescript-mcp gets the latest version.
Available Tools
Available Prompts
Available Resources
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
License
MIT