pinescript
A Model Context Protocol (MCP) server for working with TradingView PineScript
claude mcp add --transport stdio cklose2000-pinescript-mcp-server npx -y pinescript-mcp-server
How to use
The PineScript MCP Server provides a centralized environment for creating, optimizing, and managing Pine Script trading strategies. It exposes core capabilities such as strategy editing, backtesting, performance analysis, and optimization, along with optional TradingView integration. You can access a web-based UI for workflow management or run a headless server via CLI to perform automated tasks. Typical usage starts by launching the MCP server with npx pinescript-mcp-server, after which you can interact with the UI or API to create and tune Pine Script strategies, run backtests, compare performance across parameter sets, and export TradingView-ready code. If you prefer a desktop-oriented workflow, you can integrate it with Claude Desktop to streamline AI-assisted strategy development, backtesting, and optimization directly from your environment.
How to install
Prerequisites:
- Node.js v18 or higher
- npm v8 or higher
Installation steps:
-
Ensure Node.js and npm are installed: node -v npm -v
-
Install or run the MCP server via NPX (no global install required): npm install -g npm@latest npx -y pinescript-mcp-server
-
Optional: pin the package version or install locally in a project: mkdir my-pinescript-mcp && cd my-pinescript-mcp npm init -y npm install pinescript-mcp-server
Then run via npx in the project context
-
Start the server and access the UI (default port typically 3001 per project docs): npx -y pinescript-mcp-server Open http://localhost:3001 in your browser.
Notes:
- If you need an alternative startup method, refer to project-specific scripts or CLI options documented in the repository.
Additional notes
Tips and troubleshooting:
- If the UI cannot connect, ensure firewall rules allow traffic to port 3001 and try the firewall helper script (if provided in the repo).
- On first run, dependencies may be installed; allow network access and enough disk space for npm install.
- For Claude Desktop integration, you can register the MCP server using the npx pinescript-mcp-server command and then reference it in Claude with appropriate command-line args, e.g., npx --args pinescript-mcp-server.
- Environment variables are typically optional, but you may configure API keys, data sources, or TradingView integration settings via your .mcp.json or environment to tailor data access and backtesting.
- Common commands listed in the repository’s scripts under scripts/ can help with UI server management, port cleanup, and alternative server modes (Express/Electron) if needed.
Related MCP Servers
generative-ui-playground
Interact with all three types of generative UI, all in one interface
freepik
The Freepik enables popular agent Model Context Protocol (MCP) to integrate with Freepik APIs through function calling.
language
MCP server from alexwohletz/language-server-mcp
html-to-markdown
MCP server for converting HTML to Markdown using Turndown.js. Fetch web pages and convert them to clean, formatted Markdown.
mcp-doc-forge
MCP server that provides doc forge capabilities
mcp -client-spring-ai
MCP server from mohamedYoussfi/mcp-server-client-spring-ai