PineScript MCP Server
Generates TradingView-compatible PineScript code and integrates with TradingView for strategy creation, backtesting, and performance analysis.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PineScript MCP Servercreate a simple moving average crossover strategy"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PineScript MCP Project
A comprehensive tool for creation, optimization, and management of PineScript trading strategies.
Project Structure
├── src/ # Core application code
├── ui/ # Next.js web interface
├── dist/ # Compiled JavaScript
├── docs/ # Documentation
├── scripts/ # Utility scripts
│ ├── server/ # Server management scripts
│ ├── network/ # Network diagnostics scripts
│ └── docs/ # Documentation
├── data/ # Data files
├── tests/ # Application tests
├── examples/ # Example scripts and strategies
└── memory-bank/ # Project context and informationQuick Start
Install dependencies:
npm installStart the UI (choose one method):
# Standard Next.js development server npm run ui # Clean start with port cleanup npm run ui:clean # Alternative Express server (if Next.js has issues) npm run ui:express # Desktop app (no web server required) npm run ui:electronAccess the web interface at:
http://localhost:3001(Not required for the desktop app option)
UI Options
The project includes multiple ways to access the UI:
1. Next.js Development Server
# Standard Next.js dev server
npm run ui
# Clean start (kills any existing processes using the ports)
npm run ui:clean
# Start with administrator privileges (for stubborn processes)
npm run ui:admin2. Alternative Server Options
# Simple Express server (more stable alternative)
npm run ui:express
# Basic HTML test page server
npm run ui:test3. Desktop Application
For environments where web servers have connectivity issues:
# Electron desktop application (no web server required)
npm run ui:electronTroubleshooting UI Server
If you experience connection issues with the UI server:
Check your firewall settings
Run the firewall exception script:
npm run firewall:allowSee the
scripts/docs/ui-connect-guide.mdfor detailed connection troubleshootingTry the desktop app option:
npm run ui:electron
Utility Scripts
The repository includes several utility scripts to help with development and troubleshooting:
Essential Server Scripts (in scripts/server/)
run-ui-clean.bat- Main script to start the UI server (cleans up existing processes)run-ui-admin.bat- Starts the UI server with administrator privilegesserve-test-page.bat- Serves a simple HTML test page on port 8000 to test connectivityrun-express-server.bat- Starts an Express server as an alternative to Next.jsrun-electron-app.bat- Starts the Electron desktop application (no web server required)
Network Troubleshooting (in scripts/network/)
check-connectivity.bat- Comprehensive network connectivity diagnosticscheck-windows-firewall.bat- Check firewall status and rulesallow-node-firewall.bat- Add Node.js to Windows Firewall exceptionstest-network-connection.bat- Test specific network connectionstest-port-3000.bat- Test if port 3000 is availablekill-port-3000.bat- Kill any process using port 3000
Documentation (in scripts/docs/)
ui-connect-guide.md- Comprehensive guide to UI connectivity troubleshootingREADME-UI.md- UI-specific documentation
Development
Prerequisites
Node.js (v18 or higher)
npm (v8 or higher)
Building the Project
npm run buildRunning Tests
npm testFeatures
Strategy creation and editing
Backtesting capabilities
Performance analysis
Strategy optimization
TradingView integration
Claude Desktop Integration
The PineScript MCP Server can be integrated with Claude Desktop to provide AI-assisted PineScript development capabilities.
Quick Start (macOS)
# Install and configure with one command
npx pinescript-mcp-server
# Or add to Claude Desktop
claude mcp add pinescript-server npx --args pinescript-mcp-serverQuick Start (Windows)
# Add to Claude Desktop with Windows-specific wrapper
claude mcp add pinescript-server cmd --args /c npx pinescript-mcp-serverDocumentation
For detailed setup instructions, platform-specific configurations, and troubleshooting:
Example Configurations
.mcp.json.example - Basic configuration
.mcp.json.mac.example - macOS-specific example
.mcp.json.windows.example - Windows-specific example
Features Available in Claude Desktop
When integrated with Claude Desktop, you can:
Create and edit PineScript strategies
Run backtests and analyze performance
Optimize trading parameters
Generate TradingView-compatible code
Access real-time market data (with proper API configuration)
Documentation
See the docs/ directory for detailed documentation on:
API Reference
User Guide
Development Guide
License
This project is proprietary and confidential.
Copyright © 2025. All rights reserved.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cklose2000/pinescript-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server