MCP 是「Agent 對外或對內操作的能力」。架一台 MCP Server,就是把你自己的能力或系統,包成任何支援 MCP 的 Agent 都能用標準方式呼叫的一端。這頁用一張分層結構圖,把它拆開給你看。
flowchart LR
subgraph AGENT["🤖 Agent 端 · 使用方(client)"]
A(["Agent
要做事的那顆腦"]):::result
end
subgraph SERVER["🔌 MCP Server · 你架的那一台"]
direction TB
D["能力宣告
tools 動作 · resources 資料 · prompts 提示"]:::data
X["執行核心
收到呼叫 → 執行 → 回結果"]:::proc
end
subgraph SYS["🏢 你的能力 / 系統 · 被接的一端"]
direction TB
S1[("資料庫")]:::infra
S2["內部 API / 服務"]:::infra
S3[("檔案 / 文件")]:::infra
end
A -->|① 你有哪些工具?| D
D -->|② 回傳能力清單| A
A -->|③ 帶參數呼叫某個工具| X
X -->|④ 實際去操作| S1
X -->|④| S2
X -->|④| S3
X -->|⑤ 把結果回給 Agent| A
classDef data fill:#fef3c7,stroke:#d97706,stroke-width:2px,color:#78350f
classDef proc fill:#dbeafe,stroke:#2563eb,stroke-width:2px,color:#17335e
classDef result fill:#dcfce7,stroke:#16a34a,stroke-width:2px,color:#14532d
classDef infra fill:#e5e9f0,stroke:#475569,stroke-width:2px,color:#1e293b
style AGENT fill:#f0fdf4,stroke:#86efac,color:#166534
style SERVER fill:#eff6ff,stroke:#93c5fd,color:#1e40af
style SYS fill:#f8fafc,stroke:#cbd5e1,color:#475569
重點:Agent 不用知道你系統的內部細節,它只認得那份「能力清單」。你把什麼放進清單、給多少權限,就決定了它能碰什麼。
flowchart LR P1["① 決定
開放哪些能力"]:::proc --> P2["② 定義
每個能力=一個工具
(名稱·輸入·輸出)"]:::proc P2 --> P3["③ 跑起來
成一台 server"]:::proc P3 --> P4(["④ Agent 端設定
連上這台 server"]):::result classDef proc fill:#dbeafe,stroke:#2563eb,stroke-width:2px,color:#17335e classDef result fill:#dcfce7,stroke:#16a34a,stroke-width:2px,color:#14532d
📺 對應單集:MCP 入門 · 架一台 MCP Server | 📚 回課綱總表 →