Ayuntamiento de Barcelona MCP for AI. Query City Data from Open Data BCN.
Works with every AI agent you already use
…and any MCP-compatible client








Connect to your AI in seconds.
The Ayuntamiento de Barcelona MCP lets you talk to the Open Data BCN portal and pull structured data from city records.
You can search for specific datasets, inspect metadata, or run complex SQL queries against resources like transportation maps or environmental statistics.
Stop downloading CSVs; just ask your agent what you need.
What your AI can do
Bcn current packages
Lists available datasets, including details on their resources and file formats.
Bcn datastore search sql
Executes complex SQL queries directly against a data resource, allowing advanced data calculations.
Bcn datastore search
Filters existing records within a specific CSV resource using simple search criteria.
Find and list entire datasets by name, topic, or keyword using simple search commands.
Retrieve full metadata on a specific data package to understand its structure and update frequency.
Search through the rows of existing resources using filters, like specifying 'only records from 2023'.
Execute full SQL commands directly against a data resource to calculate metrics or count specific record types.
See every file type and download link connected to a dataset, including their format specifications.
Ask an AI about this
Waiting for input…
Ayuntamiento de Barcelona (CKAN) - 7 Tools
Use these seven tools to discover packages, inspect metadata, and run complex queries against public urban data sets.
Make your AI actually useful.
Add this MCP to Claude, Cursor, or Windsurf and your AI stops guessing. It gets real tools to look things up, take action, and handle the stuff you keep doing by hand.
Start using Ayuntamiento de Barcelona (CKAN) on VinkiusBcn Current Packages
Lists available datasets, including details on their resources and file formats.
Bcn Datastore Search Sql
Executes complex SQL queries directly against a data resource, allowing advanced...
Bcn Datastore Search
Filters existing records within a specific CSV resource using simple search criteria.
Bcn Package List
Retrieves an exhaustive list of all dataset names in the Open Data BCN catalogue for...
Bcn Package Search
Searches the catalog to find datasets that match specific keywords or criteria you...
Bcn Package Show
Gets detailed metadata for a single dataset, showing its full scope and purpose.
Bcn Resource Show
Retrieves specific details about a data resource, including download links and format specifications.
Security and governance baked right in.
Pick your AI client below to get set up. Just create a Vinkius account, subscribe, and you're instantly up and running. We handle the entire backend infrastructure, delivering out-of-the-box support for HTTPS Streamable, SSE, and OAuth2—zero messy routing required.
Choose How to Get Started
Build a custom MCP for your own tools, or connect a ready-made integration from our catalog.
Build Your Own
Turn any API into an MCP. Import a spec, define Agent Skills, or deploy with MCPFusion.
- Import from OpenAPI, Swagger, or YAML specs
- Create Agent Skills with progressive disclosure
- Deploy to edge with MCPFusion framework
- Built in DLP, auth, and compliance on every call
- Real time usage dashboard and cost metering
- Publish to catalog or keep private
Make Your AI Do More
Start with Ayuntamiento de Barcelona (CKAN), then connect any of our 5,100+ other servers whenever your AI needs more. One click, no limits.
- Use this MCP plus 5,100+ others, all in one place
- Add new capabilities to your AI anytime you want
- Every connection is secured and compliant automatically
- Track usage and costs across all your servers
- Works with Claude, ChatGPT, Cursor, and more
- New servers added to the catalog every week
Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Open Data BCN. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
VINKIUS INFRASTRUCTURE
Cloud Hosted
Managed infra
V8 Isolated
Sandboxed per request
Zero-Trust Proxy
No stored credentials
DLP Enforced
Policy on every call
GDPR Compliant
EU data residency
Token Compression
~60% cost reduction
Works with Claude, ChatGPT, Cursor, and more
The Model Context Protocol standardizes how applications expose capabilities to LLMs. Instead of operating in isolation, your AI gains direct access to external platforms, live data, and real-world actions through secure, standardized connections.
This connection provides 7 powerful capabilities that interface natively with Claude, ChatGPT, Cursor, and other compatible AI platforms. No middleware. No custom integration required.
Dealing with massive spreadsheets takes forever today.
Right now, getting city statistics means navigating the Open Data BCN portal. You find a dataset, you download the CSV, and then you open Excel. You spend half your time cleaning up column names, figuring out which date format is wrong, or merging it with another sheet because one metric isn't in the right place.
With this MCP, that process vanishes. You just ask: 'How many traffic incidents happened in District X last year?' Your agent handles the discovery, the filtering, and the data preparation. It returns a clean answer, not 50MB of raw files.
You get actionable insights using bcn_datastore_search_sql.
Before this MCP, if you wanted to count records based on two criteria (e.g., 'only electric buses' AND 'in the Sarrià district'), you had to manually filter and write complex formulas in a spreadsheet—a total headache.
Now, you just ask your agent for that specific count using `bcn_datastore_search_sql`. You get the definitive number instantly. It’s simple, precise, and it works every time.
What your AI can actually do with this
The Barcelona open-source data repository contains massive amounts of municipal information—everything from traffic accident reports to local market records. This MCP connects directly to that source, letting you turn natural conversation into structured data results. Instead of navigating the BCN website and figuring out which file is right, your AI client handles it all.
You can ask for specific metrics or compare different datasets using simple language commands. Because this connection is hosted on Vinkius, you connect once from any compatible agent—Claude, Cursor, Windsurf, etc.—and gain immediate access to this entire catalog of Barcelona’s public data.
It's about getting answers fast. You don't need a background in SQL or API calls; you just need to know what question you're asking the city.
019e3868-9ba6-73f7-89c3-7bbda1d0a808 Here's how it actually works
The bottom line is that you talk to the data like talking to a human analyst; your agent translates that into API calls automatically.
Subscribe to this MCP and provide your Open Data BCN API Token (optional for basic public queries).
Tell your agent exactly what data you need—for example, 'Find all datasets related to tree zones.'
The MCP uses the necessary tools to query Barcelona’s repository and returns a precise list of records or data points.
Who is this actually for?
This MCP is for anyone who deals with large, complex municipal datasets. If you're an urban planner needing real-time infrastructure stats or a researcher tracking environmental changes over time, this cuts out the manual data wrangling.
You need to compare records from different years or filter down millions of municipal entries quickly. You'll use bcn_datastore_search and bcn_datastore_search_sql.
You require accurate, up-to-date statistics on city infrastructure, like public WiFi hotspots or transport routes. You'll start by running a package search to find the right scope.
You need deep metadata inspection and historical data views to build models. bcn_package_show helps you validate the schema before querying.
What Changes When You Connect
Stop downloading massive files just to get a count. Use bcn_datastore_search_sql to calculate totals or averages directly within your agent, saving hours of spreadsheet work.
When you need to find the right data source, start with bcn_package_search. It narrows down thousands of city records based on keywords like 'environment' or 'transportation'.
Need to validate if a dataset is current? Use bcn_resource_show to check metadata and update frequency before relying on the numbers.
The MCP handles complex discovery. You can use bcn_package_list for a full inventory, then follow up with bcn_package_show to get deep technical specs.
It’s faster than manual API calls. Your agent structures the query using tools like bcn_datastore_search, so you just focus on the question.
See it in action
Comparing historical traffic data
A researcher needs to compare accident records from 2021 versus 2023. Instead of downloading two separate CSVs, they ask their agent to run a specific bcn_datastore_search_sql query that selects and aggregates the count for both years simultaneously.
Finding all local WiFi hotspots
An urban planner needs to know every public WiFi resource location. They use bcn_package_search with 'wifi' to locate the primary dataset, then follow up by using bcn_resource_show to confirm its format and download link.
Validating a data source before coding
A developer needs to know if an existing city resource contains latitude and longitude fields. They run bcn_package_show first, checking the metadata structure before writing code that relies on specific columns.
Getting a list of all available data categories
A new analyst joins the project and needs to know what's even available. They simply run bcn_package_list to get an immediate, comprehensive inventory of every dataset name.
The honest tradeoffs
Treating it like a simple file download
A user sees 'traffic data' and tries to just ask for the raw CSV. The agent might fail or return too much unstructured data.
Don't ask for the whole thing. Use bcn_datastore_search or, better yet, use bcn_datastore_search_sql to specify exactly which columns and records you want (e.g., 'Count accidents in District 1 where year=2023').
Manually guessing the correct API endpoint
Trying to manually construct a URL for accident data because they read about it somewhere else.
Start with bcn_package_search using keywords like 'accidents' or 'traffic'. This guides your agent to the official package, and then you can inspect its resources using bcn_resource_show.
Over-relying on basic search
Asking the agent only to list all records for a dataset. This returns millions of rows that are too much to process.
Always refine your scope. After finding the package, use bcn_datastore_search (or SQL) with specific filters (e.g., 'only show results where district=Eixample').
When It Fits, When It Doesn't
Use this MCP if you need to query highly structured, official municipal data from Barcelona. It excels when your goal is metric extraction or deep filtering—you're asking a question that requires combining multiple records into one answer. Don't use it if you just need general web research; other tools are better for that. If your task involves synthesizing text descriptions across dozens of non-structured city pages, this isn't the right tool. Stick to using bcn_package_search and then drilling down with bcn_datastore_search_sql. This combination covers 90% of what data analysts need.
Questions you might have
How do I find datasets related to environmental records using bcn_package_search? +
You simply ask your agent to search for 'environment' or 'air quality'. bcn_package_search will return all relevant dataset packages, which you can then inspect further with bcn_package_show.
What should I use if I need to count records from a specific CSV resource? +
You must run the bcn_datastore_search_sql tool. This allows you to execute SQL commands like SELECT COUNT(*) FROM "resource_id", giving you an accurate tally.
Is there a way to see all available data packages at once? +
Yes, run the bcn_package_list tool. It pulls a comprehensive list of every dataset name in the Open Data BCN catalog so you can start your research.
I want to know what fields are available for a specific resource. +
Use bcn_resource_show. This tool provides detailed metadata, confirming the exact format and structure of any given data file before you attempt to query it.
What is the proper process for handling rate limits when I use bcn_datastore_search? +
You need to manage your API token and be mindful of usage volume. If you hit a limit, your agent will receive an authentication error. For high-volume work, ensure you are using a dedicated API token with increased rate limits configured in the BCN portal.
If I use bcn_package_show, how do I discover all available resources linked to that dataset? +
The bcn_package_show tool provides detailed metadata on the package itself. However, for a complete list of every associated file and its format specifications, you should also check the output from bcn_current_packages.
When do I use bcn_datastore_search versus bcn_datastore_search_sql? +
Use bcn_datastore_search for simple, filtered searches within a resource using common criteria. Reserve bcn_datastore_search_sql when you need the power of full SQL syntax to join data or perform complex calculations across columns.
How does bcn_package_show help me understand the scope and structure of a dataset before I query it? +
Running bcn_package_show gives you all the necessary metadata, including update frequencies and descriptions. This helps confirm if the data provided by the city matches your research needs before attempting any complex queries.
Can I perform SQL queries on Barcelona's public datasets? +
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.
How do I find datasets related to a specific topic like 'transport'? +
Use the bcn_package_search tool with the query parameter q set to your topic. You can also limit the number of results for faster browsing.
Is it possible to see the actual rows of a CSV file without downloading it? +
Absolutely. The bcn_datastore_search tool allows you to query and preview the contents of a resource directly, including filtering and sorting options.
We've already built the connector for Ayuntamiento de Barcelona. Just plug in your AI agents and start using Vinkius.
No hosting. No infrastructure. No complex setup.
All 7 tools are live and waiting.
You're up and running in seconds.
Vinkius gives your AI agents access to the full catalog of app connectors, all fully managed, secure, and enterprise-ready. One subscription, every tool you need.
Built, hosted, and secured by Vinkius. You just connect and go.