Skip to main content

Documentation Index

Fetch the complete documentation index at: https://casparser.in/docs/llms.txt

Use this file to discover all available pages before exploring further.

The official CAS Parser MCP server provides all API endpoints as tools for AI agents. Built on the Model Context Protocol standard.

Installation

npm install -g cas-parser-node-mcp
Or use directly via npx (no install required):
npx -y cas-parser-node-mcp@latest

Configuration

Claude Desktop

Add to ~/.claude.json:
{
  "mcpServers": {
    "cas_parser_node_mcp": {
      "command": "npx",
      "args": ["-y", "cas-parser-node-mcp@latest"],
      "env": {
        "CAS_PARSER_API_KEY": "your-api-key"
      }
    }
  }
}
Or via CLI:
claude mcp add cas_parser_node_mcp -e CAS_PARSER_API_KEY=your-api-key -- npx -y cas-parser-node-mcp@latest

Cursor

Add to Cursor Settings → Tools & MCP → mcp.json:
{
  "mcpServers": {
    "cas_parser_node_mcp": {
      "command": "npx",
      "args": ["-y", "cas-parser-node-mcp@latest"],
      "env": {
        "CAS_PARSER_API_KEY": "your-api-key"
      }
    }
  }
}

Windsurf

  1. Open Windsurf Settings
  2. Navigate to Cascade → MCP
  3. Click Add Server
  4. Enter:
    • Name: cas_parser_node_mcp
    • Type: command
    • Command: npx -y cas-parser-node-mcp@latest
    • Environment: CAS_PARSER_API_KEY=your-api-key

VS Code

Add to your VS Code MCP settings:
{
  "mcpServers": {
    "cas_parser_node_mcp": {
      "command": "npx",
      "args": ["-y", "cas-parser-node-mcp@latest"],
      "env": {
        "CAS_PARSER_API_KEY": "your-api-key"
      }
    }
  }
}

Remote Server (Streamable HTTP)

If you prefer not to install the npm package locally:
{
  "mcpServers": {
    "cas_parser_node_mcp": {
      "url": "https://cas-parser.stlmcp.com",
      "headers": {
        "x-api-key": "your-api-key"
      }
    }
  }
}

Available Tools

The MCP server exposes all CAS Parser API endpoints as tools:
ToolDescription
smart_parseAuto-detect CAS type and parse PDF
cdsl_parseParse CDSL eCAS
nsdl_parseParse NSDL eCAS
cams_kfintech_parseParse CAMS/KFintech CAS
contract_note_parseParse broker contract notes
kfintech_generateRequest CAS via KFintech email
cdsl_fetchCDSL OTP request (Step 1)
cdsl_fetch_verifyCDSL OTP verify (Step 2)
inbox_connectGet Gmail OAuth URL
inbox_casList/parse CAS from inbox
inbox_disconnectRevoke email access
creditsCheck remaining credits
token_generateGenerate access token

Code Mode

The MCP server includes Code Mode — agents can write TypeScript SDK code that runs in a sandboxed environment:
// Agent-generated code example
const response = await casparser.smartParse({
  file: pdfBuffer,
  password: "ABCDE1234F"
});

console.log(`Portfolio value: ₹${response.summary.total_value}`);

Doc Search Tool

The server includes a documentation search tool that lets agents query CAS Parser docs:
Agent: "How do I parse a CDSL CAS file?"
Tool: doc_search("CDSL CAS parsing")
→ Returns relevant documentation snippets

Example Prompts

Once configured, you can ask your AI agent:
  • “Parse this CAS PDF and show me my portfolio summary”
  • “What are my top holdings by value?”
  • “Check my CAS Parser credit balance”
  • “Import my latest CAS from Gmail”
  • “Fetch my CDSL holdings using OTP”

Sandbox Testing

Use the sandbox API key for testing:
{
  "env": {
    "CAS_PARSER_API_KEY": "sandbox-with-json-responses"
  }
}
The sandbox returns sample data without consuming credits.

Troubleshooting

IssueSolution
”API key invalid”Check CAS_PARSER_API_KEY env var
”Tool not found”Restart your IDE after config change
”Connection refused”Ensure npx can access npm registry
”Timeout”Parsing takes ~30-60s; increase timeout

NPM Package

View on npm registry

Agent Toolkit

Templates and examples