PTENES
MODULE 2.2

🧬 The anatomy of an MCP server

Every tool your agent gets through MCP consists of three parts: what it does, what it needs to know, and who has permission to use it. Understanding these three parts removes the mystery from any new server.

6
Topics
30
Minutes
Beginner
Level
Concept
Type
0 of 60%
1

🛠️ Tool: the verb an agent can execute

New here? One protocol it’s simply a set of rules agreed on in advance so two parties can communicate without misunderstanding each other—like saying “over and out” on a radio, but between computer programs. MCP (Model Context Protocol) is the protocol introduced in the previous module: the shared language that lets the agent communicate with a server — a small program running (on your computer or in someone else's cloud) that knows how to do one specific thing and waits for requests. A tool (in English, tool) is a concrete action that server provides—a verb. “Fetch the content of a page,” “send an email,” “read a row from a spreadsheet.” Each MCP server lists its tools along with a short description of each one, and the agent reads those descriptions to decide which tool to use—without you needing to know any technical names.

💡 Main Concept

Think of a tool as the name of a button on a remote control. You don’t need to understand the electronics behind it—just know that pressing that button does that thing. The MCP server is the TV; the tools are the buttons; you just press the right button by saying in Portuguese what you want.

"bring me the prices from this page" agent choose the right tool MCP server performs the action in the real external service your request → tool selection → actual execution

Caption: between your sentence in Portuguese and the action actually happening, there’s an invisible step — the agent deciding which MCP server tool can handle that request.

🔍 See inside

What “travels” between the agent and the server is a structured message—it’s not the plain text you typed, but a package with the name of the chosen tool and the values it needs. The server reads this package, runs the action in the actual service (a website, a database, an API—the “door” another program opens to communicate with yours), and returns the result in the same format. You never see this raw exchange; the agent translates the result back into plain Portuguese.

2

🎛️ Parameter: what the tool needs to know before it acts

New here? Parameter is extra information the tool needs to work properly—the website address, the output file format, the maximum number of pages. You don’t type this in yourself: the agent extracts these values from your request in Portuguese and fills them in automatically.

✓ Example of a clear request

"Extract the prices from the inema.club/planos page, no more than 5 pages." — the agent already has everything the tool needs: a URL and a limit.

✗ Example of a vague request

"Get the prices from around there" — without an address, the agent will have to ask before it can fill in the parameters.

Every parameter has an “expected format” — the tool may require a number (page limit), text (the URL), or an option from a fixed list (output format: csv or json, for example). When a parameter is optional, the MCP server usually has a default value — if you don’t say how many pages, it assumes a reasonable limit on its own, usually a small one, so it doesn’t waste time or calls.

💡 Practical Tip

When you're unsure what a tool needs, just ask: "what parameters does this search tool accept?" — the agent reads the technical description and translates it into Portuguese for you, so you don't have to open any documentation.

3

🔑 Authentication: the key that proves who you are

New here? Authentication it’s proof that you have permission to use that service—usually an “API key,” a unique secret code the service recognizes. It’s like the key card that opens a building’s door: without it, no one gets in, including the agent.

💡 Practical Tip

Always save this key in a file .env — never type it directly into the conversation with the agent. Module 2.3 walks you through the full process.

The key usually comes from signing up on the service’s website—you create an account, generate the key on a settings page, and paste it into the file .env from your project. The MCP server reads this file on its own whenever it needs to authenticate; it never appears in the chat window or gets sent to the agent as text. Some services charge per call or have a monthly free usage limit — it's worth checking this before letting an agent run unsupervised in a loop.

Common errors at this stage

✗

Invalid or expired key: the server returns an authentication error and the tool doesn’t run. Fix: make sure you pasted the entire key into the .env, with no extra spaces, and whether it’s still active in the service dashboard.

✗

Usage limit exceeded: free plans often have a monthly call limit. Once you exceed it, the service rejects requests until the month rolls over or you upgrade. Fix: ask the agent to check how many calls are left before running tasks in bulk.

4

🧩 The three pieces together: a real request from start to finish

anatomy of an MCP server 🛠️ Toolswhat it knows how to do"search for a page""map the site""extract data" 🎛️ Parameterswhat each toolneed to knowURL, format, limitof pages... 🔑 Authenticationthe key that provesthat you have permissionstored in .env,never in chat

Caption: the three parts of any MCP server — the available tools, the parameters each one requires, and the authentication key that ensures only you (or someone you authorize) can use that service on your behalf.

When you ask "get the prices from this page," the agent: (1) chooses the right tool from the available options, (2) assembles the parameters — the URL you mentioned and the output format — and (3) the MCP server uses the stored authentication key to make the actual call to the external service. You saw only one sentence in Portuguese; behind the scenes, all three pieces worked together.

Timeline of a request, from “enter” to response

1

You write the request in plain Portuguese, without thinking about any tools.

2

The agent chooses the right tool, reading the descriptions published by the MCP server.

3

The agent puts together the parameters based on what you said — URL, format, limits.

4

The server authenticates with the key stored in the .env and calls the actual service.

5

The result comes back — or an error, if something went wrong — and the agent translates it into English for you.

🔍 Under the hood: when the service returns an error

If step 4 fails—invalid key, service down, empty result because nothing was found—the MCP server won’t freeze. It returns a structured error message, which the agent reads to decide what to do next: try again, let you know, or suggest another approach. An empty result (the search found nothing) isn’t the same as an error—it’s worth asking the agent to distinguish between the two before assuming something broke.

5

📖 Where to see a server’s list of tools

Every MCP server publishes its documentation — usually a page on the service’s website listing each tool, its expected parameters, and examples. It’s worth skimming before you install, even if you’ll never type those names yourself: it helps you understand what the agent will be able to do for you.

🔍 Inside

Inside Claude Code, run /mcp shows the MCP servers enabled in that session and each one's status — connected, authenticated, or with an error.

Copy-run: check the status of your MCP servers

Objective: see, in seconds, which MCP servers are connected in the current session and whether any need authentication.

/mcp

How to verify: the list should show each connected server with a status — “connected,” “needs auth,” or something similar. If a server you installed doesn’t appear in the list, the problem is with the installation, not the tool itself (that’s covered in module 2.3).

6

⚖️ Not every tool is safe by default

Some tools only read information (search, list)—low risk. Others write or send something externally (send an email, publish a post, delete a record)—real risk, because the action has already happened by the time the agent finishes. Claude Code asks you to confirm before running sensitive tools; think twice before disabling that confirmation.

✓

Reading tools

Searching, listing, and reading usually run without much risk or requiring extra confirmation.

✗

Writing tools

Send, delete, publish—Claude Code asks for your confirmation before executing.

A common reading tool is scraping — automatically extracting information from a web page without using that site’s official API. It’s useful, but it requires care: sites have terms of use that sometimes prohibit scraping, some block automated requests by default (and the MCP server simply returns an error or an empty page), and personal data about others that you find should never be put into a spreadsheet or automation without considering privacy. Treat scraping like visiting a physical store after business hours: just because the door isn’t locked doesn’t mean you have permission to go in whenever you want, in any volume.

reading runs directly · writing goes through a gate read / search runs directly send / delete 🔒 confirmation only runs if you approve

Caption: read tools leave no irreversible trace, so they run directly; write tools require confirmation because, once executed, they often can’t be undone.

💡 Practical Tip

If a reading tool returns an empty result, don’t assume that “it doesn’t exist”—a site may be blocking automated scraping. Ask the agent to try again or confirm whether the site returned an error before concluding the information isn’t there.

✅ Module Summary

✓
Tool: the verb the MCP server provides.
✓
Parameter: the extra information the tool needs to work.
✓
Authentication: the key that proves you have permission — always in the .env, never in chat.
✓
Confirmation: Claude Code asks for approval before running tools that write files.

Next module:

2.3 — Install and authenticate