# Data.gov Catalog Search MCP Server (`rl1987/datagov-catalog-mcp-server`) Actor

MCP server exposing search over catalog.data.gov (dataset search, organization/publisher/keyword/place suggestions, dataset detail).

- **URL**: https://apify.com/rl1987/datagov-catalog-mcp-server.md
- **Developed by:** [R.L.](https://apify.com/rl1987) (community)
- **Categories:** MCP servers, Developer tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 price for completing a tool calls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### Data.gov Catalog Search MCP Server

An [MCP](https://modelcontextprotocol.io) server that exposes dataset search on [catalog.data.gov](https://catalog.data.gov/?q=) to AI agents as tools — full-text dataset search plus organization, publisher, keyword, and geographic-area filtering, matching the [catalog.data.gov search form](https://catalog.data.gov/?q=). Built on [FastMCP](https://gofastmcp.com) and deployed as an [Apify Actor](https://docs.apify.com/platform) in Standby mode, so it runs as a persistent HTTP endpoint rather than a one-shot batch job.

#### Why use this?

catalog.data.gov has no public dataset-search API — its `/api/3/action/*` CKAN endpoints are disabled. Anyone wanting to search it programmatically has to hand-roll HTML scraping and reverse-engineer its filter form. This server does that work once: it wraps the site's search results, its internal autocomplete endpoints (organization, publisher, keyword, place), and per-dataset detail pages into MCP tools an agent can call directly. Running it on Apify gives you a hosted, always-on endpoint with API-token auth and usage-based billing, instead of self-hosting a scraper.

#### How to use

1. If you don't have one, create a free [Apify account](https://console.apify.com/sign-up) and grab your API token from [console.apify.com/settings/integrations](https://console.apify.com/settings/integrations).
2. Open this Actor's page in Apify Console and copy its MCP endpoint URL from the API tab (it looks like `https://rl1987--datagov-catalog-mcp-server.apify.actor/mcp`).
3. Connect your MCP client (Claude Code, Claude Desktop, an agent framework, etc.) to that URL over Streamable HTTP, passing your Apify API token as a Bearer token — see **Connect to Claude Code** below for the exact command.
4. Call `search_datasets`, `get_dataset`, or one of the `suggest_*` tools from your agent. You're billed per completed tool call — see **Pricing**.

#### Connect to Claude Code

With the Actor's MCP endpoint URL and your Apify API token from above, run:

```
claude mcp add --transport http datagov-catalog https://rl1987--datagov-catalog-mcp-server.apify.actor/mcp \
  --header "Authorization: Bearer <YOUR_APIFY_API_TOKEN>"
```

Replace `<YOUR_APIFY_API_TOKEN>` with your own Apify API token — not the Actor owner's.

This adds the server at `local` scope (private, current project only). Add `--scope user` instead to make it available in every project on your machine.

Verify it connected: run `claude mcp list`, or type `/mcp` in an interactive Claude Code session — `datagov-catalog` should show as connected with 10 tools.

Try it: ask Claude "find EPA drinking-water datasets in California" or "what keywords does data.gov use for water-quality datasets?" — it will call the tools directly.

Remove it later with `claude mcp remove datagov-catalog`.

If you're on a team and want everyone to pick up this server automatically, commit a `.mcp.json` with just the URL (never the token) to your repo root:

```
{
  "mcpServers": {
    "datagov-catalog": {
      "type": "http",
      "url": "https://rl1987--datagov-catalog-mcp-server.apify.actor/mcp"
    }
  }
}
```

Each teammate then runs the `claude mcp add ... --scope local` command above once with their own token, which layers on top of the shared `.mcp.json` config without ever touching the repo.

#### Input

No Actor input is required to start the server — it runs in Standby mode and accepts MCP tool calls directly over HTTP.

#### Tools

- **search\_datasets** — search datasets by free-text query plus organization, organization type, publisher, keyword, and geographic-area filters. Cursor-paginated.
- **get\_dataset** — fetch full detail for one dataset (schema.org JSON-LD plus resource/download links) by its dataset id/slug.
- **suggest\_organizations** — autocomplete publishing organizations by name, for use as `search_datasets(organization_slug=...)`.
- **suggest\_publishers** — autocomplete publishers by name, for use as `search_datasets(publisher=...)`.
- **suggest\_keywords** — autocomplete keywords/tags, for use in `search_datasets(keywords=[...])`.
- **suggest\_places** — autocomplete geographic places (states, counties, etc.), resolving a place name to the `location_id` used by `search_datasets(location_id=...)`.
- **list\_organization\_types** — the fixed set of organization-type values (e.g. `Federal Government`).
- **list\_metrics\_organizations** — the organizations selectable in the [data.gov/metrics/](https://data.gov/metrics/) dropdown, for use as `organization_slug` in `get_organization_metrics`.
- **get\_sitewide\_metrics** — data.gov's sitewide usage metrics (pageviews, device breakdown, most downloaded files, most clicked outbound links, datasets/harvest-sources per organization), with every table's CSV download link and per-row links.
- **get\_organization\_metrics** — one organization's usage metrics (most viewed dataset pages, most downloaded files, most clicked outbound links), e.g. from [data.gov/metrics/organization/fcc/index.html](https://data.gov/metrics/organization/fcc/index.html).

#### Output

Each tool returns structured JSON. Example `search_datasets` output:

```json
{
  "results": [
    {
      "title": "Drinking Water - Public Water System Information",
      "url": "https://catalog.data.gov/dataset/drinking-water-public-water-system-information",
      "dataset_id": "drinking-water-public-water-system-information",
      "organization": "State of California",
      "organization_slug": "california",
      "last_updated": "August 22, 2024 at 03:39 PM",
      "description": "Curated dataset of information for all public water systems (PWS) in California...",
      "formats": ["CSV", "PDF"],
      "search_relevance": 85.33
    }
  ],
  "total_matches": 10000,
  "total_is_lower_bound": true,
  "next_cursor": "Wzc4LjMwODM5NSwwLC...",
  "has_more": true
}
```

#### Pricing

This Actor uses [Pay Per Event](https://docs.apify.com/platform/actors/publishing/monetize#pay-per-event-pricing-model) pricing: a flat fee per completed tool call (see `.actor/pay_per_event.json`). There is no charge for failed calls or for connecting/idling.

#### Tips

- Resolve human-typed filter values first with `suggest_organizations` / `suggest_places` / `suggest_publishers` / `suggest_keywords`, then pass the returned slug/id into `search_datasets` — don't guess the exact organization or place name.
- The first page of `search_datasets` (no `cursor`) always returns up to 20 results regardless of `per_page`; pass the returned `next_cursor` back in to page further, where `per_page` takes effect.
- `total_matches` comes back with `total_is_lower_bound: true` above roughly 10,000 matches — the site itself only reports "Found over 10000 datasets" rather than an exact count at that scale.

#### FAQ

This Actor only reads publicly published search results and JSON endpoints from catalog.data.gov — it performs no authentication and stores no personal data. There is no public dataset-search API on catalog.data.gov, so `search_datasets` parses the site's own server-rendered search-results HTML; a future redesign of that page could require an update here. Report issues via the Actor's Issues tab.

# Actor input Schema

## Actor input object example

```json
{}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("rl1987/datagov-catalog-mcp-server").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("rl1987/datagov-catalog-mcp-server").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call rl1987/datagov-catalog-mcp-server --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=rl1987/datagov-catalog-mcp-server",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/PIVefZT9oh5D8EdKg/builds/YO839j6DJMJJoToyD/openapi.json
