An MCP (Model Context Protocol) server that lets Claude — or any MCP-compatible AI agent — run Chartink stock screeners and backtests for the Indian (NSE/BSE) market directly from a chat.
You describe a strategy in plain English, the agent writes the Chartink , and this server runs it against Chartink and returns the matching stocks.
MCP server to run Chartink stock screeners & backtests (NSE/BSE) from Claude or any AI agent — bundled with a skill for the full scan-clause syntax.
Estrelas
4
Ferramentas
—
Disponibilidade
—
scan clause
Bundled with a chartink-query skill (see skills/) that teaches the agent the full Chartink scan-clause syntax — every indicator, function, and gotcha — so it writes correct queries on the first try.
Features
Tool
What it does
set_cookies
Authenticate using your Chartink browser session cookies.
run_screener
Run a scan clause and return matching stocks (/screener/process).
run_multiple_screeners
Run several scan clauses in one call (compare strategies).
run_backtest
Run a scan clause through Chartink's /backtest/process endpoint.
run_saved_screener
Fetch a public saved screener by its URL slug and run it.
Requirements
Python 3.10+ (developed on 3.11) — required by the mcp package; your system's default python3 may be older, see Installation
A Chartink account (free works for most scans; some features need premium)
An MCP-compatible client: Claude Desktop, Claude Code, or any agent that speaks MCP over stdio
Installation
⚠️ Check your Python version first. The mcp package requires Python 3.10+. On many machines the default python3 is older (e.g. macOS ships 3.9), and pip install mcp will fail with a dependency/SyntaxError. Verify:
python3 --version # must be 3.10 or newer
If it's older, use one of the options below to get a 3.10+ interpreter.
# 1. Clone
git clone https://github.com/<your-username>/chartink-mcp.git
cd chartink-mcp
Option A — using uv (recommended; handles the Python version for you)
uv auto-downloads a suitable Python, so you don't need a system 3.10+:
# Use a 3.10+ interpreter. If `python3` is too old, call a specific one,
# e.g. python3.11 / python3.12 (install via Homebrew: `brew install [email protected]`).
python3.11 -m venv venv # or: python3 -m venv venv (only if 3.10+)
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
Click any request to chartink.com, go to Headers → Request Headers, and copy the entire Cookie: value (it contains XSRF-TOKEN=...; ci_session=...; ...).
In your AI chat, tell the agent to set the cookies, e.g.:
"Set my Chartink cookies: XSRF-TOKEN=...; ci_session=...; ..."
(This calls set_cookies.) You'll get back "XSRF-TOKEN found ✓" if it worked.
Cookies live for the duration of the server process. Re-run set_cookies if requests start failing (session expired).
⚠️ Never commit your cookies. They are credentials. The .gitignore already excludes common secret/cache files, but treat the cookie string like a password.
Usage examples
Once configured and authenticated, just talk to the agent:
"Find NSE stocks within 5% of their 52-week high with rising volume."
"Run this scan clause and show me the matches:
( {cash} ( latest rsi( 14 ) > 60 and latest close > latest sma( latest close , 50 ) ) )"
"Run the saved screener short-term-breakouts."
"Compare two strategies: an RSI breakout vs a MACD crossover."
The agent writes the scan clause (using the bundled skill), the server runs it, and you get the stock list back.
{cash} = all NSE cash stocks. Conditions use Chartink's English-like grammar, e.g.
latest close > latest sma( latest close , 50 ). See the bundled skill for the full syntax.
The chartink-query skill
The skills/chartink-query/ folder is a portable Claude skill that documents the entire Chartink scan-clause language — price/volume attributes, timeframes & candle offsets, every indicator (SMA, EMA, RSI, MACD, ADX, Bollinger, Stochastic, Supertrend, Donchian, VWAP, OBV, pivots…), functions (max/min/count/abs), crossover construction, segments, and the supported fundamental fields — plus a library of ready-to-use example queries.
With the skill installed, the agent writes valid scan clauses on the first try and can produce both the MCP/API form and the copy-paste form for chartink.com.
Install the skill
Claude Code — copy it into either location:
# user-level (available in every project)
cp -r skills/chartink-query ~/.claude/skills/
# or project-level
mkdir -p .claude/skills && cp -r skills/chartink-query .claude/skills/
Claude Desktop / other agents — point your skills directory at skills/chartink-query/, or paste the contents of SKILL.md into your system prompt / project knowledge.
Then just ask: "write a chartink query for stocks breaking a 20-day high with a volume surge" and the skill handles the syntax.
Project structure
chartink-mcp/
├── server.py # the MCP server
├── requirements.txt
├── README.md
├── LICENSE
└── skills/
└── chartink-query/ # portable Claude skill for Chartink syntax
├── SKILL.md
├── reference.md # full keyword/indicator/function catalog
└── examples.md # ready-to-use query patterns
Troubleshooting
Symptom
Fix
pip install fails on mcp / SyntaxError during install
Your Python is < 3.10. Build the venv with a 3.10+ interpreter (python3.11 -m venv venv) or use the uv option in Installation.
Tools don't appear in the client
Check the absolute paths in the config; restart the client (Claude Desktop must be fully quit & reopened).
XSRF-TOKEN not found / are you logged in?
Re-run set_cookies with a fresh cookie string from a logged-in browser.
Requests suddenly fail
Session expired — set cookies again.
run_saved_screener says "Could not extract scan_clause"
That scan is private (its clause isn't in the public page). Ask the owner for the clause and use run_screener instead.
run_backtest returns empty
Chartink's full target/stop backtest is a website/premium feature; the endpoint may not return rich data via API. Use the website's Backtest tab for performance stats.
Disclaimer
This project is for educational and research purposes only. It is not investment advice, and the authors are not SEBI-registered advisers. Screener output and any backtests are not recommendations to buy or sell. Always do your own due diligence and manage your own risk. Use in accordance with Chartink's terms of service.
Contributing
Issues and PRs welcome. Ideas: caching, richer backtest parsing, more example skills, tests.
Ainda não há lista de ferramentas. Servidores remotos recebem uma após a primeira verificação de saúde.
Perguntas frequentes
Perguntas
Como instalo Chartink?
Copie nesta página a configuração stdio para Cursor, Claude Desktop, Claude Code ou VS Code. Ela usa a instalação do publicador, não um proxy do PlugMCP.
Chartink precisa de uma chave de API?
Este registro não lista nenhuma variável de ambiente obrigatória.
Qual transporte Chartink usa?
Chartink roda localmente via stdio.
Quando Chartink foi verificado pela última vez?
Última verificação: 2026-10-28. MCP server to run Chartink stock screeners & backtests (NSE/BSE) from Claude or any AI agent — bundled with a skill for the full scan-clause syntax.