Learn MCP

Start from "what is MCP" and work up, step by step, to how AI safely uses external tools and data.

20–30 minutes estimated time Beginner difficulty Not required coding background

What Is MCP?

MCP is a standard interface between AI and external tools.

AI

Understands your question, but shouldn't be able to freely access every system.

MCP

Defines which tools the AI may use, and what arguments each one needs.

Tool / Data

The real service that actually queries or reads the canonical data.

User

AI

MCP Tool

Canonical Data

Answer

Why Not Let AI Connect to Everything Directly?

Without MCP

  • Every service uses a different API
  • The AI has to guess the argument format
  • No shared permission model
  • Hard to track what tools were used

With MCP

  • The AI can list the available tools first
  • Arguments follow a declared schema
  • One consistent protocol
  • It's explicit which operations are allowed

Core Concepts

The Model Context Protocol (MCP) is a common protocol that lets AI applications discover and use external tools and trusted data sources, instead of relying only on what a model already knows.

Host

The AI application the user talks to, such as Claude, ChatGPT, an IDE, or a custom agent.

MCP Client

Code inside the host that speaks the MCP protocol: discovers tools and sends requests on the host's behalf.

MCP Server

A service, like this one, that exposes a fixed set of tools over MCP. NTPU AI4X MCP is one such server.

Tool

One narrow, named capability with a validated input schema, for example search_projects.

Authoritative Data

The trusted source behind a tool's answer: for AI4X MCP, canonical records with a known source, version, and verification time.

Capability Discovery

Before calling a tool, a client can list what a server offers (tools/list) instead of hard-coding assumptions about it.

What Happens During One Tool Call?

Example question: "Which faculty work on Agentic AI?"

  1. User question

    "Which faculty work on Agentic AI?"

  2. AI Assistant

    Interprets the user's intent.

  3. MCP Client

    Discovers the tools this server offers.

  4. Tool selection

    Candidate tool: find_research_experts.

  5. Tool call

    {"topic": "agentic AI", "role": "faculty"}

  6. AI4X MCP Server

    Validates arguments, executes the tool, queries authoritative data.

  7. Result

    Matching members, evidence, and provenance are returned.

  8. Answer

    The AI assistant generates a grounded answer from the returned evidence.

This walkthrough shows the tool that was selected, its arguments, and the data returned. It does not expose or claim to expose a model's private internal reasoning.

What actually happens technically?
  • The client calls tools/list to discover available tools and their schemas.
  • The client calls tools/call with a tool name and validated arguments.
  • Both are JSON-RPC 2.0 requests over MCP's Streamable HTTP transport.

Try it in the Playground β†’

What Do These Concepts Map to in AI4X MCP?

MCP Client

ChatGPT / Claude / an IDE

MCP Server

ai4x-mcp-server

Tool

search_members / search_projects / …

Schema

Zod

Structured Data

Cloudflare D1

Documents

Cloudflare R2

See the full technical architecture β†’

Architecture is shown at three levels of detail. Each level is labeled with how sure we are of it: this deployment's transport and tool layer are VERIFIED by tests; the request-flow and beginner diagrams are DOCUMENTED simplifications for teaching, not separate running components.

ILLUSTRATIVE: simplified for a first-time reader

AI Assistant
  ↓
MCP
  ↓
AI4X Tools
  ↓
Official AI4X Data

Understanding Your First MCP Tool

Tool name
get_center_info
Purpose
Gets AI4X center information.
Input
No parameters needed.
Output
Center name, mission, and source information.
Security
Read-only Β· Public Β· L0 Β· R0

This means the AI doesn't need to know SQL β€” it only needs to know what this tool can do.

A Tool With Parameters

Question
"Which members research AI?"
AI picks
search_members
Arguments
{"keyword": "AI"}
Result
A short list of matching members
See the full request / response
JSON
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_members","arguments":{"keyword":"AI"}}}
JSON
{ "items": [{ "id", "slug", "nameZh", "nameEn", "role", "status", "profileUrl" }], "count": number, "provenance": Provenance[] }

MCP vs a Regular API

API

  • The developer picks the endpoint
  • The developer reads the API docs
  • The developer builds the arguments

MCP

  • The AI can retrieve tool descriptions
  • Schemas are machine-readable
  • Tool discovery is part of the protocol

MCP does not replace REST APIs. MCP provides a standardized protocol layer that allows AI applications to discover and use external capabilities.

MCP vs RAG

RAG

Purpose: feed document content to the model as context.

Typical use: document search, knowledge-base Q&A.

MCP

Purpose: let AI use structured tools and external services.

Typical use: querying data, calling services, performing a defined action.

The two can be used together β€” they are not mutually exclusive.

AI4X MCP's Security Design

Read-Only

AI4X MCP v1 provides no tool that modifies data.

Fixed Tools

There is no execute_sql, run_shell, or fetch_url.

Schema Validation

Every input is validated before it runs.

Official Sources

Queries only use already-synced canonical data.

See the full security design β†’

Try It Yourself Now

  1. 1

    Pick a client

    Claude Code Claude Desktop ChatGPT VS Code
  2. 2

    Connect

    URL
    https://ai4x.mcp.ntpu.ai/mcp
  3. 3

    Ask

    "Use AI4X MCP to tell me what public services the AI4X center offers."

  4. 4

    Observe

    • Which tool did the AI pick?
    • What arguments did it send?
    • What source was returned?

Open the Playground β†’

Check What You Know

Q1: What is the MCP Server's main job?

A. Train an AI model B. Provide standardized tools for AI to use C. Store browser cookies

Answer: B

Q2: Before calling a tool, what can an MCP client do?

A. Guess the tool's parameters B. List the available tools first C. Skip validation

Answer: B

Q3: What does AI4X MCP do when there's no authoritative source for an answer?

A. Guess an answer anyway B. Return an explicit "no authoritative source" error C. Make up a source

Answer: B

Next Steps

30-Minute MCP Lab

A self-paced lab for a first MCP session. No installation required.

Time Activity
0–5 min What is MCP?
5–10 min Ask AI4X
10–15 min Inspect the Visual Trace
15–20 min Use Tool Explorer
20–25 min Inspect an MCP request/response
25–30 min Connect an MCP client

Congratulations! You have used an MCP server.

90-Minute Workshop

A longer, instructor-led session covering why MCP exists through designing a new tool.

Part Time Activity
1. Why MCP 15 min LLM limitations, tool use, grounding, why MCP exists.
2. Use MCP 15 min Use Ask AI4X.
3. Understand MCP 20 min Inspect tools/list, tools/call, and the Visual Trace.
4. Inspect MCP 15 min Study a tool's schema, JSON, provenance, and errors.
5. Connect MCP 15 min Connect one MCP client.
6. Design MCP 10 min Design a university MCP tool.

Build Your Own MCP

A sequence of lessons for designing one new MCP tool, ending in an assignment you can hand in or self-check.

  1. Define a useful tool (e.g. search_courses).
  2. Define its input schema (e.g. {"keyword": "AI", "semester": "115-1"}).
  3. Connect authoritative data : identify one official source.
  4. Add provenance : source, source URL, version if available, retrieval/verification time.
  5. Classify risk : data classification, risk level, read/write permission.
  6. Test it with a local or provided test client.
  7. Explain failure modes : invalid input, not found, stale source, dependency unavailable.

Student Assignment Template

Design one MCP tool for NTPU (e.g. search_courses, find_faculty, search_regulations, find_classrooms, or search_scholarships). Specify:

Tool name
Purpose
Example user question
Input schema
Output schema
Authoritative source
Data classification
Risk level
Permission level
Provenance strategy
Expected errors

Further Reading