Get the FREE Ultimate OpenClaw Setup Guide →

pinescript

A Model Context Protocol (MCP) server for working with TradingView PineScript

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Ensure Node.js and npm are installed: node -v npm -v

  2. Install or run the MCP server via NPX (no global install required): npm install -g npm@latest npx -y pinescript-mcp-server

  3. 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

  4. 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

Sponsor this space

Reach thousands of developers