Skip to main content

MCP server providing Pine Script v6 documentation for AI assistants

Project description

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:

{
  "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, Claude Desktop, Cursor, Cline (standard mcpServers with type field):

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

Windsurf — uses its own serverUrl shape (see Windsurf docs). Edit ~/.codeium/windsurf/mcp_config.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.

SSE (legacy transport, kept for older clients):

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

Streamable HTTP is preferred — SSE is being phased out across the MCP ecosystem.

Version Pinning

Documentation is bundled in the package — each version contains a frozen snapshot. For reproducible agent behaviour, pin to a specific version:

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

Without pinning, uvx pinescript-mcp gets the latest version.

Note: versions before 0.7.0 included lint_script and edit_and_lint tools that were removed in 0.7.0 (docs-only server). Pinning to 0.6.x will give you those tools back, but the auth gate on lint_script was never completed on the hosted Fly instance, so they'll return auth errors on HTTP. Pin 0.7.0+ for the current, working tool surface.

Available Tools

Tool Description
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

Prompt Description
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

URI Description
docs://manifest Start here — routing guide for Pine Script questions
docs://functions Complete 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

# Clone and install locally
git clone https://github.com/paulieb89/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.7.2.tar.gz (323.5 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.7.2-py3-none-any.whl (351.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pinescript_mcp-0.7.2.tar.gz
  • Upload date:
  • Size: 323.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pinescript_mcp-0.7.2.tar.gz
Algorithm Hash digest
SHA256 c2227aa544ab2b36451be480bb94dfa62ab12fe682cc9646b110b39b1469ec49
MD5 de4e12ecf22486dea2da31568bfd501a
BLAKE2b-256 bbad380969b048492e735b7f35c60529d63c449ca1d388ef2339bec43b2fce9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pinescript_mcp-0.7.2.tar.gz:

Publisher: release.yml on paulieb89/pinescript-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: pinescript_mcp-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 351.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pinescript_mcp-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e05d8bc4ebc9178928b6c202d7ffa314c2a36c903cbc69313ca1b37f5140664e
MD5 2792a25c9f5bd18ab5c9e34cddba56ab
BLAKE2b-256 6582c6d93c475d74dfb609ce1978339c9d7a4ec87fa7f47c9056961bdd5fba6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pinescript_mcp-0.7.2-py3-none-any.whl:

Publisher: release.yml on paulieb89/pinescript-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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