Skip to main content
Panduan

MCP Dijelaskan: Panduan Satu Halaman

Host, client, dan server, tiga primitive, dua transport, satu tool call langkah demi langkah, dan checklist keamanan.

Oleh Matthews WongDiperbarui Dicek dengan MCP specification 2026-07-28

Poin utama

Satu halaman Markdown yang menjawab apa itu MCP dan bagaimana bagian-bagiannya terhubung: peran host, client, dan server, siapa yang mengendalikan tool, resource, dan prompt, kapan memilih stdio atau Streamable HTTP, delapan langkah satu tool call, dan checklist sebelum menyambungkan server. Isinya mengikuti spesifikasi 2026-07-28 yang stateless.

1 file

File-nya

Persis isi unduhannya. Baca dulu, lalu salin atau unduh.

mcp-explained.md
# MCP explained, on one page

Checked against the MCP specification, revision 2026-07-28.

## What it is

The Model Context Protocol (MCP) is a protocol, built on JSON-RPC, that lets
an AI application reach tools and data on servers through one standard
interface. A server exposes its capabilities once, and any application that
speaks MCP can use them.

## Host, client, server

| Role   | What it is                        | What it does                                          |
| ------ | --------------------------------- | ----------------------------------------------------- |
| Host   | The AI application you use        | Creates clients, enforces consent, talks to the model |
| Client | A connector inside the host       | Talks to exactly one server                           |
| Server | A local process or remote service | Exposes tools, resources and prompts                  |

One host runs many clients, and each client has a 1:1 relationship with one
server. By design, a server should not be able to read the whole conversation
or see into other servers. The full history stays with the host.

## What a server exposes

| Primitive | Who decides when it is used | What it is                                  |
| --------- | --------------------------- | ------------------------------------------- |
| Tools     | The model                   | Functions the model can call, with a schema |
| Resources | The application             | Data for context, each identified by a URI  |
| Prompts   | The user                    | Message templates, often shown as commands  |

## Two standard transports

| Transport       | How it works                                                                               | Pick it when                                      |
| --------------- | ------------------------------------------------------------------------------------------ | ------------------------------------------------- |
| stdio           | The client launches the server as a subprocess; messages travel on stdin and stdout        | The server runs on the same machine as the client |
| Streamable HTTP | The server is an independent process with one endpoint; every message is its own HTTP POST | The server is remote, or shared by many clients   |

- stdio: the server must write nothing to stdout except MCP messages. Log to
  stderr.
- Streamable HTTP: the server must validate the `Origin` header and should
  authenticate every connection. A reply is one JSON object or an event stream
  scoped to that request.
- The messages mean the same thing on both. Only the delivery differs.
- The older HTTP+SSE transport is deprecated. Do not build on it.

## The life of one tool call

1. The host creates a client for each configured server.
2. The client may call `server/discover` to learn the server's supported
   versions and capabilities.
3. The client sends `tools/list`. The server returns each tool's `name`,
   `description` and `inputSchema`.
4. The model reads those definitions and selects a tool and its arguments.
5. The host should let a human see the call and deny it.
6. The client sends `tools/call` with the tool name and the arguments.
7. The server validates the input, does the work and returns a result:
   `content` for the model, and `isError: true` if the tool failed.
8. The client passes the result to the model, which continues.

The protocol is stateless in this revision. There is no `initialize`
handshake and no session: every request carries its own protocol version and
client capabilities in `_meta`. A server that needs more input answers with an
`input_required` result, and the client retries the same call with the input.

## Two kinds of errors

- **Tool execution error**: a result with `isError: true` and a message. The
  model can read it and retry with better arguments.
- **Protocol error**: a JSON-RPC error, for example an unknown tool. The model
  is less likely to recover from it.

## Before you connect a server

- [ ] I know who wrote it, and I have read what it does.
- [ ] It gets the least access the job needs: one folder, one database role.
- [ ] I start read-only and add write tools only when a task needs them.
- [ ] Secrets come from environment variables, never from a committed file.
- [ ] A human can see and deny tool calls, at least for sensitive operations.
- [ ] I treat tool output as untrusted input. A server that fetches external
      content can carry instructions written by someone else.
- [ ] I treat tool descriptions and annotations as untrusted unless I trust
      the server.
- [ ] A remote server uses HTTPS and authentication.

## Glossary

- **JSON-RPC**: the message format MCP uses, encoded as UTF-8.
- **Capability**: a feature a client or server declares, such as `tools`.
- **`server/discover`**: the request that returns a server's versions,
  capabilities and identity.
- **`inputSchema`**: the JSON Schema that defines a tool's parameters.
- **`_meta`**: the field on every request that carries the protocol version
  and client capabilities.
- **MCP endpoint**: the single URL a Streamable HTTP server accepts POST on.
- **`subscriptions/listen`**: the request a client opens to receive change
  notifications, such as a changed tool list.
- **Handle**: an id a tool returns so later calls can refer to stored state,
  because the protocol has no session.
Cara memakainya

Dari unduh sampai jalan

Pakai saat

  • Anda sering mendengar tentang MCP dan ingin gambaran utuhnya dalam lima menit.
  • Anda akan menyambungkan MCP server dan ingin checklist keamanan lebih dulu.
  • Anda menjelaskan MCP ke tim dan butuh satu halaman untuk dibagikan.
  • Anda mempelajari MCP di revisi lama dan ingin melihat apa yang diubah revisi stateless.
  1. Baca tiga tabelnya

    Peran, primitive, dan transport masing-masing muat dalam satu tabel. Baca dari atas ke bawah sekali; itulah kosakata yang diandaikan setiap dokumen MCP.

  2. Ikuti satu tool call

    Telusuri delapan langkah bernomor itu dengan server yang sudah Anda pakai. Sebutkan bagian mana yang host, mana yang client, dan pesan mana yang tools/list atau tools/call.

  3. Jalankan checklist sebelum menyambungkan

    Centang delapan kotaknya untuk setiap server baru. Bila akses minimal atau read-only lebih dulu tidak bisa dicentang, ubah konfigurasi servernya sebelum disambungkan.

  4. Simpan di dekat konfigurasi Anda

    Letakkan file ini di folder docs repositori atau sematkan di catatan Anda. Glosarium adalah bagian yang akan sering Anda buka lagi.

Isinya

Kenapa ditulis seperti ini

Peran: host, client, server

Host adalah aplikasi AI-nya. Host membuat satu client untuk tiap server, dan setiap client berbicara dengan tepat satu server. Secara desain, server tidak semestinya bisa membaca seluruh percakapan atau mengintip server lain.

Primitive, menurut siapa pengendalinya

Tool bersifat model-controlled: model yang memutuskan kapan memanggilnya. Resource bersifat application-driven: host yang memutuskan cara memasukkannya ke konteks. Prompt bersifat user-controlled: pengguna yang memilihnya, sering kali sebagai slash command.

Transport, beserta kapan memilihnya

Dengan stdio, client menjalankan server sebagai subprocess dan keduanya berkomunikasi lewat stdin dan stdout. Dengan Streamable HTTP, server adalah proses mandiri dengan satu endpoint dan setiap pesan berupa HTTP POST. Makna pesannya sama di keduanya.

Tool call, sesuai revisi terbaru

Langkahnya memakai tools/list dan tools/call serta request server/discover yang opsional. Tidak ada handshake initialize di dalamnya, karena pada revisi 2026-07-28 setiap request membawa versi protokol dan capability client-nya sendiri.

Checklist dan glosarium

Delapan pemeriksaan sebelum menyambungkan server: kepercayaan, akses minimal, read-only lebih dulu, secret di environment, manusia yang bisa menolak pemanggilan, dan output tool yang dianggap tidak tepercaya. Delapan istilah didefinisikan masing-masing dalam satu baris.

Perhatikan

Yang sering salah

  • Banyak tutorial menjelaskan handshake initialize dan header Mcp-Session-Id. Revisi 2026-07-28 menghapus keduanya, jadi jangan mencampur penjelasan itu dengan halaman ini.
  • Panduan ini menjelaskan protokolnya, bukan satu produk tertentu. Cara client meminta persetujuan atau menampilkan resource bergantung pada client tersebut.
  • Satu halaman pasti melewatkan beberapa hal: otorisasi, pagination, caching, dan subscription paling jauh hanya disebut. Baca spesifikasinya sebelum membangun server.
Pertanyaan

Yang sering ditanyakan

Jawaban singkat sebelum Anda mengunduhnya.

Apa itu MCP secara sederhana?

MCP, Model Context Protocol, adalah protokol berbasis JSON-RPC yang memungkinkan aplikasi AI menjangkau tool dan data di server melalui satu antarmuka standar. Server mengekspos tool, resource, dan prompt, dan aplikasi apa pun yang memahami MCP bisa memakainya.

Apa beda host, client, dan server di MCP?

Host adalah aplikasi yang mengoordinasikan semuanya: membuat client, menegakkan persetujuan, dan bekerja dengan model. Client dibuat oleh host dan berkomunikasi dengan tepat satu server. Server mengekspos resource, tool, dan prompt, dan bisa berupa proses lokal atau layanan remote.

Sebaiknya memakai stdio atau Streamable HTTP?

Pakai stdio saat server berjalan di mesin yang sama dengan client, karena client menjalankannya sebagai subprocess. Pakai Streamable HTTP saat server bersifat remote atau dipakai bersama, karena ia berjalan sebagai proses mandiri yang bisa menangani banyak koneksi client. Transport HTTP+SSE yang lama sudah deprecated.

Apakah MCP masih punya handshake initialize?

Tidak pada revisi 2026-07-28. Revisi itu membuat protokolnya stateless: handshake initialize dan session di level protokol dihapus, dan setiap request membawa versi protokol serta capability client di _meta. Client boleh memanggil server/discover lebih dulu untuk mengetahui apa yang didukung server.

Apakah aman menyambungkan MCP server apa saja?

Tidak. Spesifikasinya menyebut harus selalu ada manusia yang bisa menolak pemanggilan tool, dan client wajib menganggap anotasi tool tidak tepercaya kecuali berasal dari server tepercaya. Beri server akses sekecil yang dibutuhkan pekerjaannya dan mulailah dengan tool read-only.

Pelajari lebih dalam

Pelajari apa yang dikemas file ini

Pelajaran dan artikel gratis di situs ini yang menjelaskan gagasan di baliknya.

Sumber

Sumber primer yang diperiksa pada tanggal riset. Ikuti tautannya untuk versi terbaru.

Lainnya dari toolkit

Ambil ini juga

PanduanGratis

Checklist Alur Kerja Coding dengan AI

Enam fase kotak centang untuk bekerja dengan coding agent, dari prompt pertama sampai commit.

  • Claude Code
  • Codex
  • Cursor

1 file2.7 KB.md

TemplateGratis

Template CLAUDE.md untuk Repository Apa Pun

CLAUDE.md awal 70 baris: proyek, stack, perintah, aturan keras, cara memverifikasi pekerjaan, dan yang tidak boleh dilakukan.

  • Claude Code

1 file2.1 KB.md

PromptGratis

Prompt Rencana Sebelum Coding

Prompt perencanaan yang mencakup bisnis, domain, tech design, dan langkah kerja, lalu mendaftar keputusan yang perlu Anda ambil.

  • Claude Code
  • Cursor
  • Claude.ai

1 file2.3 KB.md

Semua item toolkit