Ayuntamiento de Barcelona MCP. Query Barcelona's Official City Data via Chat
Works with every AI agent you already use
…and any MCP-compatible client
Just plug in your AI agents and start using Vinkius.
Ayuntamiento de Barcelona (CKAN) MCP Server connects your AI client to Barcelona’s official Open Data BCN portal. It lets you query urban datasets, environmental records, and public statistics using natural language.
You can discover available datasets, check metadata, and run complex SQL queries directly against city resources.
What your AI agents can do
Bcn current packages
Lists all resources available for a dataset, including format and download links.
Bcn datastore search
Searches and filters specific records within a designated CSV resource.
Bcn datastore search sql
Runs SQL queries directly against a resource, requiring the resource ID to be quoted.
Use bcn_package_search to find multiple datasets across the entire Open Data BCN catalog based on keywords.
Execute bcn_datastore_search_sql to run SQL statements directly against a specified data resource, allowing deep, filtered data extraction.
Use bcn_datastore_search to search and filter records inside a specific CSV file resource without writing SQL.
Retrieve the full structure and details of any dataset using bcn_package_show.
See all related resources for a dataset, including download links and format types, using bcn_current_packages.
Ask AI about this MCP
Supported MCP Clients
Waiting for input…
Ayuntamiento de Barcelona (CKAN) MCP Server: 7 Tools for Data Query
Use these seven tools to search, filter, and extract structured data from Barcelona's official public datasets using your AI client.
019e3868bcn current packages
Lists all resources available for a dataset, including format and download links.
019e3868bcn datastore search
Searches and filters specific records within a designated CSV resource.
019e3868bcn datastore search sql
Runs SQL queries directly against a resource, requiring the resource ID to be quoted.
019e3868bcn package list
Lists every dataset name available in the Open Data BCN catalogue.
019e3868bcn package search
Searches the Open Data BCN catalogue for datasets matching specific criteria.
019e3868bcn package show
Retrieves the detailed metadata and structure for a specific dataset.
019e3868bcn resource show
Gets the metadata for a specific data resource, detailing its format and usage.
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 4,700+ other servers whenever your AI needs more. One click, no limits.
- Use this MCP plus 4,700+ 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
What you can do with this MCP connector
Your AI client connects to Ayuntamiento de Barcelona (Open Data BCN), letting you pull public data straight from the city. You can use natural language to find, inspect, and query Barcelona's official datasets. You'll find seven tools here to get exactly what you need.
To find data, use bcn_package_search to search the Open Data BCN catalog for datasets matching keywords, or use bcn_package_list to see every dataset name available.
To understand a specific dataset, you can pull the full structure and details using bcn_package_show. You can also get metadata for a specific data resource, including its format and usage, with bcn_resource_show. If you know all the resources for a dataset, bcn_current_packages lists them, giving you download links and format types.
When you're ready to pull data, you've got options. You can search and filter records inside a specific CSV file resource using bcn_datastore_search—you don't need to write SQL for that. If you need something more specific, bcn_datastore_search_sql lets you run SQL statements directly against a resource, provided you quote the resource ID.
For quick looks at all available resources, bcn_package_list shows you everything available.
How Ayuntamiento de Barcelona MCP Works
- 1 Subscribe to this server and provide your Open Data BCN API Token (optional for public data, required for high usage).
- 2 Tell your AI client what data you need (e.g., 'Find all datasets related to public WiFi in Barcelona').
- 3 Your AI client calls the appropriate tool (like
bcn_package_search), and the result—filtered records, metadata, or a count—is returned to you in natural language.
The bottom line is, you ask your AI client a question in plain English, and it runs the necessary API calls to pull the data from Barcelona’s official sources.
Who Is Ayuntamiento de Barcelona MCP For?
This server is for data analysts, researchers, and urban planners who need real-time access to official city records. If you're tired of manually downloading CSVs and running them through local scripts, this is for you. It lets you ask complex questions about city infrastructure and demographics using simple chat commands.
Quickly fetching, filtering, and comparing urban data—like traffic accident counts or demographic changes—without ever leaving the chat interface.
Accessing real-time statistics on city services, public WiFi hotspots, and environmental records to inform infrastructure decisions.
Systematically gathering and structuring data from multiple public sources (e.g., correlating weather station data with municipal market locations).
What Changes When You Connect
- Stop manually downloading and cleaning data. Use
bcn_datastore_searchto filter records inside a CSV resource directly via your AI agent. You get the filtered table right in the chat. - Deep dive into city data with SQL.
bcn_datastore_search_sqllets you run complex queries (like counting accident records) without writing boilerplate code, only specifying the table name. - Quickly find relevant data. Use
bcn_package_searchto search the entire Open Data BCN catalogue for topics like 'transportation' or 'environment' and get a list of matching datasets. - Understand data structure instantly.
bcn_package_showpulls all the metadata for a dataset, so you know exactly what fields are available and how often the data updates. - See all data options at once.
bcn_current_packageslists every resource associated with a dataset, showing you if it's available as CSV, JSON, or another format.
Real-World Use Cases
Calculating Traffic Accident Totals
A researcher needs to know the total number of traffic accidents in 2023. Instead of downloading the large '2023-accidents-gu-bcn' file and running a count in Excel, they ask their agent to 'Count all records in the 2023 accident dataset.' The agent uses bcn_datastore_search_sql and returns the exact count (e.g., 8,452) immediately.
Finding Public WiFi Hotspots
A developer wants to map all public WiFi access points. They use bcn_package_search to find 'wifi' datasets. The agent identifies 'punts-wifi', showing the developer that the data is available in CSV, JSON, and KML formats, letting them choose the right format for their application.
Checking Data Availability
An urban planner needs to know if a specific dataset on tree zones (arbrat-zona) has resource links. They ask the agent, and the agent calls bcn_current_packages, listing all associated resources and confirming the available download formats.
Comparing City Services
A student wants to compare the locations of municipal markets and weather stations. They use bcn_package_search to pull both 'mercats-municipals' and 'estacions-meteorologiques', then use bcn_package_show to verify that both datasets have comparable geographic metadata.
The Tradeoffs
Trying to download everything at once
The user tries to download all 50 datasets listed in the catalog, leading to massive data dumps and unclear usage. They end up with a folder full of unparsed files.
→
Instead, use bcn_package_search to narrow your scope (e.g., 'environment'). Then, use bcn_package_show to vet the dataset before pulling specific resources with bcn_current_packages.
Assuming data is in a simple CSV format
The user assumes all city data is a simple CSV and tries to run a basic filter, but the resource is actually structured JSON or requires a specific SQL syntax.
→
Always check the metadata first. Use bcn_resource_show or bcn_package_show to confirm the resource type and the required querying method before running any filters.
Running vague queries without resource IDs
The user just asks, 'Show me accident data.' The agent can't run the query because it doesn't know the specific data file or resource ID required for the bcn_datastore_search_sql tool.
→
First, use bcn_package_search to find the correct dataset name. Then, use bcn_resource_show to get the specific resource ID, and finally, execute the query with bcn_datastore_search_sql.
When It Fits, When It Doesn't
Use this server if your workflow requires deep, structured data extraction from official, established public data sources. You need to query specific fields, count records, or compare metadata across multiple city topics. This is ideal for data analysts and researchers who need reliable, structured inputs.
Don't use this if you just need a general overview of city data—start with bcn_package_search to explore. Also, don't use it if your data is unstructured or requires image recognition; this server only handles structured records and metadata. If you only need a simple list of datasets, bcn_package_list works, but if you need details, you must use bcn_package_show.
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 server provides 7 capabilities that interface natively with Claude, ChatGPT, Cursor, and any MCP client. No middleware. No custom integration required.
Available Capabilities
Manually gathering city statistics takes hours of clicking.
Today, getting data means navigating the Open Data BCN portal. You click into a topic, find a dataset, then click a resource, maybe download a CSV, and finally open it in a spreadsheet to count rows or filter dates. This manual process is slow, error-prone, and stops you from analyzing anything before lunch.
With the Ayuntamiento de Barcelona (CKAN) MCP Server, you skip the clicking. You tell your agent exactly what you need—'How many public WiFi spots are in the Eixample district?'—and the agent uses the right tools (`bcn_datastore_search_sql`) to run the query and return the answer directly, instantly.
Ayuntamiento de Barcelona (CKAN) MCP Server: Query city data with precision.
Before, figuring out which fields were available or what the data structure was meant tedious cross-referencing between the dataset description and the resource metadata. You'd spend time just verifying the column names.
Now, you just ask the agent to check the metadata. The agent calls `bcn_package_show` or `bcn_resource_show`, and you get the full data blueprint instantly. It's about getting the data structure—not just the data—right, fast.
Common Questions About Ayuntamiento de Barcelona MCP
How do I use bcn_package_search in Ayuntamiento de Barcelona (CKAN) MCP Server? +
You tell your agent what you're looking for, and it uses bcn_package_search to look across the entire Open Data BCN catalogue. It returns a list of datasets that match your keywords, like 'transportation' or 'environment'.
What is the difference between bcn_datastore_search and bcn_datastore_search_sql? +
Use bcn_datastore_search when you just need to filter simple records within a CSV file. Use bcn_datastore_search_sql when you need to run complex, structured queries (like COUNT or JOIN operations) against the data resource.
Do I need an API token for Ayuntamiento de Barcelona (CKAN) MCP Server? +
The token is optional for accessing basic public data, but you'll need it if you're doing high-volume querying or hitting rate limits.
How do I find out what data is available for a specific dataset? +
You can use bcn_package_show to get the general metadata for the dataset, or use bcn_current_packages to list all the specific resources (like CSV or JSON) that dataset contains.
How do I use bcn_package_show to get detailed information about a dataset? +
The bcn_package_show tool retrieves all metadata for a specific dataset. You input the dataset ID, and the tool returns the full description, associated resources, and update history. This helps you understand the data structure before you query it.
What is the purpose of bcn_resource_show, and how does it work? +
The bcn_resource_show tool provides granular metadata for individual data resources. You give it a resource ID, and it tells you the format (CSV, JSON, etc.), the column names, and the size. This is key for planning complex queries.
Can I use bcn_datastore_search_sql for complex filtering on multiple resources? +
No, bcn_datastore_search_sql executes SQL queries against a single, specified resource ID. You must wrap the resource ID in double quotes in your query. If you need multiple resources, you'll need to run separate queries.
What should I do if a query using bcn_datastore_search fails? +
If a query fails, check your resource ID and ensure the data type you are filtering on is correct. You might also hit a rate limit, in which case you'll need to wait or provide an API token.
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.
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
More in this category
IBGE Economia — CNAE Activities
Navigate Brazil's entire economic taxonomy: 1,332 CNAE activity codes across 21 sectors, 87 divisions, 285 groups — the definitive resource for business classification, compliance, and market analysis.
Twelve Labs (Video Understanding)
Search, analyze, and extract semantic insights from video content using Twelve Labs' powerful multimodal AI models.
Open Payments (CMS Physician Data)
Query official CMS Open Payments data to analyze financial relationships between the healthcare industry, physicians, and teaching hospitals.
You might also like
HireVue
Streamline your recruitment process via HireVue — manage candidates, schedule interviews, and track positions directly from any AI agent.
Lusha
Enrich your prospect data with verified direct dials and email addresses from a B2B contact intelligence platform.
Todoist Alternative
Manage your Todoist tasks and projects — audit productivity via AI.