A collection of skills, templates, and documentation for AI coding agents to integrate Indian financial portfolio tracking into applications using the CAS Parser API.
CAS Parser is an API platform that extracts structured data from Indian financial portfolio documents:
- Portfolio Connect SDK — drop-in UI widget for web apps (file upload, Gmail import, CDSL fetch — all in one modal)
- REST API — parse CAS PDFs from CDSL, NSDL, and CAMS/KFintech into structured JSON
- Contract Notes — parse broker trade documents from Zerodha, Groww, Upstox, ICICI
| Component | What it does |
|---|---|
| AGENTS.md | Integration rules your AI agent follows automatically |
| SKILL.md | Domain knowledge (Indian financial concepts, API architecture, integration patterns) |
| Templates | 14 copy-paste-ready code snippets (Python, Node.js, React, HTML, curl) |
| References | 9 detailed guides + full OpenAPI spec for complex flows |
| MCP Server | 17 live API tools your agent can call directly (parse, fetch, import, credits) |
The agent instructions + domain knowledge + MCP tools work together so your AI coding agent can build CAS Parser integrations without you having to explain the API.
Using the skills CLI:
npx skills add casparser/agent-toolkitThis installs templates and documentation into your project's .skills/ directory.
If you prefer manual setup, copy the skills/casparser/ directory into your project's .skills/ or skills/ folder.
Download AGENTS.md to your project root:
curl -O https://raw.githubusercontent.com/casparser/agent-toolkit/main/AGENTS.mdFor Claude Code, also download CLAUDE.md:
curl -O https://raw.githubusercontent.com/casparser/agent-toolkit/main/CLAUDE.mdThe official cas-parser-node-mcp package exposes all API endpoints as tools, with Code Mode (agents write TypeScript SDK code in a sandbox) and a doc search tool.
claude mcp add cas_parser_node_mcp -e CAS_PARSER_API_KEY=your-api-key -- npx -y cas-parser-node-mcp@latest{
"mcpServers": {
"cas_parser_node_mcp": {
"command": "npx",
"args": ["-y", "cas-parser-node-mcp@latest"],
"env": {
"CAS_PARSER_API_KEY": "your-api-key"
}
}
}
}{
"mcpServers": {
"cas_parser_node_mcp": {
"command": "npx",
"args": ["-y", "cas-parser-node-mcp@latest"],
"env": {
"CAS_PARSER_API_KEY": "your-api-key"
}
}
}
}- Open Windsurf Settings
- Navigate to Cascade > MCP
- Click Add Server
- Enter:
- Name:
cas_parser_node_mcp - Type:
command - Command:
npx -y cas-parser-node-mcp@latest - Env:
CAS_PARSER_API_KEY=your-api-key
- Name:
{
"mcpServers": {
"cas_parser_node_mcp": {
"command": "npx",
"args": ["-y", "cas-parser-node-mcp@latest"],
"env": {
"CAS_PARSER_API_KEY": "your-api-key"
}
}
}
}Use
sandbox-with-json-responsesas the API key for testing.
Ask your AI agent:
"Review the CAS Parser skill and help me integrate portfolio parsing into my app"
Or try specific tasks:
"Parse a CAS PDF using the CAS Parser API"
"Add Portfolio Connect widget to my React app"
"Set up CDSL fetch with OTP verification"
- Portfolio Connect SDK — Drop-in React/HTML widget for the full import flow (recommended for frontend)
- CAS Parsing — Parse CDSL, NSDL, CAMS/KFintech PDFs into structured JSON via REST API
- Contract Notes — Parse broker trade documents from Zerodha, Groww, Upstox, ICICI
- CDSL Fetch — Download CAS directly from CDSL via OTP authentication
- Email Import — Import CAS files from Gmail via OAuth
- Unified Response — Consistent JSON format regardless of CAS source
├── AGENTS.md # Core integration rules for agents
├── CLAUDE.md # Claude Code-specific guidance
├── README.md # This file
└── skills/casparser/
├── SKILL.md # CAS Parser concepts and patterns
├── templates/ # Ready-to-use code snippets
│ ├── react-portfolio-connect.tsx # React: Portfolio Connect widget ⭐
│ ├── nextjs-portfolio-connect.tsx# Next.js: full page with widget
│ ├── html-portfolio-connect.html# Vanilla HTML: embed widget
│ ├── python-smart-parse.py # Python: auto-detect & parse CAS
│ ├── python-cdsl-fetch.py # Python: CDSL OTP flow
│ ├── python-email-import.py # Python: Gmail inbox import
│ ├── python-contract-note.py # Python: parse contract notes
│ ├── python-kfintech-generate.py# Python: KFintech mailback
│ ├── python-credits-check.py # Python: quota & usage monitoring
│ ├── nodejs-smart-parse.js # Node.js: smart parse
│ ├── nodejs-cdsl-fetch.js # Node.js: CDSL OTP flow
│ ├── nodejs-email-import.js # Node.js: email import
│ ├── nodejs-access-token.js # Node.js: generate access tokens
│ └── curl-examples.sh # curl for every endpoint
└── references/ # Detailed guides
├── api-overview.md # Auth, base URLs, headers, sandbox
├── cas-types.md # CDSL vs NSDL vs CAMS/KFintech
├── unified-response.md # Full response schema
├── portfolio-connect-sdk.md # SDK integration guide
├── email-import-flow.md # Gmail OAuth walkthrough
├── cdsl-fetch-flow.md # CDSL 2-step OTP guide
├── contract-notes.md # Contract note parsing
├── error-handling.md # Error codes and debugging
└── credits-billing.md # Credits system and pricing
- CAS Parser Documentation — Official docs
- API Reference — Interactive API reference
- CAS Parser Web Portal — Try it online
- Portfolio Connect SDK — Frontend UI widget (npm)
- Node.js / TypeScript SDK — Official TypeScript API client (npm)
- Python SDK — Official Python API client (GitHub)
- MCP Server — AI agent tools with Code Mode (npm)
- Agents.md — Standard for agent behaviors
- Agent Skills Spec — Specification for agent skills
The CAS Parser Agent Toolkit empowers AI coding agents to build financial portfolio tracking applications using the CAS Parser API — the leading platform for parsing Indian financial documents.