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

Step 1 — Connect to JSONPlaceholder Posts API

  1. Click Connect API
  2. Name: JSONPlaceholder Posts
  3. Endpoint: https://jsonplaceholder.typicode.com/posts
  4. Authorization: None
  5. Click Test connectionImport All Data (100 posts)

Result includes columns like id, userId, title, body.

Step 2 — Upload the Enrichment CSV (User Tiers)

  1. Click Upload
  2. Select user_tiers.csv (or drag/drop the downloaded file)
  3. 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

  1. Click Join
  2. Left table: JSONPlaceholder Posts
  3. Right table: user_tiers.csv
  4. Join condition: userId (left) = userId (right)
  5. Join type: Left join
  6. 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)

  1. Open the MCP configuration screen
  2. Create a new resource:
    • Name: posts_enriched
    • Description: "Posts enriched with user tiers; filter by tier, region, and minimum length."
  3. 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; minimum body character length)
    • search (string; optional; full-text substring over title or body)
  4. 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.