Ayuntamiento de Barcelona (CKAN)

Ayuntamiento de Barcelona (CKAN) MCP Connector for Claude

F

Access the Open Data BCN portal to query urban datasets, environmental records, and public statistics directly through AI.

7 tools Official Updated Jun 28, 2026 Official Vinkius Partner

Connect to the Ayuntamiento de Barcelona (Open Data BCN) portal and transform public data into actionable insights through natural conversation. This MCP server leverages the CKAN API to provide real-time access to Barcelona's official data repository.

What you can do

  • Dataset Discovery — List all available datasets or search for specific topics like transportation, environment, or demographics using bcn_package_search.
  • Metadata Inspection — Retrieve detailed metadata for specific datasets and resources to understand data structures and update frequencies.
  • Deep Data Querying — Use bcn_datastore_search to filter records within CSV resources or execute complex bcn_datastore_search_sql queries for precise data extraction.
  • Resource Management — List all resources associated with a dataset, including download links and format specifications.

How it works

  1. Subscribe to this server
  2. Enter your Open Data BCN API Token (optional for public data, required for higher rate limits)
  3. Start querying Barcelona's public data from Claude, Cursor, or any MCP-compatible client

Who is this for?

  • Data Analysts & Researchers — Quickly fetch and filter urban data without manual CSV downloads.
  • Urban Planners — Access real-time statistics on city infrastructure and services.
  • Developers — Integrate official city data into applications using SQL-like queries directly from the AI.
open-dataurban-planningpublic-statisticsckan-apicity-datadata-discovery

7 tools expose this connector's capabilities to your AI agent.

bcn_current_packages

List datasets including their resources

bcn_datastore_search_sql

The table name must be the resource_id wrapped in double quotes. Execute SQL queries directly against a resource

bcn_datastore_search

Search and filter records within a specific CSV resource

bcn_package_list

List all dataset names in the Open Data BCN catalogue

bcn_package_search

Search for datasets matching specific criteria

bcn_package_show

Get metadata for a specific dataset

bcn_resource_show

Get metadata for a specific resource

See how to talk to your AI agent using Ayuntamiento de Barcelona (CKAN).

List the first 10 datasets available in the Barcelona Open Data catalogue.

I've retrieved the first 10 datasets. They include 'arbrat-zona' (Tree zones), 'estacions-meteorologiques' (Weather stations), and 'mercats-municipals' (Municipal markets). Would you like to see the resources for any of these?

Search for datasets about 'wifi' in Barcelona and show their descriptions.

I found 3 datasets related to 'wifi'. The main one is 'punts-wifi', which contains the locations of all public WiFi hotspots in the city. It includes resources in CSV, JSON, and KML formats.

Run a SQL query to get the count of records in resource '2023-accidents-gu-bcn'.

The SQL query `SELECT count(*) from "2023-accidents-gu-bcn"` returned a total of 8,452 records for traffic accidents in 2023. Would you like to filter these by district?

Yes, you can use the `bcn_datastore_search_sql` tool to execute SELECT statements directly against any resource that is stored in the portal's datastore.

Related Connectors