# São Paulo (Cidade) MCP for AI Agents AI Agent Connect

> São Paulo (Cidade) MCP gives you direct access to the city's official open data portal. You can search for public datasets on health, education, and transport, then run SQL queries on CSV files to get specific statistics without downloading anything manually. It connects your AI client to thousands of public records for easier auditing and research.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_kifM9vLzppqz5ePDffcBemEwvLoyLrCEtW9W90Hh/ai-agent-connect
- **Tags:** open-data, urban-data, public-administration, ckan, sql-query

## Description

This Connector puts the São Paulo City Open Data Portal right inside your AI client. Instead of hunting through government websites and manually downloading messy CSV files, you can just ask your agent to find what you need. It handles the heavy lifting of navigating thousands of public records across departments like health, education, and finance. You can search for specific datasets using keywords, browse by theme, or drill down into the metadata of individual files to see exactly what's inside before you commit. If you need specific numbers, you can run SQL queries directly on the data stores. It's a massive shortcut for anyone who needs to audit public spending, track urban development, or pull statistics for research. By connecting this through the Vinkius catalog, you turn a slow, manual data gathering process into a conversation. You get straight answers about city performance and public resources without ever leaving your workspace. You can quickly identify which secretariats own specific data and see how they group their themes. This removes the guesswork from finding public information and lets you focus on analyzing the numbers rather than hunting for them. You can easily find specific bus routes or city-wide payroll data, ensuring you get the most relevant records without the typical friction of government portals.

## Tools

### datastore_search_sql
Run SQL queries on specific resources to filter and aggregate data. This is the fastest way to get specific numbers from large CSV files.

### datastore_search
Search for specific information within a data resource. Use this when you need to find a specific record without writing a full query.

### list_groups
List all thematic groups like Education or Environment. This helps you understand how the city categorizes its various public data sets.

### get_group
Get the specific details for a thematic group. Use this to see all datasets associated with a particular city theme.

### list_organizations
List all city secretariats and organizations that own data. This shows you which government bodies are providing the information.

### get_organization
Get the specific details for a city organization. This helps you identify the specific department responsible for a dataset.

### list_packages
List all available datasets in the city's open data portal. This gives you a complete overview of what data is available to query.

### search_packages
Search for specific datasets using keywords. Use this to find the right data package quickly among thousands of options.

### get_package
Get the specific details and metadata for a dataset. This lets you see the available resources and descriptions for a package.

### get_resource
Get the specific details for an individual data resource. This shows you the file format and metadata for a specific file.

### list_tags
List all tags used across the portal. Use this to discover related information by browsing common keywords.

## Prompt Examples

**Prompt:** 
```
Find datasets about public transport in São Paulo.
```

**Response:** 
```
I found several datasets related to public transport. The most relevant are **Bilhete Único statistics** and **Bus lines and stops**. Would you like to see the resources for one of these?
```

**Prompt:** 
```
List all organizations that provide open data in the portal.
```

**Response:** 
```
I've retrieved the list of organizations. There are over 50 entities, including:

* **Secretaria Municipal da Saúde**
* **Secretaria Municipal de Educação**
* **SPTrans**

Which one should we explore?
```

**Prompt:** 
```
Get the details for the dataset 'folha-de-pagamento'.
```

**Response:** 
```
The dataset **folha-de-pagamento** contains payroll information for city employees. It has 12 resources available, mostly in CSV and PDF formats. Would you like the ID of the latest CSV resource to query it?
```

## Capabilities

### Search for specific datasets using keywords
Find relevant public data packages across the city's various departments.

### Run SQL queries on CSV-backed data stores
Filter and aggregate specific numbers from large datasets without manual downloads.

### Browse city secretariats and thematic groups
Navigate the city's organizational structure to find the right data owners.

### Fetch detailed metadata for public resources
Inspect the structure and contents of individual files before you query them.

### Filter datasets by tags across departments
Discover related public information by browsing common keywords and categories.

## Use Cases

### Audit Public Spending
A journalist asks the agent to find all datasets related to 'folha-de-pagamento' to check city payroll records for transparency.

### Transport Analysis
A researcher uses search_packages to find bus line data and then runs SQL queries to find specific stop counts in different neighborhoods.

### Education Mapping
A developer uses list_groups to find all education-related datasets to build a local dashboard for school resources.

### Health Stats
An analyst queries the health department's data to get statistics on public clinics and bed counts in specific city zones.

## Benefits

- Skip the manual downloads. You can query CSV files directly using datastore_search_sql instead of downloading and cleaning files locally.
- Faster research. Use search_packages to find specific city data in seconds rather than clicking through government portals.
- Detailed data mapping. Use list_organizations and get_organization to understand which departments own specific datasets.
- Precise data filtering. Run SQL queries to get exact numbers for transport or health instead of browsing through hundreds of rows.
- Organized discovery. Use list_groups and list_tags to find related data across different city departments easily.

## How It Works

The bottom line is you get direct, queryable access to São Paulo's public data without the manual download headache.

1. Subscribe to the São Paulo (Cidade) MCP in the Vinkius catalog.
2. Add your optional São Paulo Open Data API Key to increase your rate limits.
3. Ask your agent to find or query specific city data from your preferred client.

## Frequently Asked Questions

**Can the São Paulo (Cidade) MCP help me find health statistics?**
Yes, it searches the official city portal for health-related datasets, allowing you to find data on clinics, hospitals, and public health initiatives.

**Does the São Paulo (Cidade) MCP support SQL queries?**
Yes, you can run SQL queries directly on CSV-backed resources to filter and aggregate data without having to download the files first.

**Can I use the São Paulo (Cidade) MCP for urban planning research?**
Absolutely. It covers a wide range of urban data, including transport, environment, education, and public administration.

**Is the São Paulo (Cidade) MCP good for auditing city spending?**
Yes, it lets you query payroll data and other finance records to help audit public spending and city performance.

**How does the São Paulo (Cidade) MCP handle different city departments?**
It lists all city secretariats and organizations, making it easy to identify which department owns the data you are looking for.

**Can I find specific bus lines using the São Paulo (Cidade) MCP?**
Yes, you can search for transport datasets and then query specific details about bus lines and stops using the query tools.

**How can I search for datasets related to a specific topic like 'Health'?**
You can use the `search_packages` tool with the query 'saúde'. The agent will return a list of matching datasets available in the portal.

**Can I perform SQL queries on the data directly?**
Yes! If a resource is stored in the DataStore, you can use the `datastore_search_sql` tool to run standard SQL queries against the resource ID.

**How do I find which city departments have published data?**
Use the `list_organizations` tool to see all registered entities. Then, use `get_organization` with a specific ID to see all datasets owned by that department.