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:
-
Open Cursor Settings:
- Press
Cmd+,(macOS) orCtrl+,(Windows/Linux) - Go to "Extensions" → "MCP"
- Press
-
Add Server Configuration:
{ "mcpServers": { "pinescript-syntax-checker": { "command": "python", "args": ["-m", "pinescript_syntax_checker.server"] } } }
-
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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pinescript_syntax_checker-0.1.0.tar.gz.
File metadata
- Download URL: pinescript_syntax_checker-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ac1c1a6b090d9daa883a8420e7c7037ca6d56f5715045d0a64d8949ece3723f
|
|
| MD5 |
3fedbfa14a6032d9af5338d7092176de
|
|
| BLAKE2b-256 |
3d83817720bd169c6a6469df576b6ce54eebea8cd2dbd483204ab3f2e272a27d
|
File details
Details for the file pinescript_syntax_checker-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pinescript_syntax_checker-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3890b68df3945f44c4d494070b7bf2c8eeaf89074386d32b8f1aed49323be11
|
|
| MD5 |
b191ba60c81146f6f4d4966f5c05e074
|
|
| BLAKE2b-256 |
90ece942dd964ce4878cb125f865ce5dc44baa8dcdd088a31871b44015147d21
|