AI tooling comparison

MCP vs function calling: how they differ and when to use each

The MCP vs function calling question comes up in almost every AI integration I discuss, and the honest answer is that they are not competitors. Function calling is how a model asks your code to run a tool. MCP, the Model Context Protocol, is a standard for packaging and sharing those tools so many AI applications can use them. One sits inside the other. Below I explain each one, how they fit together, and the simple rule I use to decide which to build.

Plan your AI integration

The short answer

Function calling is a model capability. MCP is a protocol.

  • With function calling, you describe functions to the model in your API request, using a name, a description and a JSON Schema for the arguments. The model returns a structured call. Your code runs it and sends the result back.
  • With MCP, a separate program called an MCP server exposes tools, resources and prompts in a standard format. Any AI host that supports MCP can discover those tools and offer them to its model.

In most hosts, MCP tools reach the model through function calling. The host reads the tool list from the MCP server, turns it into function definitions, and when the model calls one, the host forwards the call to the server. So MCP vs function calling is really a question of how your tools are packaged and shared, not how the model calls them.

How function calling works

Function calling lives inside your own application:

  1. Your app sends the user's message plus a list of function definitions.
  2. The model decides whether a function would help and returns the function name and arguments.
  3. Your code validates the arguments and runs the function.
  4. You send the result back, and the model continues its answer.

The functions are defined in your codebase and only your app can use them. That is a strength when the tool is specific to your product. In my Responses API migration guide I show this loop in full, including streaming the arguments and running several tool calls in parallel.

How MCP works

MCP moves the tools out of your app and into a server with a standard interface. The protocol defines hosts (the AI application), clients (the connector inside the host) and servers (the program that exposes capabilities). A server can offer tools the model can call, resources the host can read as context, and prompts a user can pick as templates.

Because the interface is standard, one server works across many hosts: desktop assistants, IDEs, coding agents, and your own app if it includes an MCP client. My page on what Model Context Protocol is explains the parts in more depth.

MCP vs function calling side by side

Function callingMCP
What it isA model feature in the provider's APIAn open protocol between AI hosts and servers
Where tools liveIn your application codeIn a separate MCP server
Who can use themYour app onlyAny MCP-compatible host
DiscoveryYou pass definitions on each requestHosts ask the server what it offers
Beyond toolsTools onlyTools, resources and prompts
Setup effortLow, just code in your appHigher, a server to build, run and secure
Provider lock-inDefinitions are similar across providers, but wiring is per appBuilt once, usable across models and hosts

When to use plain function calling

  • The tool is specific to one product. Looking up an order in your checkout flow doesn't need to be shared with anyone else.
  • You control the whole stack. One app, one model provider, one team. A function in your code is the simplest thing that works.
  • Latency and control matter most. Running the function in-process keeps the path short and easy to trace.
  • You are prototyping. Start with functions, and extract an MCP server later if the tool proves useful elsewhere.

When to build an MCP server

  • Many AI apps should use the same capability. Your team wants the same tool in their chat assistant, their IDE and an agent.
  • You are offering your product to AI users. An MCP server is now the expected way for a SaaS product or internal system to be usable from AI assistants.
  • Agents need access to internal systems. Wrapping a tracker, a document store or a database once, with clear permissions, beats re-implementing it in every agent.
  • You want resources and prompts too, not just callable actions.

What I use in practice

I use both, for different jobs. In product features, such as a chat assistant inside an app, I define tools as functions in the app code, because they belong to that product. For my own engineering work, built on Claude Code, MCP servers connect my agents to real systems like a task tracker, an inbox and a document store, so the same connection serves many agent sessions. My AI native engineering workflow case study shows how those pieces fit.

The design rules are the same either way. Tool names and descriptions are prompts, so write them clearly. Keep input schemas tight. Validate every argument before you act on it. Put actions that change data behind approval until you trust the output. Treat tool results as untrusted data, because they can carry prompt injection.

Getting help

If you need tools exposed to AI assistants, see my MCP server development service. If the tools belong inside one app built on OpenAI, my Responses API integration service covers function tools and connectors. Or get in touch and tell me what you are building.

Frequently asked questions

Does MCP replace function calling?

No. MCP standardises how tools are packaged, discovered and served. In most hosts, the model still uses function calling to invoke MCP tools. MCP sits on top of function calling rather than replacing it.

Is MCP better than function calling?

Neither is better in general. Function calling is simpler for tools that belong to one app. MCP is better when the same capability should work across many AI hosts, or when you are exposing a product or internal system to AI assistants.

Can I convert my existing functions into an MCP server?

Usually, yes. The name, description and JSON Schema of a function map closely to an MCP tool definition. The extra work is running the server, handling authorisation and deciding which actions need approval.

Does OpenAI support MCP?

Yes. OpenAI's Responses API can connect to remote MCP servers as tools alongside its built-in tools and your own function tools. Check OpenAI's current documentation for the exact setup and approval options.

Which is more secure, MCP or function calling?

Both are only as secure as the code behind the tools. With function calling, everything runs in your app under your control. With MCP, you also need to trust the server, limit its permissions and secure its authorisation. In both cases, validate inputs and require approval for risky actions.

Let's talk about your project

Software Architect, AI Native. Google Certified Generative AI Leader with 14+ years of experience.

Plan your AI integration