What is MCP in AI? Servers, tools and how agents connect

For agent builders4 min read

People who search what is MCP in AI want one answer: it is an open standard for connecting AI applications to tools, data and prompts, and an MCP server is the small program that offers them. Any application that speaks MCP can use the server, so the connection is written once. This post explains the parts, how it differs from function calling, and what to watch for.

What is MCP in AI? The idea in one picture

The MCP site describes the protocol as an open source standard for connecting AI applications to external systems: data sources such as local files and databases, tools such as search engines and calculators, and workflows such as specialized prompts. It compares MCP to a USB-C port. One standard connector replaces many custom ones.

Source: What is MCP? (official docs)(opens in a new tab)

Before a standard like this, every AI app needed its own integration for every service. With MCP, a service writes one server, and every client that supports the protocol can use it. The docs list assistants such as Claude and ChatGPT and development tools such as Visual Studio Code and Cursor among the supporters.

The parts

PartRole
HostThe AI application the user works in, such as a desktop assistant
ServerA program that exposes capabilities to the host
ToolsFunctions the model can call, with user approval
ResourcesFile-like data that can be read, such as API responses or file contents
PromptsPre-written templates that help with specific tasks

Source: Build an MCP server (official docs)(opens in a new tab)

The tutorial calls the application that connects to the server an MCP host, and it uses a desktop assistant as the example. The server runs separately and does the real work, such as reading a calendar or querying a database.

MCP versus plain function calling

Function calling is a feature of a model API. You describe functions in the request, the model replies with a function call item, and your own code runs the function and sends the result back. The OpenAI guide lays out those steps, and your application owns every one of them.

Source: OpenAI: function calling(opens in a new tab)

MCP sits one level up. It standardizes how tools are described, discovered and called between an application and a server, so a tool does not have to be rewritten for each app. The model still ends up making a tool call. MCP changes where the tool lives and how the app finds it.

QuestionFunction calling aloneWith MCP
Where do tool definitions live?In your app's requestIn a server the app connects to
Who runs the function?Your application codeThe server
Reuse across appsCopy the definitionsConnect to the same server

Why agent builders care

An agent gets more useful with every system it can reach, and more risky as well. A server that exposes ten well-described tools gives your agent ten new abilities without custom glue. It also gives you one place to apply limits, such as which tools exist, what they can change and what is logged.

A worked example

Say you build an expense assistant. You write one server with three tools: list_receipts, read_receipt and submit_expense. The first two only read, and the third changes data. In the host, the user asks the assistant to file last week's taxi receipts. The model picks list_receipts, reads two of the receipts, then proposes submit_expense and waits for approval, because the tutorial describes tool calls as happening with user approval.

The design choice sits in the split. Because reading and writing are separate tools, you can enable only the read tools while you test, and you can log the write tool on its own.

Risks to plan for

OWASP's 2025 list of top risks for LLM applications includes prompt injection, where input changes the model's behavior beyond what the developer intended, and excessive agency, where a system has more capacity to act than it needs. Both apply directly to tools.

Source: OWASP Top 10 for LLM Applications(opens in a new tab)

  • Give each server only the tools the task needs.
  • Prefer read-only tools until you have tested the write path.
  • Treat text returned by a tool as untrusted input, since it may contain instructions.
  • Keep user approval on for actions that change data.
  • Log every call with its arguments and result.

The MCP docs also have a page on security best practices, which is the place to start before you connect a server to anything sensitive.

How to try it

Build a one-tool server first. The companion post on writing an MCP server in Python walks through that with the official tutorial's pattern. Then connect it to a host, watch what the model does with your description, and fix the description before you add features.