All posts

MCP vs function calling: which should your AI agent use for tool integrations?

MCP vs function calling is not either/or: function calling is how a model asks for a tool, MCP is how tools are packaged and served. When each fits, and what each means for security and maintenance.

CodeKrypt 5 min read

You are building an AI agent that needs to read from a CRM, create tickets and query a database, and someone on the team asks whether to wire those up with plain function calling or stand up MCP servers. The MCP vs function calling question sounds like a fork in the road, but it is mostly a question about where your tool code lives and who else needs it.

This post is about the domain, not any particular deployment of ours. The sources are public docs and vendor write-ups, linked inline; several vendors in this space sell MCP-related products, so read their framing accordingly.

What is the difference between MCP and function calling?

They sit at different layers.

So an MCP client typically still relies on the model's function-calling ability; MCP standardises what happens around it. Treating them as rivals is the most common framing mistake.

Function calling keeps tool code inside the app; MCP moves it into a separate serverFunction callingYour app + agent loopTool code + credentialsMCPApp + agent(MCP client)MCP servertool code +credentials

When is plain function calling enough?

Descope's own guidance is that for a small prototype with a few custom functions used only by your application, an MCP server may be overkill, and that function calling is more pragmatic for lightweight integrations and MVPs. That matches how most teams should start:

Fewer moving parts also means fewer things to debug when the agent picks the wrong tool, which is already a common failure mode (see why AI agents fail in production).

When does MCP start to earn its complexity?

The reasons are organisational more than technical:

MCP vs function calling: how do they compare?

QuestionFunction callingMCP
Where does tool code run?Inside your applicationIn a separate server process
Where do credentials sit?Usually your app's environmentCan be isolated in the server
Reuse across appsCopy or share a libraryConnect another client
Upfront effortLowHigher: server, transport, auth
Best fitPrototype, single productMultiple clients or teams, shared tools
Main riskOne compromised app exposes every tool and credentialA new network surface you must authenticate and monitor

The security row deserves care. Descope warns that with function calling a compromised app can expose all credentials and every function shares the same permissions. That is true, but the flip side is real: you now operate more servers, each of which needs its own authentication.

Does MCP make tool access secure by default?

No, and some vendor posts imply otherwise. The MCP authorization specification states that authorization is optional. When it is supported, HTTP-based transports should follow the spec, which builds on OAuth 2.1; servers must validate that tokens were issued for them specifically, must not accept or pass through other tokens, and should request least-privilege scopes. Servers using the stdio transport are told to take credentials from the environment instead.

Practical consequences:

  1. Decide per tool whether it is read-only or can change state, and put approvals in front of the second kind. See human-in-the-loop approval.
  2. Scope tokens to the user and the task, not to the agent as a whole.
  3. Log every tool call with who asked, what arguments, and what came back.
  4. Treat tool output as untrusted input. A server that returns web or document content can carry injected instructions regardless of protocol; see prompt injection in AI agents.

How should you decide?

A short checklist:

If this is trueLean towards
One app, under a handful of tools, one teamFunction calling
Same tools needed by two or more clientsMCP
Tools already exposed by a vendor MCP server you trustMCP client, no custom code
Strict audit or credential isolation requirementsMCP, with real authorization work
You are unsureFunction calling, behind clean function boundaries

The last row is the important one. Write each tool as a plain function with typed inputs and outputs, no hidden reliance on agent state. Wrapping those functions in an MCP server later is then a packaging change, not a rewrite. This is the same logic as build vs buy for AI features: add the heavier option when the cost of not having it shows up, not before.

What to do next

Before choosing, write down answers to these:

  1. How many distinct tools does the agent need, and which are read-only?
  2. Will any other application or team need the same tools in the next two quarters?
  3. Where do the credentials live today, and what is the blast radius if that process is compromised?
  4. Who owns tool changes, and how are they tested? An evaluation set should cover tool selection either way.

If you are designing an agent-backed product and want the tool layer, its permissions and its approval flow planned before the first incident, that is the kind of work our AI SaaS service covers.

Sources

CodeKrypt avatar

CodeKrypt

Drafted by CodeKrypt's AI writing pipeline, built and maintained by our engineers, under fixed rules on sources and claims. How we write

Frequently asked questions

What is the difference between MCP and function calling?
Function calling is a model capability: you describe tools in the request and the model returns a structured request to call one. The Model Context Protocol is an open standard for how tools are exposed by a separate server and discovered by any compatible client. Most MCP setups still use function calling underneath.
Do I need MCP for my first AI agent?
Usually not. If you have a few functions used by one application, defining them directly with function calling is simpler. MCP starts to pay off when several applications or teams need the same tools, or when you want credentials and permissions isolated from the agent.
Is MCP more secure than function calling?
It can move the security boundary, for example by keeping credentials inside a server, but it does not secure itself. The MCP specification makes authorization optional, so you still design authentication, scopes and audit logging.
Can I start with function calling and move to MCP later?
Yes, if you keep tool logic behind clean function boundaries from the start. The tool implementations can later be wrapped in an MCP server without rewriting the agent loop.

Related reading

Chat on WhatsApp