Skip to main content

MCP server providing Pine Script v6 documentation for AI assistants

Project description

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

Usage with Claude Code

Add to .mcp.json in your project (recommended):

{
  "mcpServers": {
    "pinescript-docs": {
      "type": "stdio",
      "command": "uvx",
      "args": ["pinescript-mcp"]
    }
  }
}

Usage with Claude Desktop

Add to ~/.config/claude/claude_desktop_config.json:

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

Alternative: pip install

If you prefer pip over uvx:

pip install pinescript-mcp

Note: "command": "pinescript-mcp" only works if the install location is in your PATH. The uvx method above is more reliable as it handles environments automatically.

Public Server (No Install Required)

Connect directly to the hosted server - no Python or uvx needed:

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

Available Tools

Tool Description
list_docs() List all documentation files with descriptions
get_doc(path) Read a specific documentation file
search_docs(query) Full-text search across all docs
get_functions(namespace) List valid functions (ta, strategy, etc.)
validate_function(name) Check if a function exists in Pine v6
resolve_topic(query) Map a question to relevant docs
get_manifest() Get routing guidance for topics

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

Development

# Clone and install locally
git clone https://gitlab.com/articat1066/pinescript-v6-mcp
cd pinescript-mcp
pip install -e .

# Run the server
pinescript-mcp

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pinescript_mcp-0.2.1.tar.gz (324.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pinescript_mcp-0.2.1-py3-none-any.whl (352.4 kB view details)

Uploaded Python 3

File details

Details for the file pinescript_mcp-0.2.1.tar.gz.

File metadata

  • Download URL: pinescript_mcp-0.2.1.tar.gz
  • Upload date:
  • Size: 324.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pinescript_mcp-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5ca1cbe032d10591f880f3c722a88d3a45ad5d53261efb89932bc97785c24a4a
MD5 20eda0f1940fc62ba94288b860ac28f1
BLAKE2b-256 4687f63fe504ecc1b19ba583acce8270557f8af03ca84cacd0468a8aa18a1210

See more details on using hashes here.

File details

Details for the file pinescript_mcp-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pinescript_mcp-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 352.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pinescript_mcp-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f3845fb4aa6c4ecc1bf5a6c1d988eff9f58b704756db5a3b120828ac9ac58897
MD5 d3451f1fda2088a768afe5812c1c5819
BLAKE2b-256 a6177783c0d20bc8d81499ab31031a61cbfc816a2f77eedcbf46df1bc742053c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page