MCP: Enrich Public API with CSV and Filter at Scale
Connect JSONPlaceholder Posts API, enrich with a CSV, and expose an MCP tool that filters large combined datasets.
MCP: Enrich Public API with CSV and Filter at Scale
This guide shows how to connect to a real public API (JSONPlaceholder), enrich it with your own CSV data, and expose the result via an MCP tool that supports fast, server-side filtering over large, combined datasets. Great for sharing with LLMs (Claude, GPT) so they can query your enriched data directly.
Prerequisites
- Be logged in to your InstantRows account
- Download the sample CSV: User Tiers (CSV)
- Or copy the inline CSV below as
user_tiers.csv
- Or copy the inline CSV below as
Step 1 — Connect to JSONPlaceholder Posts API
- Click Connect API
- Name:
JSONPlaceholder Posts - Endpoint:
https://jsonplaceholder.typicode.com/posts - Authorization: None
- Click Test connection → Import All Data (100 posts)
Result includes columns like id, userId, title, body.
Step 2 — Upload the Enrichment CSV (User Tiers)
- Click Upload
- Select
user_tiers.csv(or drag/drop the downloaded file) - Confirm columns preview
Use this CSV (copy-paste into a file named user_tiers.csv):
userId,tier,region,country
1,Gold,NA,US
2,Silver,EU,DE
3,Platinum,APAC,JP
4,Bronze,NA,CA
5,Gold,EU,FR
6,Silver,APAC,IN
7,Gold,NA,US
8,Platinum,EU,SE
9,Bronze,APAC,SG
10,Gold,EU,ES
Step 3 — Join API Posts to CSV Tiers
- Click Join
- Left table:
JSONPlaceholder Posts - Right table:
user_tiers.csv - Join condition:
userId(left) =userId(right) - Join type: Left join
- Click Apply
Your combined dataset now includes tier, region, and country for each post, ready for scalable filtering.
Step 4 — Expose as an MCP Resource (Filter at Scale)
- Open the MCP configuration screen
- Create a new resource:
- Name:
posts_enriched - Description: "Posts enriched with user tiers; filter by tier, region, and minimum length."
- Name:
- Configure parameters (types are suggestions):
tier(string; optional; one of: "Gold", "Silver", "Platinum", "Bronze")region(string; optional; e.g., "NA", "EU", "APAC")min_length(integer; optional; minimumbodycharacter length)search(string; optional; full-text substring overtitleorbody)
- Save the resource
The MCP tool will execute validated server-side filtering over the joined dataset, designed for large row counts.
Step 5 — Example LLM Queries via MCP
Ask your LLM to call the MCP tool with parameters. Example intents:
- "Show Gold-tier posts in NA with body length ≥ 500 characters"
- "Find posts mentioning 'performance' for Platinum users in EU"
Example parameter payloads the LLM can send to your MCP resource (actual UI shapes this automatically):
{
"resource": "posts_enriched",
"params": {
"tier": "Gold",
"region": "NA",
"min_length": 500
}
}
{
"resource": "posts_enriched",
"params": {
"tier": "Platinum",
"region": "EU",
"search": "performance"
}
}
What This Demonstrates
- Real public API + your CSV → instant enrichment
- MCP resource exposes a stable, LLM-friendly tool
- Validated, server-side filtering across large, combined datasets
You can share this tutorial publicly (e.g., Reddit) since it uses an open API and a simple CSV anyone can copy.
Ready to Try It Yourself?
Join our waitlist to get early access. Start transforming your data in seconds.