Skip to main content

A Model Context Protocol (MCP) server for checking PineScript syntax using TradingView's API

Project description

PineScript Syntax Checker MCP Server

A Model Context Protocol (MCP) server for checking PineScript syntax using TradingView's API.

Features

  • Check PineScript syntax using TradingView's official API
  • MCP-compatible server with httpx for async HTTP requests
  • Detailed error reporting with line and column information

Quick Start

Option 1: Using uvx (Recommended)

# Run directly (will install automatically if needed)
uvx pinescript-syntax-checker

Option 2: Using uv (Development)

# Clone and run
git clone https://github.com/erevus-cn/pinescript-syntax-checker.git
cd pinescript-syntax-checker
uv sync
uv run python -m pinescript_syntax_checker.server

Option 3: Using pip

# Install from PyPI
pip install pinescript-syntax-checker

# Run directly
pinescript-syntax-checker

# Or as module
python -m pinescript_syntax_checker.server

MCP Integration

Configure in Cursor

To use this MCP server in Cursor:

  1. Open Cursor Settings:

    • Press Cmd+, (macOS) or Ctrl+, (Windows/Linux)
    • Go to "Extensions" → "MCP"
  2. Add Server Configuration:

    Method 1 - Using uvx (Recommended):

    {
      "mcpServers": {
        "pinescript-syntax-checker": {
          "command": "uvx",
          "args": ["pinescript-syntax-checker"]
        }
      }
    }
    

    Method 2 - Using installed package:

    {
      "mcpServers": {
        "pinescript-syntax-checker": {
          "command": "python",
          "args": ["-m", "pinescript_syntax_checker.server"]
        }
      }
    }
    
  3. Restart Cursor to load the MCP server

Verify Installation

To verify the MCP server is working correctly:

  1. In Cursor: After configuration, try asking:
    Can you check this PineScript code for syntax errors?
    
    //@version=5
    indicator("Test", overlay=true)
    plot(close)
    

API

check_syntax

Checks PineScript syntax using TradingView's API.

Parameters:

  • pine_code (str): The PineScript code to check

Example

Input:

//@version=5
strategy("Test")
plot(close)

Output:

{
  "success": true,
  "result": {
    "variables": [],
    "functions": [],
    "types": [],
    "enums": [],
    "scopes": []
  }
}

License

MIT License

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

Built Distribution

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

File details

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

File metadata

  • Download URL: iflow_mcp_erevus_pinescript_syntax_checker-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_erevus_pinescript_syntax_checker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c1c29936ed3c9db45564e9ea4d96e937c8f4b51e040a4241fbc814efa976ecd7
MD5 0495ab45b74d5ce67d7254a248845668
BLAKE2b-256 b8779f90767e40183dd0671f99d1c65fafd8778b2ba07b16c4ad89479333590a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iflow_mcp_erevus_pinescript_syntax_checker-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_erevus_pinescript_syntax_checker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd171eb4de0f33782c016e5afbe7f1a3d26338e7a69927f399628c3142ef6346
MD5 f85bbaa59440d34aa220db18d433993b
BLAKE2b-256 c7ade4681cd0b08c6652a44371a4c717077380faf5faaa0089ba078427d48574

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