PineScript MCP Server
Enables AI-assisted creation, optimization, and management of PineScript trading strategies, with backtesting and TradingView integration.
README
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 information
Quick Start
-
Install dependencies:
npm install -
Start 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:electron -
Access 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:admin
2. Alternative Server Options
# Simple Express server (more stable alternative)
npm run ui:express
# Basic HTML test page server
npm run ui:test
3. Desktop Application
For environments where web servers have connectivity issues:
# Electron desktop application (no web server required)
npm run ui:electron
Troubleshooting UI Server
If you experience connection issues with the UI server:
- Check your firewall settings
- Run the firewall exception script:
npm run firewall:allow - See the
scripts/docs/ui-connect-guide.mdfor detailed connection troubleshooting - Try 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 build
Running Tests
npm test
Features
- 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-server
Quick Start (Windows)
# Add to Claude Desktop with Windows-specific wrapper
claude mcp add pinescript-server cmd --args /c npx pinescript-mcp-server
Documentation
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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。