# CLI, API & MCP for Complete Beginners

Three ways programs talk — written for someone who hears these letters in every AI conversation and does not want a computer-science class.

---

## Table of Contents

1. [The Big Picture](#the-big-picture)
2. [Key Terms (Plain English)](#key-terms-plain-english)
3. [Door 1: CLI](#door-1-cli)
4. [Door 2: API](#door-2-api)
5. [Door 3: MCP](#door-3-mcp)
6. [The Same Job, Three Doors](#the-same-job-three-doors)
7. [How to Pick](#how-to-pick)
8. [Permissions](#permissions)
9. [How This Fits the Other 101s](#how-this-fits-the-other-101s)
10. [Common Mistakes and How to Avoid Them](#common-mistakes-and-how-to-avoid-them)
11. [Quick Reference Cheat Sheet](#quick-reference-cheat-sheet)
12. [Glossary](#glossary)

---

## The Big Picture

### What problem is this?

You already have a [Terminal](https://goaspi.com/101/terminal/) — a window where you type. You already chat with an AI. Then people say “just call the API” or “connect MCP” and it sounds like a third career.

These are not three products. They are **three doors into the same building**: a way to ask a system to do something or answer something.

- **CLI** — you type the order
- **API** — another program sends the order
- **MCP** — your agent is handed a menu of allowed orders and can place them

Same kitchen. Different who-is-talking.

### The restaurant analogy

| Real world | Tech equivalent |
|---|---|
| You walk up to the counter and say the order | **CLI** — you type a command |
| A written ticket through the kitchen window | **API** — one program asks another, in a format both agree on |
| An intern with the ticket pad, a list of which windows they may use, and your sign-off on anything expensive | **MCP** — the agent gets *tools*, not free rein |
| The kitchen | Gmail, GitHub, a store, a database, a website host |
| The menu | What that system is willing to do |
| “I need last week’s sales” | The job — independent of the door |

You do not need to build an API. You do not need to write an MCP server. You need to know **which door you are standing at**, and what that door cannot do.

### What this is not

- Not a second Terminal 101. The Terminal is the *window*. A CLI is “this app has commands you type in that window.”
- Not a protocol spec. MCP is a plug shape. You plug things in; you do not manufacture the plug on day one.
- Not “which AI is best.” Any serious agent can use more than one door.

---

## Key Terms (Plain English)

### CLI
Command Line Interface. A program you operate by typing commands, usually in the Terminal. `git status` is CLI. See [Terminal 101](https://goaspi.com/101/terminal/) for the window; this page is the idea.

### API
Application Programming Interface. A published way for **software** to ask other software for data or actions. You rarely “see” it. Your apps use it constantly.

### MCP
Model Context Protocol. A standard plug so an **AI agent** can use tools (mail, files, calendars, store data) without you writing custom glue for each one. Think USB: same shape, different devices.

### Command
One typed instruction: `git push`. The CLI door.

### Endpoint / request
One API ask: “give me this” or “do that.” Usually over the internet, with a key that proves who is asking.

### Tool
One thing an agent is allowed to call through MCP (or similar). “Search email.” “Create a calendar event.” “Read this file.”

### Key / token
A password for programs, not for humans. Treat it like a password. Never drop it in a skill file or a public GitHub repo.

---

## Door 1: CLI

**Who talks:** you (or an agent typing *as* you).

**Where:** the Terminal — inside Cursor, in Terminal.app, in a cloud shell.

**What it looks like:**

```text
% git status
On branch main
nothing to commit, working tree clean
```

That is a CLI: a program (`git`) that expects words, not clicks. GitHub Desktop is the same job with buttons. The CLI is the version with a keyboard.

Other CLIs you will meet: `gh` (GitHub), `npm` (JavaScript packages), host CLIs when you deploy a site. Each program has its own words. The Terminal is just the room they all sit in.

**Use the CLI when:** you are at the keyboard, the steps are known, and you want to see exactly what ran.

**Do not use it when:** you need another system to talk to a system with no human in the loop — that is the API door — or you want the agent to have a *menu of tools* instead of shell access to your whole machine.

An agent *can* run CLI commands. That is powerful and easy to over-permit. If you would not paste the command yourself, do not nod through the approval.

---

## Door 2: API

**Who talks:** a program, to a program.

**Where:** you usually do not see it. Behind “Sign in with Google,” behind Seller Central exports, behind every mobile app refreshing a feed.

**What it is:** a contract. “If you send a request that looks like this, with this key, I will send data back that looks like that.”

Human version of a CLI ask:

```text
git status
```

Machine version of an API ask (you do not have to memorize this):

```text
GET /repos/you/project
Authorization: Bearer YOUR_KEY
```

Same *kind* of question (“what’s going on with this project”). Different *who* is asking. The API is how Cursor, Buzz, a dashboard, or a script get information without you clicking.

**Use an API when:** two systems need to talk on a schedule or at volume, and a human typing every request would be the bottleneck.

**You still do not have to build one.** Operators *use* APIs by connecting tools (or by letting an agent use them). Building an API is a different job.

JSON — the curly-brace text you see in responses — is just a labeled lunchbox for data. You can read the labels. You do not need to cook in it yet.

---

## Door 3: MCP

**Who talks:** an agent, through a standard plug, using tools you attached.

**Where:** in Cursor, Claude Code, Codex, Buzz, and other agent hosts that speak MCP.

**What it is:** a USB port for AI tools.

Before MCP, every agent needed custom wiring to read Gmail or a calendar. MCP says: tools advertise themselves in a common shape, and the agent can list them, call them, and show you what it wants to do.

- The **host** is the app where the agent lives (Cursor, etc.).
- The **server** is one plug: Gmail, Drive, a store, a database.
- Each **tool** on that plug is one allowed action.

**Use MCP when:** you want the agent to *do* something in another app (read mail, list files, draft an event) without you becoming the copy-paste layer, and without giving it raw CLI keys to the whole machine.

**MCP is not:**

- A model (that is Claude, GPT, Grok…)
- A skill (that is a recipe — [Skills 101](https://goaspi.com/101/skills/))
- Automatic permission to spend money, send email, or change listings

A skill can *say* “use the Gmail tool.” MCP is how that tool exists. Different shelves.

---

## The Same Job, Three Doors

Job: **get last week’s sales into a recap.**

| Door | What happens | You feel |
|---|---|---|
| **CLI** | You run an export command, get a file, paste it into chat | Hands-on, visible, easy to audit |
| **API** | A script or dashboard pulls the numbers every Monday | No typing; you still built or bought the pipe |
| **MCP** | The agent calls an allowed “get sales” tool, then follows your [skill](https://goaspi.com/101/skills/) to write five bullets | You ask in English; you still approve anything that writes back |

All three can be correct. The recap skill does not care which door the numbers came through — as long as the numbers are real.

If the numbers are in a spreadsheet you already have, the CLI or a paste is enough. If this should happen every Monday with no heroics, you want a pipe (API or a scheduled tool). If you want to *ask* “how did we do last week?” in an agent chat, MCP is the door that makes that not a fantasy.

---

## How to Pick

Ask two questions:

1. **Who is talking?** Me / a script / an agent.
2. **What are they allowed to do?** Read only, or also change something.

Then:

| Situation | Door |
|---|---|
| I am at the keyboard and the command is known | CLI |
| I need this on a schedule, no chat involved | API (or a tool that wraps one) |
| I want to ask an agent in English, and it needs live data or an action | MCP |
| I am still learning the job | CLI or a paste — watch it, then automate |
| The action spends money, emails a customer, or edits a listing | None of them unattended — see Permissions |

If you cannot name the system (Gmail, GitHub, Seller Central), you are not ready for a door. You are still on “what job is this?” That is a [skill](https://goaspi.com/101/skills/) problem, not a plumbing problem.

---

## Permissions

The intern with the ticket pad should not get the vault keys.

- **Read** is cheaper than **write**. Let an agent *see* a calendar before it *creates* events.
- **Approve** anything that sends, publishes, spends, or deletes. Cursor already does this for scary commands — use that pause.
- **Keys are passwords.** `.env` files, password managers, never `SKILL.md`, never a public repo. [GitHub 101](https://goaspi.com/101/github/) — `.gitignore` exists for this.
- **One plug at a time.** Connect Gmail, watch it, then add the next. Twelve MCP servers on day one is how you lose the plot.
- **Revoke is a feature.** If a key leaked, kill it. Do not “hope.”

CLI access to your whole machine is a bigger blast radius than one MCP tool that can only list yesterday’s orders. That is the point of the menu.

---

## How This Fits the Other 101s

| Guide | Role |
|---|---|
| [Terminal](https://goaspi.com/101/terminal/) | The window you type CLI in |
| [GitHub](https://goaspi.com/101/github/) | A system with both a CLI (`git`) and an API |
| [Cursor](https://goaspi.com/101/cursor/) | A host that can run CLI *and* attach MCP tools |
| [Skills](https://goaspi.com/101/skills/) | The recipe — not the hands |
| [HTML](https://goaspi.com/101/html/) | The page. Unrelated door. Different 101. |
| [Buzz](https://goaspi.com/101/buzz/) | A room where agents use tools in front of the team |

Recipe vs hands vs room:

- **Skill** = how to cook the dish
- **CLI / API / MCP** = how ingredients get to the counter
- **Buzz / Cursor** = which kitchen you are standing in

---

## Common Mistakes and How to Avoid Them

| Mistake | Better |
|---|---|
| Calling everything “the API” | Name the door: CLI, API, or MCP |
| Treating MCP as a model | MCP is a plug. The model is the cook. |
| Putting a skill and a tool in one mental bucket | Skill = recipe. Tool = hands. |
| Giving the agent a full shell because MCP felt like work | Start with one read-only tool |
| Pasting API keys into chat or `SKILL.md` | Password manager / env file / gitignore |
| Automating a job you have never done by hand | CLI or paste first, then a pipe |
| Twelve integrations on day one | One door, one system, one job |

---

## Quick Reference Cheat Sheet

| Door | Who talks | You see | Start here when |
|---|---|---|---|
| **CLI** | You | Commands in a Terminal | The step is known and you are present |
| **API** | A program | Usually nothing (or a JSON lunchbox) | Systems need to talk without you |
| **MCP** | An agent with a menu | Tool names + an approval | You want to ask in English |

```
Job: weekly sales recap
  Recipe  → skill (SKILL.md)
  Hands   → CLI export  or  API pull  or  MCP tool
  Kitchen → Cursor / Buzz
```

| I want to… | Use |
|---|---|
| Type `git status` | CLI, in the [Terminal](https://goaspi.com/101/terminal/) |
| Let two apps sync every morning | API (often inside a product you already pay for) |
| Ask an agent “what landed in support yesterday?” | MCP, read-only, one mailbox |
| Stop re-explaining the recap format | A [skill](https://goaspi.com/101/skills/), not a new door |
| Connect a tool in Cursor | One MCP server, watch a single call, then expand |

---

## Glossary

| Term | Definition |
|---|---|
| **CLI** | Command line interface — you type commands at a program |
| **API** | A contract for programs to ask each other for data or actions |
| **MCP** | Standard plug so agents can use tools without custom wiring |
| **Terminal** | The window. Not the same word as CLI. |
| **Command** | One CLI instruction |
| **Tool** | One allowed agent action (often via MCP) |
| **Host** | The app the agent lives in |
| **Server** (MCP) | One plug — Gmail, Drive, store, etc. |
| **Key / token** | A password for programs |
| **JSON** | Labeled text for data, common in API responses |
| **Endpoint** | One API address you can ask |

---

Name the job. Pick the door. Keep write-access on a leash.

More Aspi 101: [Terminal](https://goaspi.com/101/terminal/) · [Skills](https://goaspi.com/101/skills/) · [Cursor](https://goaspi.com/101/cursor/) · [HTML](https://goaspi.com/101/html/) · [All 101 Guides](https://goaspi.com/101/).
