Chapter 16 · CLI
MCP: connecting servers, auth and scopes
MCP is the protocol connecting Claude Code to external tools and data: databases, cloud services and internal systems. A correct connection includes authentication, scope definition and control over what is exposed.
Video
Steps
- Start with a known, documented MCP server: read what it exposes (tools, resources, prompts) before connecting.
- Configure authentication per server type: key, OAuth or organizational credentials, and never store secrets in plain config files.
- Limit scopes to the minimum needed: read access when read suffices, not blanket write.
- After connecting, verify the new tools appear and work, and use tool search when many tools are available.
Mechanism animation (illustration)
Common pitfall: An MCP server is code that acts on your behalf against real systems; an overly broad connection is like handing over the keys.
Hands-on exercise: Connect a simple MCP server (filesystem or an official example, for instance), check which tools were added and run one safe read.
Filmed demo · Video is added in the media phase
Recap
Comprehension check
What is the principle when connecting a new MCP server?
Recap
- MCP connects external tools and data
- Minimal scopes, secrets out of plain files
- Verify new tools after connecting