Understand what MCP is
In module 2.1, Claude called a script. It works, but the agent needs to know the file name and construct the command. With MCP it’s different: the agent receives a list of ready-to-use tools, each with a name, description, and fields.
R3 combines two steps on the ladder. Reading the file is a local bridge (step 6). The way to deliver it to the agent is MCP (step 2). The result: a system without an API starts to look, to the agent, like a system with official tools.
🆕 New here? Five words from this module
- MCP (Model Context Protocol) — an open standard for connecting tools to AI agents. Claude Code and Codex speak MCP, so the same bridge works for both.
- MCP server — the program that provides the tools. Here, it runs on your machine, opened by the agent itself, with no website or cloud.
- Tool (tool) — a named action the agent can call, such as
listar_horarios_livres. - JSON — text organized in “name: value” pairs, inside braces. It’s how the agent and server exchange requests and responses.
- stdio — chat through the terminal: the agent writes to the server's input and reads its output. No network port is opened.
How to read the diagram: on the left, the person making the request; in the middle, the bridge, which knows the rules; on the right, the files. The dashed arrows to the files are read-only: the bridge never writes to them.
✗ Loose CSV file in the folder
- ✗ The agent guesses the columns with every request
- ✗ Each conversation may add things up differently
- ✗ Nothing prevents the agent from editing the file
✓ CSV behind a tool
- ✓ Name and description say what it does
- ✓ The account is always the same, written in the code
- ✓ Read-only by design
open tool pattern
runs on your machine
named action
without a network port
Meet the two tools in the ponte-modelo bridge
The model lives in runtime/pontes/mcp-modelo/server.mjs. It's an MCP server with no dependencies: you don't need to install any packages, just have Node.
It includes two example tools, one for each course character. The description of each tool is what the agent reads to decide when to use it.
| Tool | Reads | Fields (optional) | Case |
|---|---|---|---|
listar_horarios_livres | agenda.csv | data (YYYY-MM-DD) and profissional | clinic with a spreadsheet schedule |
resumo_vendas | erp-vendas.csv | agrupar_por: cliente or produto | accountant with ERP export |
What to look for in the table: the fields are optional. Without data, the first lists all available times; without agrupar_por, the second groups by client.
data,hora,profissional,status,paciente 2026-10-06,08:00,Dra. Ana,ocupado,Paciente 01 2026-10-06,09:00,Dra. Ana,livre, 2026-10-06,10:00,Dra. Ana,livre, 2026-10-06,14:00,Dr. Bruno,ocupado,Paciente 02 2026-10-06,15:00,Dr. Bruno,livre, 2026-10-07,08:00,Dra. Ana,livre, 2026-10-07,09:00,Dra. Ana,ocupado,Paciente 03 2026-10-07,16:00,Dr. Bruno,livre,
livre. Three on 06/10 and two on 07/10. You'll find these lines again in the next topics.💡 The description is half the tool
The agent doesn't read the bridge's code; it reads the description. The first one says: "Lists available appointment times from the clinic's schedule (agenda.csv). Optional filters: date (AAAA-MM-DD) and provider." A clear description helps the agent choose the right tool without you having to tell it.
Clara's calendar
Sônia's ERP
what the agent reads
only Node
Test the bridge by itself
Same rule as module 2.1: start without an agent. The server has a self-test mode, --selftest. It lists the tools, calls each one with sample data, and prints the result.
It doesn't use any quota: no AI model is involved in this test. It's just Node reading the CSVs.
In the terminal, from inside the kit folder:
node runtime/pontes/mcp-modelo/server.mjs --selftest
Real output (10/05/2026, Linux):
tools: 2 (listar_horarios_livres, resumo_vendas) 2026-10-06 09:00 · Dra. Ana 2026-10-06 10:00 · Dra. Ana 2026-10-06 15:00 · Dr. Bruno TOTAL: R$ 856.00
tools: 2, the three available times on 06/10 and TOTAL: R$ 856.00. That's the proof for R3.The three times match the lines livre from 10/06 that you saw in the previous section. The total for Sônia still needs to be checked. The self-test shows only the last line of the summary; the table below recalculates it manually, row by row from the erp-vendas.csv.
| Client | CSV lines | Total |
|---|---|---|
| Mercado Sol | 10 × 18,50 + 40 × 5,20 = 185 + 208 | R$ 393,00 |
| Padaria Lua | 25 × 5,20 + 12 × 18,50 = 130 + 222 | R$ 352,00 |
| Empório Mar | 6 × 18,50 | R$ 111,00 |
| TOTAL | 393 + 352 + 111 | R$ 856,00 |
What to look for in the table: the hand calculation reaches the same TOTAL: R$ 856.00 from the bridge (the period instead of a comma is just the program's format).
💡 Check it by hand once
The first time a bridge handles money, recalculate the amount on a calculator. After that, the self-test becomes your alarm: if the total changes without the CSV changing, something broke.
the proof of R3
the two tools
manually checked
no model in the test
Connect the bridge to Claude Code
In the kit, this part is already set up. Two files handle it: the .mcp.json, at the root, records the bridge; the .claude/settings.json allows its use.
When you open claude in the folder, it reads the .mcp.json and starts the server on its own. You don't need to leave anything running.
📄 .mcp.json (registers)
{
"mcpServers": {
"ponte-modelo": {
"command": "node",
"args": ["runtime/pontes/mcp-modelo/server.mjs"]
}
}
}
📄 .claude/settings.json (enables, excerpt)
"enabledMcpjsonServers": [ "ponte-modelo" ]
Without this line, Claude Code asks before starting a server that came with the project.
In the terminal, from inside the kit folder:
claude mcp list
Real output (10/05/2026, Linux), the bridge line:
ponte-modelo: node runtime/pontes/mcp-modelo/server.mjs - ✔ Connected
ponte-modelo ends in ✔ Connected. If you see Pending approval, open claude in the folder once and approve.Register
.mcp.json says the bridge’s name and the command that connects it.
Allow
enabledMcpjsonServers approves this project's bridge, or you approve it the first time it opens.
Check
claude mcp list shows ✔ Connected. Only then ask the agent to do something.
🆕 New here? In a project other than the kit
Outside the kit folder, there is no .mcp.json ready. The server.mjs includes, in a comment at the top, the command that registers the bridge: claude mcp add ponte-modelo -- node runtime/pontes/mcp-modelo/server.mjs. Everything after -- it’s the command that starts the server.
Use the tool through the agent
Now the agent comes in. The command below uses claude -p: sends a single request without opening the screen and prints the response. It asks for the available times on 07/10, a day different from the self-test.
Changing the day is intentional. If the agent gives the right answer for a day you haven’t tested, that’s a sign it called the tool instead of repeating something it had already seen.
In the terminal, from inside the kit folder:
claude -p "Use a tool listar_horarios_livres da ponte-modelo e diga os horários livres de 2026-10-07."
Result confirmed in CHANGELOG 0.2.0:
The answer includes 08:00 (Dr. Ana) e 16:00 (Dr. Bruno), exactly the lines livre from 10/07 in the CSV. The surrounding text changes from one run to the next; the two timestamps don’t.
agenda.csv from topic 2 and check the two lines from 2026-10-07 with livre.How to read the diagram: the glowing box is the only point where the AI makes a decision: which tool to call and with what date. The filter in step 3 is code, not a guess.
Sônia does the same with the other tool. With claude open in the kit folder, it prompts: "Use the resumo_vendas tool from ponte-modelo to group by customer and tell me who bought the most." The answer has to match the table in topic 3: Mercado Sol is in the lead, with R$ 393,00.
⚠️ The bridge only reads, and it should stay that way
The two tools are read-only (N4). If one day you create one that marks an appointment or writes to the ERP, it moves up to "modify" in the POLITICA.md: N2, asks every time first. A tool that writes is never set to "always allow".
request without a screen
day outside the self-test
N4
move up to N2
Connect the same bridge to Codex
Codex doesn't read the .mcp.json. It has its own log, created by a command. The bridge is the same: no line from the server.mjs changes.
Take a look at "$PWD/…": the recipe registers the server's full path in Codex, starting from the root of the disk, not the short path that the .mcp.json uses. That way, the record doesn’t depend on where Codex was opened.
In the terminal, from inside the kit folder:
codex mcp add ponte-modelo -- node "$PWD/runtime/pontes/mcp-modelo/server.mjs"
Expected result (according to the instructions):
R3 doesn’t provide its own proof for this step. The test is to ask Codex for the same thing you asked Claude.
codex in the kit folder and ask: "Use the listar_horarios_livres tool from ponte-modelo and tell me the available times on 2026-10-07." It should return 08:00 (Dr. Ana) and 16:00 (Dr. Bruno).| Claude Code | Codex | |
|---|---|---|
| Where it records | .mcp.json from the project (already included in the kit) | command codex mcp add |
| Server workflow | relative to the kit folder | complete, with "$PWD/…" |
| How to check | claude mcp list → ✔ Connected | ask for the times for 07/10 |
| Bridge used | the same: runtime/pontes/mcp-modelo/server.mjs | |
What to look for in the table: only the way you register it changes. That’s why MCP is worthwhile: you write the bridge once, and any agent that speaks MCP can use it.
💡 And your own system?
The sample bridge reads the example CSVs. To read your system’s export, the kit provides the variable PONTE_DADOS=/caminho/da/exportacao, in the field env of the .mcp.json. That's the subject of module 2.3, with the columns switched and the log in CAPACIDADES.md.
Quick test (optional): the claude mcp list shows ponte-modelo … ✔ Connected. What does this prove?
two agents
Codex log
complete path
your system, in 2.3
🎓 Module summary
Next module:
2.3 — Your system’s bridge