PineScript

v1.0.0Finance & Fintechstable

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

pinescriptmcpai-integration
Share:
98
Stars
0
Downloads
0
Weekly
0/5

What is PineScript?

PineScript is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol (mcp) server for working with tradingview pinescript

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

This server falls under the Finance & Fintech category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Model Context Protocol (MCP) server for working with Tradi

Use Cases

Develop TradingView PineScript indicators and strategies through AI. Build algorithmic trading scripts via natural language.
cklose2000

Maintainer

LicenseMIT
Languagehtml
Versionv1.0.0
UpdatedMay 16, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx pinescript

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use PineScript

The PineScript MCP server brings TradingView PineScript development directly into AI-assisted workflows, letting you create, edit, backtest, and optimize trading indicators and strategies through natural language conversation with Claude or other MCP-compatible assistants. Instead of switching between editors and documentation tabs, you can describe a trading idea in plain English and receive working PineScript v5 code ready to paste into TradingView. The server also includes a web UI for strategy management and supports market data access for realistic backtesting.

Prerequisites

  • Node.js 18 or later installed on your system
  • npm 8 or later available in your terminal
  • A TradingView account to test generated PineScript indicators and strategies
  • Claude Desktop or another MCP-compatible AI client
  • Git to clone the repository for local development mode
1

Clone the PineScript MCP server repository

Clone the repository to your local machine so you have access to the full source, configuration examples, and the web UI.

git clone https://github.com/cklose2000/pinescript-mcp-server.git
cd pinescript-mcp-server
2

Install dependencies and build the server

Install all npm dependencies and compile the TypeScript source. The build step is required before the server can be launched or connected to Claude Desktop.

npm install
npm run build
3

Copy and configure environment variables

Copy the provided example env file and fill in any required values, such as market data API credentials if you want live data access.

cp .env.example .env
# Edit .env with your preferred text editor
4

Add the server to your MCP client configuration

Open your Claude Desktop config file and add the PineScript server. Use the absolute path to the built index.js in the dist/ directory.

{
  "mcpServers": {
    "pinescript": {
      "command": "node",
      "args": ["/absolute/path/to/pinescript-mcp-server/dist/index.js"]
    }
  }
}
5

Restart Claude Desktop and verify the connection

Fully quit and reopen Claude Desktop. Ask Claude to generate a simple moving average crossover strategy in PineScript to confirm the server tools are available.

6

(Optional) Launch the web UI for strategy management

Run the included Next.js web interface to visually browse, edit, and manage your saved PineScript strategies at http://localhost:3001.

npm run ui

PineScript Examples

Client configuration

Add this to your claude_desktop_config.json. Replace the path with the actual absolute path to the built server on your machine.

{
  "mcpServers": {
    "pinescript": {
      "command": "node",
      "args": ["/Users/yourname/pinescript-mcp-server/dist/index.js"]
    }
  }
}

Prompts to try

These prompts show how to leverage the PineScript MCP server for algorithmic trading development.

- "Write a PineScript v5 indicator that plots a 20-period EMA and 50-period EMA with a crossover alert."
- "Create a RSI divergence strategy in PineScript that goes long when RSI makes higher lows while price makes lower lows."
- "Convert this PineScript v4 script to v5 and fix any deprecated functions."
- "Add a trailing stop loss to my existing strategy and include position sizing based on ATR."
- "Backtest a Bollinger Band mean-reversion strategy on daily data and show the key performance metrics."
- "Generate a multi-timeframe momentum strategy that checks the weekly trend before taking daily entries."

Troubleshooting PineScript

The server fails to start with 'Cannot find module' errors

Ensure you ran 'npm run build' after 'npm install'. The dist/ directory must exist and contain the compiled JavaScript. Double-check the path in your MCP config points to dist/index.js, not the TypeScript source.

Generated PineScript code has compilation errors in TradingView

Specify the PineScript version explicitly in your prompt, e.g. 'Write a PineScript v5 indicator...'. PineScript v4 and v5 have significant syntax differences, and v5 is the current TradingView standard.

Port conflict when starting the web UI

If port 3001 is already in use, run 'npm run ui:clean' which includes automatic port cleanup, or set the PORT environment variable to an available port before running 'npm run ui'.

Frequently Asked Questions about PineScript

What is PineScript?

PineScript is a Model Context Protocol (MCP) server that model context protocol (mcp) server for working with tradingview pinescript It connects AI assistants to external tools and data sources through a standardized interface.

How do I install PineScript?

Follow the installation instructions on the PineScript GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with PineScript?

PineScript works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is PineScript free to use?

Yes, PineScript is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Finance & Fintech MCP Servers

Explore all finance & fintech servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "pinescript": { "command": "npx", "args": ["-y", "pinescript"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use PineScript?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides