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)

# Install and run directly
uvx pinescript-syntax-checker

# Or install first, then run
uvx install pinescript-syntax-checker
uvx run pinescript-syntax-checker

Option 2: Using uv

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

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

Install MCP Server

# If using uvx
uvx pinescript-syntax-checker --mcp-install

# If using local development
uv run mcp install run_server.py

Configure in Cursor

Method 1: No Configuration Required (Recommended)

After installing with uvx, the server will be automatically available in Cursor.

Method 2: Manual Configuration

If you need manual configuration:

  1. Open Cursor Settings:

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

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

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

pinescript_syntax_checker-0.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

pinescript_syntax_checker-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pinescript_syntax_checker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3ac1c1a6b090d9daa883a8420e7c7037ca6d56f5715045d0a64d8949ece3723f
MD5 3fedbfa14a6032d9af5338d7092176de
BLAKE2b-256 3d83817720bd169c6a6469df576b6ce54eebea8cd2dbd483204ab3f2e272a27d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pinescript_syntax_checker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3890b68df3945f44c4d494070b7bf2c8eeaf89074386d32b8f1aed49323be11
MD5 b191ba60c81146f6f4d4966f5c05e074
BLAKE2b-256 90ece942dd964ce4878cb125f865ce5dc44baa8dcdd088a31871b44015147d21

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