PineScript MCP Project
A Model Context Protocol (MCP) server for working with TradingView PineScript
Overview
TradingView PineScript MCP Server is a Model Context Protocol (MCP) server designed to work with TradingView PineScript, providing 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 use the API to validate and fix PineScript code or generate templates.
- 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 PineScript MCP Project 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-cklose2000": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-pinescript-mcp-server-cklose2000"
]
}
}
}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-cklose2000": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-pinescript-mcp-server-cklose2000"
]
}
}
}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-cklose2000": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-pinescript-mcp-server-cklose2000"
]
}
}
}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-cklose2000": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-pinescript-mcp-server-cklose2000"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"pinescript-mcp-server-cklose2000": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-pinescript-mcp-server-cklose2000"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"pinescript-mcp-server-cklose2000": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-pinescript-mcp-server-cklose2000"
]
}
}
}FAQ
Can this server validate any PineScript version?
Yes, it supports validation for different PineScript versions.
Is there a way to contribute to the project?
Yes! Contributions are welcome, and you can find guidelines in the repository.
What are the prerequisites to run the server?
You need Node.js 16.x or higher and npm 8.x or higher.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":3777,"uuid":"d6db1e0f-bd4d-4628-87aa-4f18af0e027c","name":"pinescript-mcp-server","title":"PineScript MCP Project","description":"A Model Context Protocol (MCP) server for working with TradingView PineScript","avatar_url":"https://avatars.githubusercontent.com/u/89212817?v=4","created_at":"2025-03-21T16:39:21.488Z","updated_at":"2025-03-21T16:51:11.885Z","status":"created","author_name":"cklose2000","author_avatar_url":"https://avatars.githubusercontent.com/u/89212817?v=4","tags":"[]","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/cklose2000/pinescript-mcp-server","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"0\",\"license\":\"\",\"language\":\"HTML\",\"is_official\":false,\"latest_commit_time\":\"2025-03-22 18:52:04\"}","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"}]]}]