PineScript MCP项目
一个用于创建、优化和管理PineScript交易策略的综合工具。
项目结构
├── 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快速开始
- 安装依赖项:
npm install- 启动UI(选择一种方法):
# 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- 访问web界面:
http://localhost:3001(桌面应用程序选项不需要)
UI选项
该项目包括多种访问UI的方式:
1.Next.js开发服务器
# 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.替代服务器选项
# Simple Express server (more stable alternative)
npm run ui:express
# Basic HTML test page server
npm run ui:test3.桌面应用程序
对于web服务器存在连接问题的环境:
# Electron desktop application (no web server required)
npm run ui:electronUI服务器故障排除
如果您遇到UI服务器的连接问题:
- 检查防火墙设置
- 运行防火墙例外脚本:
npm run firewall:allow - 请参阅
scripts/docs/ui-connect-guide.md用于详细的连接故障排除 - 尝试桌面应用程序选项:
npm run ui:electron
实用程序脚本
该存储库包括几个实用程序脚本,以帮助开发和故障排除:
基本服务器脚本(在Scripts/Server/中)
run-ui-clean.bat-启动UI服务器的主脚本(清理现有进程)run-ui-admin.bat-以管理员权限启动UI服务器serve-test-page.bat-在端口8000上提供一个简单的HTML测试页面来测试连接run-express-server.bat-启动Express服务器作为Next.js的替代方案run-electron-app.bat-启动Electron桌面应用程序(不需要web服务器)
网络故障排除(在脚本/Network/中)
check-connectivity.bat-全面的网络连接诊断check-windows-firewall.bat-检查防火墙状态和规则allow-node-firewall.bat-将Node.js添加到Windows防火墙例外test-network-connection.bat-测试特定网络连接test-port-3000.bat-测试端口3000是否可用kill-port-3000.bat-使用端口3000终止任何进程
文档(在scripts/docs/中)
ui-connect-guide.md-UI连接故障排除综合指南README-UI.md-UI特定文档
发展
先决条件
- Node.js(v18或更高版本)
- npm(v8或更高版本)
建设项目
npm run build运行测试
npm test特性
- 战略创建和编辑
- 回测能力
- 性能分析
- 策略优化
- TradingView集成
Claude桌面集成
PineScript MCP服务器可以与Claude Desktop集成,提供人工智能辅助的PineScript开发功能。
快速入门(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快速入门(Windows)
# Add to Claude Desktop with Windows-specific wrapper
claude mcp add pinescript-server cmd --args /c npx pinescript-mcp-server文档
有关详细的设置说明、特定于平台的配置和故障排除:
示例配置
- .mcp.json.示例 -基本配置
- .mcp.json.mac示例 -macOS特定示例
- .mcp.json窗口示例 -Windows特定示例
Claude Desktop中提供的功能
与Claude Desktop集成后,您可以:
- 创建和编辑PineScript策略
- 运行回溯测试并分析性能
- 优化交易参数
- 生成与TradingView兼容的代码
- 访问实时市场数据(使用正确的API配置)
文档
请参阅 docs/ 详细文档目录:
- api参考
- 用户指南
- 开发指南
许可证
该项目是专有和机密的。
版权所有©2025。保留所有权利。
