跳到正文
DEV Community· Japan Open Data Lab·· 2026-10-15AI 評分45

MCP Explained in 5 Layers: How I Connected 10.16M Records to AI (and Why It's a Blue Ocean)

MCP Explained in 5 Layers: How I Connected 10.16M Records to AI (and Why It's a Blue Ocean)

AI 導讀

作者透過 MCP 將清理及標準化的 155 個日本官方數據集、共 10.16M 條記錄接入 AI 智能體,並以此説明 MCP 的五層架構。文章將 MCP 伺服器分為數據型、狀態記憶型及動作/遠端型三類。作者認為,為不同 LLM 提供可接入的工具並整理未清理的本地數據,是開發者的藍海機會。

正文

Every week, big tech companies spend hundreds of millions of dollars competing over LLM benchmarks. As indie developers and builders, fighting on that turf is a losing game.

Instead of building another thin chat wrapper, I recently tackled a problem Silicon Valley giants will never touch: cleaning 155 messy Japanese public datasets (10.16 million records) and connecting them directly to AI agents via MCP (Model Context Protocol) in a server called japan-data-mcp.

Building this—and achieving a top quality score on MCP directories—gave me a dead-simple framework for understanding what MCP actually is, how it kills hallucinations, and why MCP is the best blue ocean for developers today.

Here is the whole blueprint.


🔌 What is MCP in One Sentence?

MCP is the universal "USB Type-C port" that plugs external tools and data warehouses directly into an AI's brain.

Before MCP, connecting an LLM to a database or local tool required custom glue code for every provider. With MCP, you write a server once and plug it into Claude Desktop, Cursor, Windsurf, Cline, or your own local agent.

It transforms AI from a chatbot relying on fuzzy training memory into an autonomous worker using deterministic tools.


🏗️ The 5 Roles of a Production AI System

A real-world AI system is never just an LLM doing everything alone. Think of it like a company organization (or Mega Man equipping special weapon cassettes):

+-------------------------------------------------------------------+
| [5] Reception Desk (UI / Host: Claude Desktop, Cursor, Mobile UI) |
+-------------------------------------------------------------------+
                                 |
+-------------------------------------------------------------------+
| [4] SOP / Guidelines (System Prompt: "Never guess. Use tools.")   |
+-------------------------------------------------------------------+
                                 |
+-------------------------------------------------------------------+
| [1] The Brain (LLM: Claude, Gemini, local Gemma)                  |
|     "Brilliant new-grad elite, but knows zero internal facts"     |
+-------------------------------------------------------------------+
                                 |  <-- MCP (USB Type-C Port)
+-------------------------------------------------------------------+
| [3] Hands & Tools (MCP Server: Calculator, Query Engine, Alerts)  |
+-------------------------------------------------------------------+
                                 |
+-------------------------------------------------------------------+
| [2] Memory & Archive (10.16M-Row DB, or a local Markdown file)    |
+-------------------------------------------------------------------+
  1. The Brain (LLM: Claude, Gemini, Gemma)
    • A brilliant new-grad elite trained with billions of dollars. Great at reasoning and language, but knows nothing about your company's internal data or today's exact numbers.
  2. The Memory & Archive (Databases & Files)
    • The official ledger and manual in the office cabinet. This could be my 155 cleaned public datasets (10.16M records) or a single Markdown file on your smartphone.
  3. The Hands & Tools (MCP & External Tools)
    • The calculator, search terminal, telephone, or special weapon you hand to the new hire so they can actually query, calculate, and trigger actions.
  4. The SOP / Instruction Memo (System Prompt)
    • The manager's strict rule: "Look at the ledger (#2) and use the calculator (#3). Never guess from memory."
  5. The Reception Desk (UI / Client)
    • The counter that humans touch (Cursor, Claude Desktop, or a mobile app).

🎯 Why Hallucinations Physically Disappear

  • Bare LLM (Without MCP): Like a teacher standing at the podium empty-handed, with no textbook and no calculator. When asked for specific figures, they improvise a plausible-sounding lie from fuzzy memory.
  • LLM + MCP: You put the official ledger (#2) on the desk, hand them a calculator (#3), and forbid guessing (#4).

Because the AI is reduced to pointing at the official ledger and reading out the calculator's output, factual hallucinations become physically impossible.


🧩 The 3 Archetypes of MCP Servers

You don't need millions of rows of data to build an MCP server. They fall into three distinct patterns:

Type Backed By Best Use Cases
1. Data-Backed MCP Massive, pre-cleaned database (e.g., japan-data-mcp) High-moat B2B intelligence, market & government research
2. Stateful Memory MCP Starts with an empty file (Markdown / SQLite) that the AI updates Personal AI companions, contradiction-free novel writing, TRPGs
3. Action / Remote MCP Zero state; triggers OS clicks, APIs, emails, Slack alerts Workflow automation, RPA replacement

🌊 Why MCP is the Ultimate Blue Ocean for Builders

  1. Sell Pickaxes, Avoid the LLM War: Building "The Brain" (#1) costs billions. Building MCP tools (#3) means whichever LLM wins next week, your tool plugs right into it.
  2. Big Tech Won't Clean "Dirty" Local Data: Japanese government open data is full of merged Excel cells, legacy Shift_JIS encodings, and imperial era dates (Showa/Heisei/Reiwa). Google and Anthropic will never unmerge those cells or join them via 13-digit corporate numbers and 5-digit municipal codes. Cleaning and owning the messy ledger (#2) gives you an unbreakable moat.
  3. B2B Expense Budgets vs. Consumer Pocket Change: An MCP server that turns 3 days of manual procurement or market research into a 10-second query directly replaces overtime and consulting fees—making it an easy corporate expense.

🚀 What's Live Now & 3 Next-Gen Ideas

What We Built: japan-data-mcp

We cleaned and normalized 155 official datasets (10.16M+ records)—including 100% of disclosed GEPS central government procurement awards (2020–2026), 44 years of land price valuations (1983–2026), and all 1,741 municipalities—and exposed them via MCP.

{
  "mcpServers": {
    "japan-data": {
      "command": "npx",
      "args": ["-y", "japan-data-mcp"],
      "env": {
        "RAPIDAPI_KEY": "YOUR_API_KEY"
      }
    }
  }
}

3 Ideas I'm Exploring Next

  1. B2B Action MCPs: Combining our 10.16M-row database with Action MCPs to auto-detect new government tenders, notify teams on Slack, and draft initial proposals from historical winning bid prices.
  2. Zero-Cost Offline AI Companion on Pixel: Pairing an on-device LLM (like Gemma) with a Stateful Memory MCP that appends daily memories to local Markdown files—100% offline, zero API cost.
  3. Contradiction-Free "Novelist & TRPG" MCP: Letting the AI manage character sheets, world lore, and timelines via MCP so long-form stories and RPG campaigns never suffer from plot holes.

What kind of MCP server are you building (or planning to build) next? Data-backed, Stateful Memory, or Action-oriented? Let's discuss in the comments! 👇

來源:DEV Community · dev.to