MCP server providing Pine Script v6 documentation for AI assistants
Project description
pinescript-mcp
MCP server providing Pine Script v6 documentation for AI assistants (Claude, etc.).
Enables AI to:
- Look up Pine Script functions and validate syntax
- Access official documentation for indicators, strategies, and visuals
- Understand Pine Script concepts (execution model, repainting, etc.)
- Generate correct v6 code with proper function references
Usage with Claude Code
Add to .mcp.json in your project (recommended):
{
"mcpServers": {
"pinescript-docs": {
"type": "stdio",
"command": "uvx",
"args": ["pinescript-mcp"]
}
}
}
Usage with Claude Desktop
Add to ~/.config/claude/claude_desktop_config.json:
{
"mcpServers": {
"pinescript-docs": {
"command": "uvx",
"args": ["pinescript-mcp"]
}
}
}
Alternative: pip install
pip install pinescript-mcp
Then use "command": "pinescript-mcp" directly in the config.
Available Tools
| Tool | Description |
|---|---|
list_docs() |
List all documentation files with descriptions |
get_doc(path) |
Read a specific documentation file |
search_docs(query) |
Full-text search across all docs |
get_functions(namespace) |
List valid functions (ta, strategy, etc.) |
validate_function(name) |
Check if a function exists in Pine v6 |
resolve_topic(query) |
Map a question to relevant docs |
get_manifest() |
Get routing guidance for topics |
Example Queries
- "How do I create a trailing stop in Pine Script?"
- "What's the difference between var and varip?"
- "Is ta.supertrend a valid function?"
- "How do I avoid repainting with request.security?"
Documentation Coverage
The server bundles comprehensive Pine Script v6 documentation:
- Concepts: Execution model, timeframes, colors, methods, objects, common errors
- Reference: Types, variables, constants, keywords, operators, annotations
- Functions: Technical analysis (ta.*), strategies, requests, drawings, collections
- Visuals: Plots, fills, shapes, tables, lines, boxes, backgrounds
- Writing Scripts: Style guide, debugging, optimization, limitations
Why Use This?
AI models often hallucinate Pine Script functions or use deprecated v5 syntax. This MCP server grounds the AI in actual v6 documentation, preventing:
- Made-up function names (e.g.,
ta.hulldoesn't exist, useta.hma) - Deprecated syntax from v4/v5
- Incorrect parameter orders
- Missing required arguments
Development
# Clone and install locally
git clone https://github.com/bch/pinescript-mcp
cd pinescript-mcp
pip install -e .
# Run the server
pinescript-mcp
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pinescript_mcp-0.1.1.tar.gz.
File metadata
- Download URL: pinescript_mcp-0.1.1.tar.gz
- Upload date:
- Size: 325.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f33ca53c28c3d02354f3bed0d5c061ffa622a36aeab6ea00e39b83591b4b52c
|
|
| MD5 |
b50413ef0dbc39798543cce9b8dce164
|
|
| BLAKE2b-256 |
8d6da601319a65c478b8ab52e797a9abafdfbc15902d9af703a08d9347565505
|
File details
Details for the file pinescript_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pinescript_mcp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 351.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b35f8a61e757e81a1486c61a78354fd2d5966c297be2a4be19a87499e10cff4
|
|
| MD5 |
1d9236e9cdcc57a85ee1907f7d3985f7
|
|
| BLAKE2b-256 |
3b871186e0586d267ef3807ff792f58d3aa6230c119abf09ba88d6199a51fa06
|