# `rbi-doc-mcp`: Reserve Bank of India (RBI) Regulatory Archive MCP Server & Local CLI (1991-2026)

[![Public Web Portal](https://img.shields.io/badge/Web_Portal-https%3A%2F%2Frbi--archive.pages.dev-blue.svg)](https://rbi-archive.pages.dev)
[![Official MCP Endpoint](https://img.shields.io/badge/MCP_Endpoint-https%3A%2F%2Frbi--archive.pages.dev%2Fmcp-green.svg)](https://rbi-archive.pages.dev/mcp)
[![Archive Corpus](https://img.shields.io/badge/RBI_Regulatory_Corpus-88%2C236_Documents_(1991--2026)-amber.svg)](https://github.com/imsovikde/rbi-regulatory-archive-1991-2026)

`rbi-doc-mcp` is the official Model Context Protocol (MCP) command-line bridge and offline-capable local BM25F regulatory query engine for the **Reserve Bank of India (RBI) Regulatory Archive (1991-2026)**, covering all **88,236** publicly available RBI Master Directions, Master Circulars, Circulars, Notifications, Draft Guidelines, and Press Releases converted to SHA-256-verified GitHub-Flavored Markdown.

- **Public Web Portal & Interactive Terminal**: [https://rbi-archive.pages.dev](https://rbi-archive.pages.dev)
- **Official Streamable HTTP MCP Endpoint**: `https://rbi-archive.pages.dev/mcp`
- **User Account & Usage Dashboard**: [https://rbi-archive.pages.dev/account](https://rbi-archive.pages.dev/account)
- **Public Regulatory Archive & Full Guide**: [github.com/imsovikde/rbi-regulatory-archive-1991-2026](https://github.com/imsovikde/rbi-regulatory-archive-1991-2026) ([Complete MCP Guide](https://github.com/imsovikde/rbi-regulatory-archive-1991-2026/blob/main/mcp-guide.md))

---

## Quick Start

### 1. Zero-Cost Local Stdio MCP Server (`--local`)

Run a local Model Context Protocol server over `stdio` that queries the sharded BM25F static index (`https://rbi-archive.pages.dev/idx/v2`) with persistent local disk caching (`~/.cache/rbi-doc-mcp/idx-v2`) and fetches full regulatory Markdown directly from the public GitHub Raw and Hugging Face mirrors:

```bash
npx rbi-doc-mcp --local
```

### 2. Direct Terminal Search, Resolution & Validity Verification

You can also query the 88,236-document archive directly from your terminal:

```bash
# Search RBI Master Directions and Circulars using BM25F ranking
npx rbi-doc-mcp --search "Know Your Customer Master Direction"

# Resolve an official RBI circular reference number or canonical document ID
npx rbi-doc-mcp --resolve "RBI/2017-18/15"

# Verify whether a circular was legally in force (ACTIVE, SUPERSEDED, or REPEALED) on a specific date
npx rbi-doc-mcp --validity "rbi_081878" 2026-01-01
```

### 3. Remote Streamable HTTP MCP Connection

For cloud-hosted multi-step JavaScript Code Mode (`rbi_doc_execute_code`), clause-level RAG (`rag_query_rbi_provisions`), and OAuth 2.1 session management, connect your MCP client directly to `https://rbi-archive.pages.dev/mcp`:

```bash
claude mcp add --transport http rbi-archive https://rbi-archive.pages.dev/mcp
```

---

## Client Configuration (`claude_desktop_config.json`, Cursor, VS Code, Windsurf)

### Local Stdio Mode (`npx rbi-doc-mcp --local`)

```json
{
  "mcpServers": {
    "rbi-archive-local": {
      "command": "npx",
      "args": ["-y", "rbi-doc-mcp", "--local"]
    }
  }
}
```

### Remote Streamable HTTP Mode (`https://rbi-archive.pages.dev/mcp`)

```json
{
  "mcpServers": {
    "rbi-archive": {
      "url": "https://rbi-archive.pages.dev/mcp"
    }
  }
}
```

---

## Available MCP Tools

| Tool Name | Purpose |
| :--- | :--- |
| `search_rbi_regulations` | Hybrid BM25F search across all 88,236 RBI regulatory documents (1991-2026) with category and year filtering |
| `resolve_rbi_doc` / `resolve_rbi_document` | Resolve official RBI circular references (`RBI/2024-25/...`, `DOR.No...`, `DBOD.No...`), numeric IDs, or file paths into canonical metadata and SHA-256 digests |
| `fetch_rbi_markdown` / `fetch_rbi_document` | Retrieve verified GitHub-Flavored Markdown text for any RBI circular or Master Direction |
| `verify_circular_validity` | Point-in-time legal validity check (`ACTIVE`, `SUPERSEDED`, `REPEALED`) on any `YYYY-MM-DD` date |
| `trace_statutory_consequences` | Trace causal supersession and amendment chains across the statutory DAG |
| `format_court_citation` / `get_rbi_citation` | Format judicial citations with official reference numbers, dates, and SHA-256 verification hashes |
| `rag_query_rbi_provisions` | Clause-level retrieval over Content-Defined Chunked (CDC) statutory provisions (Remote HTTP endpoint) |
| `rbi_doc_execute_code` | Single-turn sandboxed JavaScript execution (`sdk.*`) for multi-hop regulatory joins (Remote HTTP endpoint) |

---

## License

Apache-2.0. Regulatory documents are public publications of the Reserve Bank of India.
