PineMCP MCP server
Commit Nov 10, 2026Provides AI assistants with authoritative PineScript v6 documentation, code validation, and automated v5 to v6 migration tools.
Also known as TheFractalyst/PineMCP
- Stars
- 4
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Nov 10, 2026
- License
- MIT
What is PineMCP MCP?
PineMCP provides AI assistants with authoritative PineScript v6 documentation, code validation, and automated v5 to v6 migration tools.
Summary generated from the project's README
About PineMCP MCP server
PineMCP provides AI assistants with authoritative access to the complete TradingView PineScript v6 documentation. It is designed for developers who need to prevent syntax hallucinations when working with the latest version of PineScript. The server includes over 2,200 entries covering the official reference page and the user manual, indexed in a local ChromaDB vector store for semantic search.
Users can run the server locally via stdio or remotely using SSE. It integrates with MCP-compatible clients such as Claude Desktop, Cursor, Windsurf, and OpenCode. While most operations are 100% offline, the server offers optional remote integration with the TradingView compiler through the pine_compile and pine_repair tools. This allows for real-time code validation and automated migration from version 5 to version 6.
Key tools include pine_lookup for exact symbol documentation, pine_search for semantic queries, and pine_scaffold for generating validated indicator or strategy templates. The system uses a local embedding model to ensure that searches find relevant documentation by meaning rather than just keywords.
What you can do with it
- 1Migrate legacy scriptsConvert older PineScript v5 code to the current v6 standard automatically.
- 2Validate script syntaxCheck if your PineScript code is correct by running it through the actual TradingView compiler.
Written from the project's README. Every use case is checked against a quote from it.
Automated checks
Ran Nov 15, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachablethefractalyst/pinemcp is public and reachablegithub.com/thefractalyst/pinemcp ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-10github.com/thefractalyst/pinemcp ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubComplete PineScript v6 reference documentation MCP server with 2263 entries: 951 reference entries covering every function, variable, constant, type, keyword, operator, and annotation on the official TradingView PineScript v6 reference page (with all overload signatures), plus 1312 guide entries from the official Pine Script v6 User Manual website.
Quick Start | Tools | Configuration | Database | Development
One Command. Two Minutes. Fully Functional.
pip install pinemcp
pinemcp
That's it. On first run, the server auto-builds the ChromaDB vector store from shipped JSON data (takes 30-60 seconds for embedding model download + indexing). Subsequent runs start instantly.
What you get:
- 6 MCP tools for PineScript v6 docs lookup, code validation, and code generation
- 2263 entries indexed in a local ChromaDB vector store (100% offline)
- Sub-millisecond hot cache for priority lookups
- Remote TradingView compiler integration for
pine_compileandpine_repair - Works with Claude Desktop, Cursor, Windsurf, OpenCode, and any MCP client
What you need:
- Python 3.10+
- Any MCP-compatible AI client
Why PineMCP?
AI coding assistants hallucinate PineScript v6 syntax. PineScript v6 introduced
breaking changes from v5 (typed na, removed transp, when parameter removal,
bool casting changes, etc.) that models trained on older code get wrong.
PineMCP gives AI assistants authoritative, real-time access to the complete TradingView v6 reference:
- 100% coverage: 919/919 base entries from the live TradingView v6 reference
- User manual coverage: every section of the official v6 User Manual
(Language, Visuals, Concepts, Writing scripts, Errors and warnings, FAQ,
Release notes, Migration guides) is queryable via
kind='guide' - Semantic search: Vector embeddings find relevant docs by meaning, not just keywords
- Remote compilation:
pine_compilevalidates code against the real TradingView compiler - v5 to v6 migration:
pine_repair(mode="migrate")applies all known v5->v6 replacements - Code generation:
pine_scaffoldgenerates validated indicator or strategy templates - 100% local: No network calls at runtime (except optional compiler validation)
Tools
+----------------------+---------------------------------------------+
| Tool | Description |
+----------------------+---------------------------------------------+
| pine_lookup | Get complete docs for a symbol by exact name|
| pine_search | Semantic search across all docs |
| pine_browse | Enumerate all members of a namespace |
| pine_compile | Compile PineScript code via TradingView |
| pine_repair | Fix compiler errors or migrate v5 to v6 |
| pine_scaffold | Generate indicator or strategy template |
+----------------------+---------------------------------------------+
Tool Details
pine_lookup(name, kind?)
Get complete documentation for a PineScript v6 symbol by exact name.
Auto-detects function, variable, type, constant, keyword, or operator.
Returns syntax, parameters, returns, remarks, examples, and see-also links.
pine_search(query, category?, namespace?, return_type?, has_examples?, current_line?, n_results?)
Semantic search across the entire v6 reference. Supports category filtering,
namespace filtering, return type matching, example-only mode, and
context-aware function suggestions based on the current line being typed.
pine_browse(namespace, category?, style?)
Enumerate every member of a namespace (e.g., ta, strategy, array).
style="cheatsheet" produces a compact, box-drawn signature summary.
pine_compile(code?, file_path?, explain?)
Compile PineScript v6 code via the remote TradingView compiler.
Supports inline code, file paths, and explain=True for error-specific fix hints.
pine_repair(code, context, mode?)
Fix compiler errors (mode="targeted") or migrate v5 code to v6
(mode="migrate"). Applies all known v5->v6 breaking change replacements,
then recompiles to verify.
pine_scaffold(kind, name, description?, inputs?, overlay?, initial_capital?, commission_pct?, pyramiding?)
Generate a validated PineScript v6 indicator or strategy template.
Pre-wired with standard inputs, risk parameters, and plot functions.
MCP Client Configuration
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"pinescript-v6": {
"command": "pinemcp",
"transport": "stdio"
}
}
}
Cursor / Windsurf / OpenCode
Add to your project's .mcp.json or global MCP config:
{
"mcpServers": {
"pinescript-v6": {
"command": "pinemcp",
"transport": "stdio"
}
}
}
SSE (HTTP)
pinemcp --transport sse --port 8080
Connect to http://localhost:8080. Set MCP_API_KEY env var for auth.
Remote (free public hosting on Hugging Face Spaces)
A live public instance is available at:
https://<username>-pinemcp.hf.space/sse
Connect any MCP client without installing anything locally:
{
"mcpServers": {
"pinescript-v6": {
"url": "https://<username>-pinemcp.hf.space/sse",
"transport": "sse"
}
}
}
See HF_DEPLOY.md to deploy your own free instance.
Configuration
+------------------------+---------------------+----------------------------------+
| Env Var | Default | Description |
+------------------------+---------------------+----------------------------------+
| TRANSPORT | stdio | Transport: stdio or sse |
| PORT | 8080 | Port for SSE transport |
| PINESCRIPT_DB_PATH | ~/.pinescript_mcp/db| ChromaDB path |
| PINESCRIPT_COLLECTION | pine_reference | ChromaDB collection name |
| PINE_EMBED_MODEL | all-MiniLM-L6-v2 | Sentence transformer model |
| LOG_LEVEL | INFO | Logging level |
| LAZY_MODEL | 0 | Set to 1 to defer model loading |
| MCP_API_KEY | (none) | API key for SSE auth (optional) |
+------------------------+---------------------+----------------------------------+
Database
- 3067 entries shipped (v6 only); 2723 unique entries indexed (344 pre-existing merged reference duplicates collapse on upsert)
- 53 namespaces (ta, strategy, array, matrix, math, str, color, etc.)
- 919/919 base entries from the live TradingView v6 reference (100% coverage)
- 832 additional enrichment entries from local documentation parsing
- 1316 guide entries from the official Pine Script v6 User Manual PDF (99.96% text coverage; 10 parts: primer, language, visuals, concepts, writing, errors, faq, release, migration, welcome)
- Hot cache: 1541 entries preloaded in memory for sub-ms lookups
- Auto-built on first run from shipped JSON data (2.1MB)
To rebuild the database:
pinemcp build
Development
git clone https://github.com/TheFractalyst/PineMCP.git
cd PineMCP
pip install -e ".[dev]"
pytest tests/ -v
Refresh the data from TradingView
pip install -e ".[pipeline]"
python -m playwright install chromium
# Reference (functions, variables, constants, keywords, operators, annotations):
python pipeline/discover_entries.py # index check (~945 symbols)
python pipeline/scrape_entries.py # live scrape -> data/tv_scraped_entries.json
python pipeline/merge_reference.py # merge into data/pine_merged_entries.json
# Guides (user manual, FAQ, release notes, error pages):
python pipeline/scrape_docs.py # docs site -> data/pine_docs_entries.json
# Rebuild the vector store and re-run audits:
pinemcp build
python pipeline/audit_symbols.py
pytest tests/test_data_freshness.py -q
Both scrapers verify their own output (counts, required symbols, coverage)
and exit non-zero on drift, so a partial scrape never reaches data/.
Tech Stack
- FastMCP 3.0 - MCP server framework with FileSystemProvider auto-discovery
- ChromaDB - Local vector database for semantic search
- SentenceTransformers -
all-MiniLM-L6-v2embedding model (384-dim) - RapidFuzz - Fuzzy string matching for name lookups
- Loguru - Structured logging with daily rotation (SSE mode)
Links
- fractalyst.dev - Portfolio
- TradingView - Public PineScript indicators
- @TheFractalyst - X / Twitter
License
MIT - see LICENSE
PineMCP MCP questions
How do I get started with PineMCP?
You can install it via pip and run it with a single command: pip install pinemcp followed by pinemcp.
Can this tool help me migrate code from PineScript v5 to v6?
Yes, the pine_repair tool includes a migration mode specifically designed to apply all known v5 to v6 breaking change replacements.
Does the server require an internet connection to search documentation?
No, the server uses a local ChromaDB vector store for 100% offline semantic search.
What kind of templates can I generate?
The pine_scaffold tool can generate validated PineScript v6 indicator or strategy templates.