MCP (Model Context Protocol) is Anthropic’s open standard for connecting external tools, data sources, and services to LLMs. It sits alongside — not replacing — custom function tools. Knowing when to use which saves significant development time.
What MCP Is
MCP defines a standard interface (client-server protocol) so that any LLM application can connect to any MCP-compatible tool without custom integration code. Think of it like USB — a universal connector so you don’t need a different cable for every device.
An MCP server exposes tools (functions the LLM can call), resources (data the LLM can read), and prompts (reusable templates). The LLM client discovers what’s available and calls them through the standard protocol.
The Decision Framework
Use an MCP tool when:
- A community or vendor already maintains an MCP server for the service (GitHub, Slack, databases, web search, file systems)
- The tool needs to work across multiple agents or applications — write once, use everywhere
- The integration is complex enough that maintaining it yourself would be burdensome
- You want tool access to update automatically as the underlying service changes
Build a custom function tool when:
- The logic is specific to your use case and won’t generalize
- You need tight control over inputs, outputs, and error handling
- The tool is a thin wrapper around your own internal data or logic
- You’re prototyping and want to move fast without setting up an MCP server
In the Beginner Agent Context
For first agents: use custom function tools. They’re simpler, more debuggable, and you own the code. The one-tool-one-job principle applies to both.
Migrate to MCP when:
- You find yourself writing the same integration (e.g., web search, file access) for multiple agents
- A maintained MCP server exists for what you need — why rewrite it?
- Your agent ecosystem grows to the point that consistent tooling across agents matters
The more important question: what should the interface expose?
Protocol choice is secondary to capability design. Making Your Data Ready for Agentic AI identifies naive API-to-MCP conversion as an antipattern: wrapping every REST endpoint one-to-one produces dozens of overlapping tools and forces the model to distinguish names it was never meant to reason about.
Expose a small set of parameterized business capabilities, not a mirror of the API surface. For example, prefer one check_service_status(service, location) capability over separate tools for every service and location. A capability is broader than one endpoint but narrower than a generic “manage everything” tool; its boundary is one business intent.
Each acting capability should declare more than schema and description:
- who may invoke it and on whose behalf
- accountable owner
- preconditions checked against live state at execution time
- whether its effects are cleanly reversible, reversible through compensation, or irreversible
Start with read-only Resources or equivalent retrieval interfaces. Add live-query tools next. Add write-back only after delegated identity, deterministic preconditions, audit traces and human approval for irreversible actions exist. MCP is the door; this capability model is what makes the room safe.
Practical Examples
| Need | Custom tool | MCP server |
|---|---|---|
| Your internal database | ✓ (you own it) | — |
| GitHub repo access | — | ✓ (maintained by community) |
| Calculator | ✓ (10 lines of Python) | — |
| Web search | — | ✓ (Brave, Exa MCP servers exist) |
| Your own API | ✓ | — |
| File system access | Either | ✓ (Anthropic ships one) |
In Claude Code Specifically
Claude Code uses MCP extensively — it’s how the IDE connects to external services, databases, and APIs. When you see /mcp or MCP-prefixed tools in Claude Code, these are MCP servers exposing capabilities through the standard protocol.
This is also why Claude Code can interact with tools like Figma, Atlassian, and Microsoft 365 (visible in this session’s available tools) without custom integration code — MCP servers handle the connection.
Pi 1.0: native MCP can coexist with a small harness
Pi (Coding Agent) now supports native MCP, announced in Pi 1.0. Codemode lets a model write JavaScript to compose tool calls and filter results before returning selected output; deferred loading avoids declaring every tool upfront. The published 1.0.0 documentation also describes direct and hidden exposure and mid-session server/tool changes.
This supersedes the old assertion that MCP is intrinsically incompatible with Pi’s hot reload. CLI scripts are still useful, but the choice is now between integration and exposure designs, not “Pi cannot support MCP.” The older browser token comparison below reflects eagerly exposed tool schemas in a particular historical setup; it is not a benchmark of modern deferred or Codemode MCP.
The reasoning behind the reversal, tested against Pi’s original principles, is in Pi MCP Reversal and Its Original Design. A maintained MCP server can handle service connectivity while a local script or extension implements the workflow. Prefer structured outputs for composition, expose only necessary capabilities, and retain authorization and side-effect checks. A JavaScript sandbox does not make the tools it calls harmless.
A Third Option: CLI Tools via Bash
Mario Zechner (2025) documented a pattern that sidesteps the MCP vs. function-tool question entirely: Bash/CLI scripts + a README file. For agents that already have a Bash tool (like Pi or Claude Code), this is often the most efficient choice.
Comparison for browser automation:
| Approach | Tools | Tokens |
|---|---|---|
| Playwright MCP | 21 | ~13,700 |
| Chrome DevTools MCP | 26 | ~18,000 |
| CLI scripts + README | 4 | ~225 |
The README is loaded on-demand (not at session start), output is composable via Bash pipes, and adding a new tool takes minutes. This wins when you need personal/team tools with custom requirements and fast iteration. See CLI Tools Pattern for the full framework.
See Also
- Agent Tools - Design Principles
- CLI Tools Pattern — Bash/CLI scripts as a lightweight alternative to MCP
- Self-Extending Agents — the philosophy behind building your own tools
- Building Your First AI Agent
- AI Agents - How They Work