# Maranhão Open Data MCP for AI Agents AI Agent Connect

> Maranhão Open Data MCP gives your AI agent direct access to the state's public records. Instead of digging through the Maranhão Open Data Portal manually, you can ask your agent to find specific datasets on health, education, or finance. It handles the heavy lifting of searching packages, inspecting resource metadata, and running SQL queries against the official DataStore.

## Overview
- **Category:** knowledge-management
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_ltM6hp390inTajhBbBQzzrjnzpsG4dX6a1IKEuJL/ai-agent-connect
- **Tags:** open-data, transparency, public-records, ckan, dataset-query, state-data

## Description

This Connector bridges the gap between raw government transparency data and your daily workflow. If you're trying to track public spending or social indicators in Maranhão, Brazil, you don't have to spend hours clicking through web portals and trying to figure out which file contains the right information. You can just ask your agent to find the data for you. It connects directly to the state's CKAN-based infrastructure, meaning your AI gets the same level of access to public records as a human researcher. You can pull metadata for specific files, search for keywords across different departments, or even run direct SQL queries to extract specific numbers for a report. It's a massive time-saver for anyone who needs accurate government data without the manual overhead of navigating a complex web interface. When you use this with the Vinkius catalog, it turns a tedious data-gathering task into a quick conversation. It's about getting the right numbers into your hands faster, whether you're building an app, writing a news story, or preparing a budget analysis.

## Tools

### get_package
Pulls metadata for a specific dataset package. This helps you understand what data is included before you try to download it.

### get_resource
Retrieves metadata for specific files like CSVs or API endpoints. Use this to find the exact link for the data you need.

### list_packages
Shows every dataset currently available on the portal. It's the fastest way to see the full scope of available public records.

### search_datastore_sql
Runs raw SQL queries against the state's DataStore. This lets you perform complex filtering and calculations on the data directly.

### search_datastore
Searches for specific rows within a resource. It's a simpler way to find records without writing full SQL.

### search_packages
Finds datasets based on keywords like health or education. Use this to narrow down the portal's contents quickly.

## Prompt Examples

**Prompt:** 
```
What datasets are available for public health in Maranhão?
```

**Response:** 
```
I've found several health-related datasets on the Maranhão Open Data portal. Here are the most relevant ones:

| Dataset Name | Description | Type |
| :--- | :--- | :--- |
| **Leitos Hospitalares** | Hospital bed capacity by region | CSV |
| **Vacinação COVID-19** | Vaccination coverage statistics | CSV |
| **Saúde Pública** | General public health indicators | API |

Would you like me to pull the metadata for any of these?
```

**Prompt:** 
```
Show me the first 5 rows of the public contracts dataset.
```

**Response:** 
```
I've executed a SQL query on the public contracts data. Here are the first 5 records:

| Date | Value | Description |
| :--- | :--- | :--- |
| 2023-01-15 | R$ 450,000.00 | Construction of regional clinic |
| 2023-01-18 | R$ 12,000.00 | Office supplies purchase |
| 2023-02-01 | R$ 1,200,000.00 | Road maintenance contract |
| 2023-02-05 | R$ 50,000.00 | Software license renewal |
| 2023-02-10 | R$ 300,000.00 | School renovation project |
```

**Prompt:** 
```
Find any resources related to COVID-19 vaccination.
```

**Response:** 
```
I found the following resources related to COVID-19 vaccination:

*   **Vacinação COVID-19 (Full Dataset)**
    *   *Format:* CSV
    *   *Link:* [Download here](http://dados.ma.gov.br/resource/...) 
    *   *Description:* Comprehensive data on vaccination rates across all municipalities.

*   **Vaccination Schedule API**
    *   *Format:* API Endpoint
    *   *Link:* [Access API](http://dados.ma.gov.br/resource/...)
    *   *Description:* Real-time endpoint for current vaccination schedules.
```

## Capabilities

### Find specific government datasets
Search for public records on topics like health, education, or finance.

### Pull detailed file metadata
Get specific details for CSVs, PDFs, and API endpoints within a dataset.

### Run SQL queries on the DataStore
Execute complex SQL statements to filter and analyze state data directly.

### Filter resource rows
Search for specific keywords within a dataset's rows without writing SQL.

### List all public data packages
View the full scope of available datasets on the Maranhão portal.

## Use Cases

### Investigating public contracts
A journalist needs to find all public contracts in a specific city. They ask the agent to use search_packages for 'contratos' and then pull the metadata.

### Analyzing health spending
A researcher wants to see the first 50 rows of a health dataset. They ask the agent to run a SQL query using search_datastore_sql to get the specific columns.

### Building a transparency dashboard
A developer is building a dashboard. They use list_packages to map out the available data and get_resource to find the API endpoints.

### Filtering vaccination records
An analyst needs to find specific mentions of 'vaccinação' in the data. They ask the agent to use search_datastore to filter the relevant records.

## Benefits

- Skip the manual browsing of the Maranhão Open Data Portal by using list_packages to see everything at once.
- Get precise data for reports by running complex SQL queries through search_datastore_sql without manual filtering.
- Identify the correct files for your project quickly by pulling metadata with get_package and get_resource.
- Find specific health or education records instantly using search_packages instead of scrolling through pages.
- Automate the data collection process for your apps by letting your agent handle the API interactions.
- Verify government spending and social indicators with real-time data pulled directly from the official CKAN infrastructure.

## How It Works

The bottom line is you get direct, queryable access to Brazilian government data without leaving your chat interface.

1. Subscribe to the Maranhão Open Data MCP on Vinkius.
2. Add your Maranhão API Key in the configuration if you need higher rate limits.
3. Ask your AI client to find, search, or query specific state data.

## Frequently Asked Questions

**What can I actually do with the Maranhão Open Data MCP?**
You can use your AI agent to find, search, and query official government datasets from Maranhão, Brazil. It handles everything from finding the right package to running SQL queries for specific data points.

**Does the Maranhão Open Data MCP support SQL queries?**
Yes, it does. You can ask your agent to run specific SQL queries against the official DataStore to filter results by date, value, or other categories.

**How do I find specific education records using Maranhão Open Data MCP?**
Just ask your agent to search for 'education' or 'escola' using the search tools. It will list the relevant packages and you can then pull the specific records you need.

**Can the Maranhão Open Data MCP help me with government transparency?**
Absolutely. It's designed to give you direct access to public records, making it much easier to track government spending, contracts, and social indicators.

**Is the Maranhão Open Data MCP good for research?**
It's excellent for research. It allows you to quickly gather and analyze large amounts of official data without the hassle of manual web navigation or data cleaning.

**How do I get the best results from the Maranhão Open Data MCP?**
Be specific with your requests. Instead of asking for 'all data,' ask for specific topics like 'health spending' or 'public contracts' to get the most accurate results.

**How do I find datasets about a specific topic like 'education'?**
You can use the `search_packages` tool with a query string. For example, searching for 'educação' will return all related datasets available on the portal.

**Can I query the actual content of a CSV file without downloading it?**
Yes! If the resource is in the DataStore, use `search_datastore` with the Resource ID to search through the rows directly.

**Is it possible to perform complex filtering using SQL?**
Absolutely. Use the `search_datastore_sql` tool to execute standard SQL queries against any resource stored in the portal's DataStore.