# IBAMA Dados Abertos MCP

> IBAMA Dados Abertos connects your AI agent directly to Brazil's official environmental open data portal. You can query thousands of records detailing everything from deforestation and wildlife registries to specific environmental fines, all without downloading massive files. This MCP lets you inspect metadata, filter datasets using SQL-like parameters, and map out the entire structure of Brazilian environmental compliance.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** environmental-data, open-data, brazil, sustainability, dataset-discovery, ecology

## Description

This connector gives your AI agent access to critical environmental information published by IBAMA. Instead of manually navigating thousands of records across different departmental portals, your agent handles all the complexity for you. You can search for specific datasets—whether they concern flora, fauna, or licensing status—and immediately query their tabular data using filters. This lets researchers and journalists extract precise facts about environmental infractions or enforcement trends in Brazil. When you connect to this MCP through Vinkius, your AI client can pull metadata, list all available thematic groups, and even map the organizational structure of IBAMA itself. It's direct access to reliable public records, letting you focus on analysis instead of data wrangling.

## Tools

### datastore_search
Runs filters and SQL-like queries directly against raw, tabular environmental data.

### list_datasets
Retrieves a complete list of all available dataset names published by IBAMA.

### list_groups
Lists the main thematic groups, allowing you to narrow down your search criteria (e.g., Flora or Fauna).

### list_organizations
Shows a list of all IBAMA departments and organizational units that publish data.

### search_datasets
Searches for datasets matching specific keywords or criteria, supporting pagination and sorting.

### search_resources
Finds specific data resources based on unique identifiers or defined field parameters.

### show_dataset
Pulls the full metadata and technical details for a specified dataset, letting you understand its scope.

### show_organization
Displays detailed information about a specific IBAMA department and all the datasets it manages.

### show_resource
Provides deep metadata for an individual data resource, detailing its format and update history.

## Prompt Examples

**Prompt:** 
```
Search for datasets related to 'licenciamento ambiental' and show the top 5 results.
```

**Response:** 
```
I found several datasets. The top results include: 'Licenciamento Ambiental Federal', 'Empreendimentos Licenciados', and 'Processos de Licenciamento'. Which one would you like to explore?
```

**Prompt:** 
```
List all thematic groups available in the IBAMA portal.
```

**Response:** 
```
The available thematic groups are: 'Administrativo', 'Autorizações', 'Cadastro', 'Fiscalização', 'Flora', 'Fauna', and 'Qualidade Ambiental'.
```

**Prompt:** 
```
Query the resource 'd34981d9-24c6-4d86-96c3-997d0e0d7f62' for records where the year is 2023.
```

**Response:** 
```
I've queried the DataStore for that resource. I found 150 records for the year 2023. Here are the first few entries showing the location and type of environmental occurrence...
```

## Capabilities

### Discover Data Categories
List every major dataset available and explore all thematic groups (e.g., Flora, Fauna) published by IBAMA.

### Search Specific Datasets
Filter through thousands of datasets using keywords or specific criteria to narrow down your research scope quickly.

### Query Raw Data Tables
Run filters and SQL-like queries directly against CSV data, pulling only the specific records you need without downloading the whole file.

### Inspect Records and Metadata
View detailed information about any dataset or resource to check its provenance, update frequency, and structure.

## Use Cases

### Tracking Deforestation Patterns
A researcher needs to know if deforestation data has been updated in Q1 2024. They start by calling show_dataset for the relevant dataset, checking its metadata, and then use datastore_search with a date filter to pull only the recent records.

### Investigating Licensing Status
A journalist needs proof of environmental fines. They first call list_groups to find 'Fiscalização', then search_datasets within that group, and finally use datastore_search with specific filters (like location ID) to gather the necessary records.

### Mapping Government Structure
A policy analyst needs a comprehensive view of data sources. They call list_organizations first, then iterate through show_organization for each department to build an internal map of who publishes what kind of environmental metrics.

## Benefits

- Stop downloading massive files. The datastore_search tool lets you query CSV and tabular data directly, returning only the exact records needed.
- Don't waste time browsing confusing portals. Use list_groups to see all thematic categories (like 'Fiscalização') before searching for specific datasets.
- Need context on a dataset? show_dataset provides full metadata, telling you exactly where the data comes from and how often it updates.
- Want to know which department is responsible? List organizations shows the structure of IBAMA itself, helping you pinpoint the right source.
- The combination of search_datasets and list_groups means you can systematically map out what kind of environmental metrics exist across the entire portal.

## How It Works

The bottom line is that your agent handles the back-end connection details; you just tell it what environmental facts you need about Brazil.

1. Subscribe to this MCP on Vinkius. If you need higher query limits, provide your IBAMA/CKAN API Key.
2. Direct your AI agent (Claude, Cursor, etc.) to the catalog. Your client will use the available tools to interact with the data portal's structure and APIs.
3. The MCP executes the necessary steps—listing groups, searching resources, or querying data—and returns only the requested environmental information.

## Frequently Asked Questions

**How can I search for datasets related to a specific topic like 'deforestation'?**
You can use the `search_datasets` tool with the query parameter 'q'. For example, searching for 'desmatamento' will return all relevant datasets indexed in the IBAMA portal.

**Is it possible to read the content of a CSV file without downloading it?**
Yes! If the resource is integrated into the DataStore, you can use the `datastore_search` tool with the `resource_id` to query rows, apply filters, and perform full-text searches directly.

**How do I find which datasets are published by a specific IBAMA department?**
Use the `list_organizations` tool to see all departments, then use `show_organization` with the department ID to list all datasets associated with that specific entity.

**If I need to know what thematic categories are available, should I use the `list_groups` tool?**
Yes, run `list_groups` first. This shows you all major thematic areas—like 'Fauna' or 'Autorizações'—so you can narrow your search before running a dataset query.

**How do I check the update status and origin of specific data fields using the `show_resource` tool?**
The `show_resource` tool provides deep metadata. It lets you see the resource's provenance, including when it was last updated or who published it originally.

**What is the best way to find all available datasets using the `list_datasets` command?**
Simply calling `list_datasets` retrieves a full list of every dataset name. This gives you an overview of everything IBAMA has published in its open portal.

**When I run complex searches, can the `search_resources` tool filter by multiple criteria?**
Yes, `search_resources` supports advanced filtering based on specific fields. You don't just search by keywords; you target exact data attributes.

**Do I need to provide an API key when running queries via any tool for better performance or higher limits?**
Providing your API Key is optional but highly recommended. It significantly increases your rate limit capacity, letting your agent run more complex and frequent tasks.