TradingView PineScript MCP Server
Overview
The TradingView PineScript MCP Server is a Model Context Protocol (MCP) server designed for working with TradingView PineScript. It provides tools for validating, fixing, and generating PineScript code through a standardized API.
To use the server, clone the repository, install the dependencies, and start the server. You can then interact with the API to validate or fix PineScript code.
- PineScript Validation: Automatically validates PineScript code for syntax errors and warnings. - Error Fixing: Automatically fixes common PineScript syntax errors. - Template Generation: Provides validated templates for various PineScript strategies and indicators.
- Validating PineScript code before deployment.
- Automatically fixing common syntax errors in PineScript scripts.
- Generating templates for new PineScript strategies and indicators.
Add to your AI client
Use these steps to connect TradingView PineScript MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"pinescript-mcp-server-cyberbob07": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-pinescript-mcp-server-cyberbob07"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"pinescript-mcp-server-cyberbob07": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-pinescript-mcp-server-cyberbob07"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"pinescript-mcp-server-cyberbob07": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-pinescript-mcp-server-cyberbob07"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"pinescript-mcp-server-cyberbob07": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-pinescript-mcp-server-cyberbob07"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"pinescript-mcp-server-cyberbob07": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-pinescript-mcp-server-cyberbob07"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"pinescript-mcp-server-cyberbob07": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-pinescript-mcp-server-cyberbob07"
]
}
}
}FAQ
Can the server validate any PineScript version?
Yes, the server can validate scripts for different PineScript versions by specifying the version parameter.
Is there a way to get templates for specific strategies?
Yes, you can request templates by specifying the type and name of the strategy or indicator you need.
How do I run tests for the server?
You can run tests by executing the command `npm test` in the project directory.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":3842,"uuid":"2cff36b6-d819-4de3-9a3f-3a744e2702b3","name":"pinescript-mcp-server","title":"TradingView PineScript MCP Server","description":"","avatar_url":"https://avatars.githubusercontent.com/u/117443862?v=4","created_at":"2025-03-22T00:38:53.471Z","updated_at":"2025-03-22T00:57:13.310Z","status":"created","author_name":"CyberBOB07","author_avatar_url":"https://avatars.githubusercontent.com/u/117443862?v=4","tags":"pinescript,tradingview,mcp-server","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/CyberBOB07/pinescript-mcp-server","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"0\",\"license\":\"\",\"language\":\"TypeScript\",\"is_official\":false,\"latest_commit_time\":\"2025-03-21 17:26:41\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]