gst-india-mcp
# GST India MCP
[](https://www.npmjs.com/package/gst-india-mcp)
[](https://www.npmjs.com/package/gst-india-mcp)
[](https://marketplace.visualstudio.com/items?itemName=bhavykhatri.gst-india-mcp-vscode)
[](LICENSE)
[](https://github.com/bhavykhatri/gst-india-mcp/actions/workflows/ci.yml)
A [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server for **India GST**, built on the [Sandbox (Quicko)](https://developer.sandbox.co.in) tax API. It lets any MCP client (VS Code, Claude, Codex, Cursorβ¦) verify GSTINs, look up businesses by PAN, track return filings, and β with an OTP-based taxpayer session β read your GSTR-2B/3B and cash/ITC ledgers.
> π§© Also available as a **[VS Code extension](vscode-extension/)** for one-click install with secure credential storage.
## Features
| Tool | Session? | Description |
|---|---|---|
| `verify_gstin` | Public | Verify a GSTIN β legal/trade name, status, type, address, e-invoice status. |
| `search_gstin_by_pan` | Public | Find all GSTINs registered against a PAN. |
| `track_gst_returns` | Public | Return filing history/status for a GSTIN (optional FY filter). |
| `taxpayer_generate_otp` | β | Send an OTP to a taxpayer's registered mobile/email. |
| `taxpayer_verify_otp` | β | Verify the OTP β start a ~6h taxpayer session. |
| `taxpayer_session_status` | β | Whether a taxpayer session is active. |
| `get_gstr3b` | Taxpayer | GSTR-3B (summary return) for a period. |
| `get_gstr2b` | Taxpayer | GSTR-2B (auto-drafted ITC/purchases) for a period. |
| `track_returns_current` | Taxpayer | Filed/pending returns for a period. |
| `get_annual_turnover` | Taxpayer | Annual Aggregate Turnover (AATO). |
| `get_ledger_balance` | Taxpayer | Cash + ITC balance as on a period. |
| `get_cash_ledger` | Taxpayer | Electronic cash ledger for a date range. |
| `get_itc_ledger` | Taxpayer | Electronic ITC ledger for a date range. |
**Public** tools need only your Sandbox API key/secret. **Taxpayer** tools additionally require an OTP session (see [Authentication](docs/authentication.md)).
## Requirements
- Node.js >= 18
- A [Sandbox](https://console.sandbox.co.in) account with an **API Key + API Secret** (test or live).
- For taxpayer tools: **Manage API Access** enabled on [gst.gov.in](https://www.gst.gov.in) for your GSTIN.
## Install
```bash
npx gst-india-mcp
```
Or globally:
```bash
npm install -g gst-india-mcp
gst-india-mcp
```
## Configuration
Set via `.env` (local dev) or the MCP host's `env` block:
| Variable | Description |
|---|---|
| `GST_API_KEY` | Sandbox API key (`key_test_β¦` / `key_live_β¦`) |
| `GST_API_SECRET` | Sandbox API secret |
| `GST_BASE_URL` | API base (default `https://api.sandbox.co.in`) |
| `GST_API_VERSION` | API version (default `1.0`) |
| `GST_USERNAME` | GST portal username (for taxpayer tools) |
| `GST_GSTIN` | Your GSTIN (for taxpayer tools) |
| `GST_TAXPAYER_TOKEN` | Optional pre-obtained 6h taxpayer token (skips OTP) |
Never commit `.env` β it is git-ignored.
## Demo / mock mode (no credentials)
Set **`GST_MOCK=true`** to serve deterministic mock data for every tool β no Sandbox account, no network, no real taxpayer data. Ideal for demos, videos, and trying the tools instantly:
```bash
GST_MOCK=true npx gst-india-mcp
```
Mock GSTINs to try (e.g. with `verify_gstin`): `27AABCT1234F1ZP` (active), `33AABCC1122P1ZW` (suspended). `search_gstin_by_pan` with `AABCT1234F` returns two branch GSTINs. The taxpayer tools accept any OTP and return sample GSTR-2B/3B and ledger data.
> Mock data is adapted from the open-source [vnrtumu/mockGSTServer](https://github.com/vnrtumu/mockGSTServer) vendor dataset.
## Use with VS Code
Ships a [`.vscode/mcp.json`](.vscode/mcp.json). Open the folder in VS Code and start the server from the MCP view, or install the [VS Code extension](vscode-extension/).
## Use with Claude, Codex, Cursor
Standard MCP server β configure `npx -y gst-india-mcp` in the host's config with the `GST_*` env vars. Example (Claude Desktop `claude_desktop_config.json`):
```json
{
"mcpServers": {
"gst-india": {
"command": "npx",
"args": ["-y", "gst-india-mcp"],
"env": { "GST_API_KEY": "...", "GST_API_SECRET": "...", "GST_USERNAME": "...", "GST_GSTIN": "..." }
}
}
}
```
## Documentation
- [Getting started](docs/getting-started.md)
- [Authentication (public vs taxpayer OTP)](docs/authentication.md)
- [Configuration](docs/configuration.md)
- [Tools reference](docs/tools.md)
## Security
- Credentials come from environment variables only; nothing is logged to stdout (reserved for MCP).
- The taxpayer session token is held in memory for the server's lifetime and is never written to disk by the server.
- This project uses the Sandbox **sandbox/test** environment by default β switch to live keys only when ready.
## License
MIT Β© Bhavy Khatri
TDQS
Scored across 13 tools
Most tools have distinct purposes: public GSTIN/PAN lookup, taxpayer session OTP flow, return-specific fetches, and ledger queries are clearly separated. Minor overlap exists between track_gst_returns and track_returns_current, and between get_ledger_balance versus get_cash_ledger/get_itc_ledger, but the descriptions sufficiently clarify the difference.
The naming is mostly predictable with verb-first patterns like verify_, search_, track_, and get_. The taxpayer_ prefixed OTP methods are consistent, though taxpayer_session_status breaks the verb pattern and there is minor inconsistency between track_/get_ prefixes for return-related tools.
Thirteen tools is a reasonable, well-scoped set for the GST India domain. Each tool covers a distinct public lookup, taxpayer session step, return retrieval, or ledger access function, and none feel redundant or excessive.
The surface covers the core GST workflows: GSTIN verification, PAN-based registration discovery, return status tracking, taxpayer session management, GSTR-2B/3B fetching, turnover, and ledger access. Minor gaps exist such as no GSTR-1 fetch, no explicit session logout, and limited return-period detail for some tools, but these do not cripple the main use cases.