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

Installation

pip install pinescript-mcp

Usage with Claude Desktop

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

{
  "mcpServers": {
    "pinescript-docs": {
      "command": "pinescript-mcp"
    }
  }
}

Usage with Claude Code

Add to .mcp.json in your project:

{
  "mcpServers": {
    "pinescript-docs": {
      "type": "stdio",
      "command": "pinescript-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.supertrend doesn't exist)
  • Deprecated syntax from v4/v5
  • Incorrect parameter orders
  • Missing required arguments

Development

# Clone and install locally
git clone https://github.com/bch/pinescript-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.1.0.tar.gz (325.1 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.1.0-py3-none-any.whl (351.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pinescript_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 daaf0b6df4226692de1de30870f6ff0dae159a865a94ae90f23a9745754a3bc4
MD5 207d40de53f9899725d3f7ba3ca92845
BLAKE2b-256 f81d72ec787060fa500a06e2a5830794622fecb17bd5f42f50138f5486659363

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pinescript_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 578e736e97509bf8b9e7a3ad6738a73e314ec1cbeb5d10d84c3980d33908bb4c
MD5 e980df2113119aa353e8a35cfe85092f
BLAKE2b-256 af587c96ce8e9ad512ad7b89ed5ae9d83df51aa036d7aa44b7b3bde407d569c3

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