# Comunidad de Madrid MCP for AI Agents AI Agent Connect

> Comunidad de Madrid (Portal Regional) MCP lets you pull public records from the official open data portal using plain language. You can search for datasets on health, transport, and the economy, then query the actual data content without having to download CSVs manually.

## Overview
- **Category:** knowledge-management
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_7cdDapszvOLEkDlmwLc3xNFaEIzb6o8uXXM342yx/ai-agent-connect
- **Tags:** madrid, open-data, ckan, spain, public-records

## Description

The Comunidad de Madrid (Portal Regional) MCP lets you pull public records from the official open data portal using plain language. It bridges the gap to the regional CKAN repository, bringing information on transport, health, and the economy directly into your chat. You can search for specific datasets using keywords, inspect metadata to see update frequencies, and query the actual content of the data without manual downloads. This makes it much easier to gather regional statistics for projects. Since Vinkius hosts this, you can plug it into your existing workflow and start pulling Madrid's public data in seconds. It turns a sprawling government database into a searchable knowledge base for your research or development. Instead of hunting through a clunky government website, you just ask your agent for the facts. You can look for specific records on air quality, economic indicators, or public health resources without ever having to navigate a complex menu. It handles the heavy lifting of searching through the CKAN-based repository so you can focus on what the data actually means for your work. Whether you are trying to build a new app for local residents or just need a few numbers for a report, this connection puts the entire regional repository at your fingertips.

## Tools

### list_datasets
List all dataset identifiers in the portal. Use this to see the full scope of what the region offers.

### search_datasets
Search for datasets matching specific criteria. You can find records on topics like transport or health.

### search_datastore
Query data directly from a resource in the DataStore. This allows you to pull specific data points without downloading files.

### get_resource
Get metadata for a specific resource. This helps you see the details of a specific file in a dataset.

### get_dataset
Get full metadata for a specific dataset. Use this to see update frequencies and organization tags.

## Prompt Examples

**Prompt:** 
```
Find some data on air quality in Madrid.
```

**Response:** 
```
I found several datasets related to air quality. Here are the most relevant ones:

| Dataset Name | ID | Update Frequency |
| :--- | :--- | :--- |
| Calidad del aire: datos diarios | calidad_aire_datos_dia | Daily |
| Informe de calidad del aire | informe_calidad_aire | Monthly |

Would you like to see the specific resources for the daily data?
```

**Prompt:** 
```
What datasets are available for public transport?
```

**Response:** 
```
There are several transport-related datasets available in the Madrid portal. Some examples include:

* **transporte_publico_lineas**
* **red_metro_estaciones**
* **autobus_urbanos_rutas**

I can pull the full metadata for any of these if you need more details.
```

**Prompt:** 
```
Get the metadata for the health centers dataset.
```

**Response:** 
```
Here is the metadata for the health centers dataset:

* **Organization:** Department of Health
* **Last Updated:** 2024-05-01
* **Tags:** salud, centros_medicos, Madrid
* **Description:** Contains a list of all public health centers in the community.

Would you like to see the files included in this dataset?
```

## Capabilities

### Search for regional datasets
Find specific public records by using keywords like health, transport, or economy.

### Pull full metadata
Get detailed information about a dataset including its organization and update frequency.

### Inspect individual files
View details for specific resources like CSVs or PDFs within a dataset.

### Run direct data queries
Query the actual data content of a resource directly without downloading files.

### Browse dataset identifiers
List all available dataset IDs to see the full scope of regional information.

## Use Cases

### Air Quality Tracking
A researcher asks for air quality trends. The agent uses search_datasets to find the right records and then pulls the latest values.

### Transport Planning
A developer needs to see public transit lines. The agent uses search_datasets to find transport data and lists the available resources.

### Economic Analysis
An analyst wants to see municipal budgets. The agent uses search_datastore to query specific financial figures directly.

### Public Health Review
A citizen asks about local health centers. The agent uses search_datasets to identify the relevant regional health records.

## Benefits

- Get specific data points without downloading files by using search_datastore.
- Find records on topics like health or transport quickly with search_datasets.
- Understand data freshness and ownership with get_dataset metadata.
- Browse the full scope of regional information using list_datasets.
- Access diverse categories like economic indicators through one connection.
- Inspect individual files like PDFs or CSVs within a dataset using get_resource.

## How It Works

The bottom line is you get instant access to Madrid's public records through a simple chat interface.

1. Subscribe to the Connector and connect it to your AI client.
2. Optionally enter your CKAN API Key to increase your rate limits.
3. Ask your agent to find or query specific Madrid regional data.

## Frequently Asked Questions

**Does the Comunidad de Madrid MCP work for other regions?**
No, this Connector is specifically designed to access the official open data portal for the Community of Madrid. For other regions, you would need a different regional connector.

**Can I use the Comunidad de Madrid MCP to find transport schedules?**
Yes, you can use it to find datasets and resources related to public transport, including bus routes and metro lines.

**Do I need an API key for the Comunidad de Madrid MCP?**
An API key is optional. However, providing your Comunidad de Madrid CKAN API key can help you achieve higher rate limits for your queries.

**How does the Comunidad de Madrid MCP handle large datasets?**
It allows your agent to query the datastore directly. This means you can pull specific information without needing to download and process large files locally.

**Is the data in the Comunidad de Madrid MCP up to date?**
The Connector pulls directly from the official regional portal. You can check the update frequency of any specific dataset using the metadata tools.

**How can I find datasets about a specific topic like 'transport'?**
Use the `search_datasets` tool with the query 'transporte'. The agent will return a list of matching datasets with their unique IDs and descriptions from the portal.

**Can I see the actual content of a data file without downloading it?**
Yes. If the resource is stored in the CKAN DataStore, you can use the `search_datastore` tool with the Resource ID to query the rows and columns directly.

**Is an API key mandatory to use this server?**
No, it is optional. However, providing a `CKAN_API_KEY` allows for higher rate limits and access to restricted datasets if your account has permissions.