Skip to main content
Glama
beenthatt-rehman

datagovin-mcp

datagovin-mcp

An MCP server that gives Claude (or any MCP client) natural-language access to India's Open Government Data platform, data.gov.in — 100,000+ public datasets covering air quality, agriculture, health, fuel prices, census, education, rainfall and more.

The server ships no data of its own. It's a thin, well-behaved wrapper: every query is a live call to data.gov.in using your own free API key. What it adds is the missing layer — discovery and clean querying — so a language model can go from "what's the AQI in Delhi right now?" to real rows without you ever hunting for a dataset UUID by hand.

Why this exists

data.gov.in has an enormous catalog but no good full-text search API: the normal workflow is to browse the website and copy a dataset's resource ID off its "API" button. That's a poor fit for an LLM. This server closes the gap with a curated, verified index you can search by keyword, plus tools that fetch a dataset's schema and pull filtered rows live. It also absorbs the upstream API's rough edges (case-sensitive filters, occasional CSV responses, a last-page pagination quirk) so the model doesn't have to.

Related MCP server: bharatlas-mcp

Tools

Tool

What it does

search_datasets(query, limit)

Find a dataset's resource_id by keyword from the curated index.

list_sectors()

List the sectors present in the catalog.

get_dataset_info(resource_id)

Live schema: title, description, row count, exact field names + types.

query_dataset(resource_id, filters, fields, limit, offset)

Pull actual filtered rows, live.

Setup

1. Get a free API key. Register at data.gov.in and generate a key from your profile page. It's free with no published rate limit.

2. Install.

git clone https://github.com/<your-username>/datagovin-mcp.git
cd datagovin-mcp
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

3. Set your key.

cp .env.example .env
# edit .env and paste your key, or just export it:
export DATA_GOV_IN_API_KEY="your_key_here"

4. Connect it to Claude Desktop. Add this to your MCP client config (claude_desktop_config.json):

{
  "mcpServers": {
    "datagovin": {
      "command": "python",
      "args": ["/absolute/path/to/datagovin-mcp/server.py"],
      "env": { "DATA_GOV_IN_API_KEY": "your_key_here" }
    }
  }
}

Restart the client and the four tools appear.

Example conversation

You: What datasets do you have on air quality? Claude: (calls search_datasets("air quality")) → Real-time Air Quality Index by station.

You: What fields does it have? Claude: (calls get_dataset_info(...)) → country, state, city, station, pollutant_id, pollutant_avg, last_update…

You: Show me PM2.5 readings in Delhi. Claude: (calls query_dataset(resource_id, filters={"city": "Delhi", "pollutant_id": "PM2.5"})) → live rows.

Growing the catalog

The catalog ships seeded with a verified dataset and is meant to grow. To add any dataset, copy its resource ID from the "API" button on its data.gov.in page and run:

python scripts/add_dataset.py <resource_id> --sector Agriculture --keywords "wheat,crop,production"

The script fetches the dataset's real title and schema live and appends a verified entry to data/catalog.json. --sector and --keywords are optional.

Notes on the upstream API

A few data.gov.in behaviours this server handles for you:

  • Filter field names are case-sensitive (filters[State]filters[state]) and this is undocumented. Always use the exact field id from get_dataset_info.

  • Some legacy datasets return CSV regardless of format=json; the client detects this via Content-Type and parses it anyway.

  • Last-page pagination can return an empty records array with status: ok; a zero-count result with a positive total means you've paged past the end.

  • Max ~100 rows per request — page through larger sets with offset.

Project layout

datagovin-mcp/
├── server.py              # MCP entry point (stdio); defines the four tools
├── datagovin/
│   ├── client.py          # async data.gov.in API wrapper (quirk handling)
│   └── catalog.py         # curated catalog load + keyword search
├── data/catalog.json      # verified, extensible dataset index
├── scripts/add_dataset.py # enrich the catalog by resource ID
├── requirements.txt
└── pyproject.toml

License

MIT

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Description: Query India's open geo data in natural language. 8 tools: list layers, inspect schemas, filter/group any column, point-in-polygon locate, spatial proximity search, downloads in 5 formats. Covers admin boundaries (state to village), city wards, forests, rivers, dams, hospitals, highways, airports, and more.
    38
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables querying and analyzing over 90,000 public datasets from the Spanish Government Open Data Portal (datos.gob.es) using natural language, with tools for search, filtering, metadata access, and SPARQL queries.
    10
    5
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides AI-ready access to Indian government statistics through MCP, enabling natural language queries for economic, demographic, and social indicators.
    137
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/beenthatt-rehman/datagovin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server