SU8 Codes
< Back to blog
Official article 12 min read

What Is MCP and Why Coding Agents Use It

MCP (Model Context Protocol) is an open standard for connecting AI applications to external tools and data. This guide explains the host/client/server model, the tools/resources/prompts primitives, how coding agents use MCP with databases, docs and APIs, how it differs from function calling and plugins, and what to check before connecting a server. Specification version as of November 15, 2026.

#mcp#coding-agent#tutorial
What Is MCP and Why Coding Agents Use It

What is MCP? MCP (Model Context Protocol) is an open standard for connecting AI applications to external systems. An application implements the protocol once and can talk to any MCP server that exposes the tools, data, or prompts it needs. The official docs compare it to a USB-C port for AI applications. As of November 15, 2026, the latest specification version listed in the docs is 2026-07-28.

This guide covers the problem, the roles, the primitives, coding-agent use, the difference from function calling and plugins, and what to check before connecting a server.

What Is MCP? A Short Definition

The official definition is "an open-source standard for connecting AI applications to external systems" (MCP docs). Through MCP, an AI application can connect to data sources such as files and databases, tools such as search engines, and workflows such as specialized prompts.

The USB-C analogy points at the benefit: one connector instead of many cables, one protocol instead of many custom integrations.

An arithmetic example: three AI tools and five external systems would need 3 × 5 = 15 connectors if each pair were built separately. With MCP, each side implements the protocol once and the combinations follow. This is an illustration, not a statistic.

Anthropic open-sourced MCP on November 25, 2024 (announcement). The announcement said: "Every new data source requires its own custom implementation, making truly connected systems difficult to scale." MCP's answer is "replacing fragmented integrations with a single protocol." The docs summarize the goal as "build once and integrate everywhere."

MCP is not a model or an API relay. It defines how an AI application discovers and calls external capabilities: discovery, message transport, execution, and results.

Host, Client, Server: The Three Roles

MCP uses a client-host-server architecture.

The host is the application you use, such as Claude Code, Cursor, or VS Code. It creates clients, controls permissions and lifecycle, enforces consent and security policy, and handles user authorization.

A client is a protocol component inside the host. Each client talks to exactly one server; a host can run several clients.

A server exposes capabilities. It can be local or remote, and it should have a focused responsibility.

The design principles draw a clear boundary: a server should not be able to read the whole conversation or "see into" other servers. The full conversation stays with the host, which controls cross-server interactions.

Messages use JSON-RPC. Local servers use stdio, where the client launches a subprocess and they exchange newline-delimited messages over standard input and output. Remote servers use Streamable HTTP, where each message is an HTTP POST to one MCP endpoint and replies arrive as JSON or a request-scoped SSE stream (spec). Claude Code and Cursor support these transports with their own configuration.

Tools, Resources, Prompts: The Core Primitives

Server and client are roles. Tools, resources, and prompts are the three capabilities a server can expose. The official table shows who controls each (docs):

PrimitiveWhat it isWho decidesExamples
ToolsFunctions the model can call, with defined inputs and outputsThe modelQuery a database, create an issue, edit a file
ResourcesRead-only context data with a URI and MIME typeThe applicationFile contents, database schemas, API docs
PromptsReusable instruction templatesThe user"Investigate a slow query," "summarize this release"

Tools take action. The docs say tools can write to databases, call external APIs, modify files, or trigger other logic. Each tool uses JSON Schema to validate inputs and should do one thing. The model decides when to call one, and the client may ask for approval.

Resources provide context. They expose data from files, APIs, or databases, and the application decides which to read. Resources are read-only, unlike tools.

Prompts are templates invoked by the user. They do not trigger automatically. Many clients expose them as slash commands.

The protocol methods follow the split: tools/list and tools/call; resources/list and resources/read; prompts/list and prompts/get.

A database server shows how the pieces fit. The application reads the schema as a resource; the model calls a query tool when it needs data; the user can start the task with a prompt template. This is an illustrative flow, not a specific server.

Clients support different subsets. Cursor, for example, lists tools, prompts, resources, and other capabilities (Cursor docs). Check the client's capability list before assuming a feature will work.

How Coding Agents Use MCP

Coding agents use MCP to stop working from pasted data. Claude Code's docs say to connect a server when you keep copying data into chat from an issue tracker or monitoring dashboard; once connected, the agent can read and act on that system directly (Claude Code docs).

Databases. Expose the schema as a resource and a read-only query as a tool. The official Claude Code example asks the agent to find the emails of 10 random users who used a given feature, based on a PostgreSQL database. Use a read-only account.

Issue trackers, design, monitoring. Official examples include implementing a JIRA issue and opening a GitHub pull request, checking Sentry and Statsig, updating a template from Figma, and creating Gmail drafts.

Internal APIs. Wrap the service in a remote MCP server and protect it with OAuth. The trust boundary differs: a local stdio server is a process on your machine; a remote server is usually run by someone else.

Configuration is one command or one JSON entry. Two official examples:

claude mcp add --transport http notion https://mcp.notion.com/mcp
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable -- npx -y airtable-mcp-server

These show the shape, not a full setup guide. Check the server's own docs.

The official reference servers are Everything, Fetch, Filesystem, Git, Memory, Sequential Thinking, and Time (official examples). Older tutorials may mention GitHub, Slack, Postgres, or Puppeteer; those are archived. The MCP Registry is the official directory for more (registry.modelcontextprotocol.io).

MCP vs. Function Calling and Plugins

Function calling is the model API layer. You send tool definitions with the request, the model returns a function name and arguments, and your application executes the function. OpenAI's Cookbook says: "Note that the API will not actually execute any function calls. It is up to developers to execute function calls using model outputs." (source).

MCP is the integration layer. It standardizes where definitions come from (tools/list), how messages travel (JSON-RPC), and who executes (tools/call on the server). MCP tools still end up at the model's tool-calling step; what changes is where definitions come from and who executes them.

DimensionFunction callingMCP server
Tool definitionsSupplied by the app with each requestDiscovered from the server via tools/list
Who executesThe app's own codeThe server, which returns the result
ReuseUsually tied to one appAny compatible client can use the same server
Good fitOne-off scripts, app-internal toolsMany tools, many clients, standardized access

They are not mutually exclusive. One app with a few internal tools can stay on function calling. MCP pays off when several clients need the same tools, or when you do not want to rewrite the connection logic each time.

A plugin is usually built for one host application and loaded through its extension mechanism. An MCP server is built against a protocol and can serve multiple compatible clients. That is "build once and integrate everywhere."

MCP is unnecessary for a one-off script, a single-app function, or an existing CLI command. It adds reuse, plus processes, permissions, and context cost.

Security and Permissions

MCP lets an agent act, so the question changes from what the model can say to what it can do.

Keep a human in the loop. The specification says there should always be a human who can deny tool invocations. Clients provide approval dialogs, per-tool permissions, and logs.

Treat tool descriptions as untrusted. Names and descriptions are instructions the model reads. A server can hide directives in them, including instructions about other servers' tools. This is tool poisoning, or tool shadowing when it targets another server. Definitions can also change after approval, a behavior known as a rug pull. Annotations are untrusted unless the server is trusted.

A local server is not a sandbox. The official security guide says the client and a stdio server share one trust domain and the same privileges; the protocol and SDKs do not defend one against the other. Security decisions happen before launch: what you install and how you run it. The baseline is a container with no mounts beyond what the server needs.

Read the tool list. MCP Inspector lists every tool without a model in the loop. Remove a server whose descriptions contain unrelated instructions. Prefer clients that pin definitions and re-prompt on changes. Keep the roster small: every server shares the model's context and expands the surface for the others.

Manage remote authorization. Remote servers typically use OAuth. The guide recommends least-privilege scopes, starting with low-risk discovery and read operations. Token passthrough is forbidden: a server must not accept tokens not issued for it, or forward a client's token downstream. Servers that fetch external content can expose you to prompt injection; verify trust first.

Know removing vs. revoking. Put keys in environment variables, not committed config. In Claude Code, removing a remote server deletes locally stored OAuth tokens and client registration but does not revoke them at the authorization server; run claude mcp logout <name> before removal to revoke. Project-scoped .mcp.json servers require approval in interactive sessions.

How to Decide Whether a Server Is Worth Adding

  1. Check the source. Prefer an official or actively maintained project. Look at the repository, releases, and license. The Registry and client directories are entry points, not a security audit.
  2. Minimize permissions. Read-only beats read-write. One database beats the whole instance. Request only the OAuth scopes you need. A server that asks for sudo, your home directory, or a pile of credentials deserves a pause.
  3. Understand the data boundary. A local server can see files on your machine. A remote server receives what you send it. Point it at a test database, directory, or account first.
  4. Read the tool list. Use MCP Inspector or the client's list and read every name and description. Reject descriptions that do not match the tool's job or contain hidden instructions.
  5. Watch the context cost. Tool definitions consume model context. The official docs give an example where loading every definition upfront consumed about 150,000 tokens, while on-demand discovery used about 2,000. That is an official example, not your bill, but the direction is clear: adding more servers is not automatically better.
  6. Make it reversible. Know how to remove the server and revoke its tokens. Pin versions where you can.
  7. Confirm you need it. A CLI command or an existing integration may already do the job. Ask whether you keep copying the same system's data into the chat.
  8. Start small. Use a test account, repository, container, or isolated environment before you widen access.

Three questions summarize the checklist: What permissions does it need? What data can it see? How much context is it worth? If you cannot answer one, do not connect it yet.

FAQ

What is MCP's relationship to Anthropic? Anthropic open-sourced MCP in November 2024, and it is now an open protocol. The docs list clients such as VS Code and Cursor, and servers are maintained by different organizations. Anthropic is the originator, not the only user.

How does MCP relate to a normal API? MCP is an integration protocol between AI applications and external systems. A server usually calls a normal API, a database, or the filesystem. It does not replace the API; it standardizes how an AI application discovers and calls those capabilities.

Does it have to be a remote server? No. Local stdio servers are common for files, Git, and local scripts. Remote HTTP servers fit shared team services, cloud systems, and OAuth-protected APIs.

Will MCP use a lot of context or cost a lot? Tool definitions do consume context, and more servers and tools take more. The official example shows a large gap between loading everything upfront and on-demand discovery. Actual cost depends on your model and workload, so there is no single number. Keep the roster small and remove servers you do not use.

Is MCP the same as a plugin? No. A plugin is usually tied to one host application's extension mechanism. An MCP server is protocol-based and can be used by multiple compatible clients. A plugin marketplace may offer MCP servers, but the two are different layers.

Do I need MCP for a small app? Usually not. Tools inside a single app are simpler with function calling; you do not need a separate server. Consider MCP when you connect several external systems repeatedly, or when the same tools need to serve multiple clients.

Bottom Line

MCP is a standard interface between AI applications and external systems. Its value is collapsing N custom connectors into one protocol. Its cost is trust, permissions, and context. Start with one read-only server that has a narrow scope; that is easier to reason about than installing a pile of servers at once.