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
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.
Persis isi unduhannya. Baca dulu, lalu salin atau unduh.
# 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.
Peran, primitive, dan transport masing-masing muat dalam satu tabel. Baca dari atas ke bawah sekali; itulah kosakata yang diandaikan setiap dokumen MCP.
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.
Centang delapan kotaknya untuk setiap server baru. Bila akses minimal atau read-only lebih dulu tidak bisa dicentang, ubah konfigurasi servernya sebelum disambungkan.
Letakkan file ini di folder docs repositori atau sematkan di catatan Anda. Glosarium adalah bagian yang akan sering Anda buka lagi.
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.
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.
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.
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.
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.
Jawaban singkat sebelum Anda mengunduhnya.
Pelajaran dan artikel gratis di situs ini yang menjelaskan gagasan di baliknya.
Sumber primer yang diperiksa pada tanggal riset. Ikuti tautannya untuk versi terbaru.
Enam fase kotak centang untuk bekerja dengan coding agent, dari prompt pertama sampai commit.
1 file2.7 KB.md
CLAUDE.md awal 70 baris: proyek, stack, perintah, aturan keras, cara memverifikasi pekerjaan, dan yang tidak boleh dilakukan.
1 file2.1 KB.md
Prompt perencanaan yang mencakup bisnis, domain, tech design, dan langkah kerja, lalu mendaftar keputusan yang perlu Anda ambil.
1 file2.3 KB.md