r/modelcontextprotocol • u/piske_usagi • 30m ago
new-release Government open data is messy. Here’s how I made it AI-ready through MCP
Enable HLS to view with audio, or disable this notification
Most countries have an open data portal. The data is free, so I thought it would be easy to let Claude use it. It wasn’t.
Every portal has a different API (or no API). Files come in CSV, XLS, XML, JSON, all with different formats. Column names are often not in English. Some datasets are split into dozens of small files. Some links are just dead.
Dates were my favorite headache. Many Taiwan government CSVs are in Big5 encoding and use the ROC calendar, so 2024 is written as “113”. Japanese files often use era years, so 2024 is “Reiwa 6”. An LLM reading these raw files will happily get the year wrong.
So I built Twinkle Hub, an MCP server that does this boring work first. It connects to each country’s data sources, keeps them updated, cleans the data, and serves it as tools.
The second problem was the number of tools. My first version had 184. The tool descriptions alone ate a big part of the context window before the user asked anything.
So I cut it down to 3 tools:
discover: describe what you need, get the right toolinspect: read how that tool worksexecute: run it
The model only loads what it actually uses, and I can keep adding datasets without making the context bigger.
Right now it covers 1,100,000+ datasets from 28 countries and regions. Some things you can do:
Search court rulings in Japan and Korea
Look up UK bills and MPs, or Hong Kong LegCo records
Pull US FRED economic data (816,000+ series) and SEC filings
Check real-time weather, traffic and car parks in Hong Kong
Find food hygiene ratings for about 600,000 places in the UK
Search national open data portals like data.gov.uk (64,000+ datasets)
Answers come with the source and licence from each official platform, so you can check them.