Key takeaways
- Function calling is a model feature. MCP is an application protocol. They operate at different layers.
- Function calling requires developers to define tools in every API call. MCP servers define tools once and work across any compatible app.
- Most AI apps use function calling internally to interact with MCP servers. The two are complementary, not competing.
Function calling and MCP both let AI assistants use external tools. They solve different parts of the same problem: function calling handles the model-level interaction, and MCP handles the application-level connection to external services.
This guide explains what each one does, how they differ, and when to use which. For a comparison of MCP with traditional APIs, see MCP server vs API.
What is function calling?
Function calling (also called tool use) is a feature built into AI models like Claude, GPT, and Gemini. It lets the model output a structured request to call a specific function instead of generating text.
Here is how it works:
- You send the model a message along with a list of available functions and their parameters
- The model decides whether to call a function based on the conversation
- If it does, it returns a structured JSON object with the function name and arguments
- Your application code executes the function and returns the result
- The model incorporates the result into its response
The key point: function calling is a feature of the AI model's API. The model generates a structured output, but your code is responsible for actually executing the function.
What is MCP?
MCP (Model Context Protocol) is a standard protocol for connecting AI applications to external tools and data sources. An MCP server wraps a service (like GitHub, a database, or a search engine) and exposes it as a set of tools that any compatible AI app can use.
Here is how it works:
- You install an MCP server (local or remote)
- Your AI app connects to the server and discovers what tools it offers
- When you ask the AI to do something that requires that tool, it calls the MCP server
- The server executes the action and returns the result
- The AI incorporates the result into its response
The key point: MCP is a protocol that sits between the AI app and external services. It standardizes how tools are defined, discovered, and called. For more detail, read What is an MCP server?.
How do they compare?
| Function calling | MCP | |
|---|---|---|
| Layer | Model API | Application protocol |
| Who defines tools | Developer, per API call | MCP server, once |
| Discovery | Tools sent with each request | AI app discovers tools at runtime |
| Execution | Your application code | MCP server handles it |
| Portability | Tied to one app's code | Works across any MCP-compatible app |
| Setup | Code changes needed | Config file change, no code |
When should you use function calling?
Function calling is the right choice when:
- You are building a custom AI application. If you are writing code that calls Claude or another model's API directly, function calling gives you full control over what tools are available and how they are executed.
- You need tight control over execution. Function calling lets your code validate, log, and modify tool calls before executing them.
- Your tools are internal to your application. If the "tool" is just a function in your codebase (like calculating a price or querying your own database), function calling keeps everything in one place.
- You are prototyping. For quick experiments, defining a few functions inline is faster than setting up an MCP server.
When should you use MCP?
MCP is the right choice when:
- You want to add tools to an existing AI app. If you use Claude Desktop, Cursor, or VS Code and want to connect them to GitHub, a database, or Slack, MCP is how you do it. No code required.
- You want tools that work across multiple apps. One MCP server works with every compatible client. Install the GitHub MCP server once and use it in Claude Desktop, Cursor, and VS Code.
- You are connecting to third-party services. MCP servers handle authentication, rate limiting, and API specifics. You do not need to write that code yourself.
- You want tool discovery. MCP servers advertise their capabilities. The AI app discovers what tools are available at runtime without you specifying them in every request.
How do they work together?
In practice, function calling and MCP are complementary. Here is what actually happens when you use an MCP plugin in Claude Desktop:
- Claude Desktop connects to the MCP server and discovers its tools
- When you send a message, Claude Desktop sends those tools to the model using function calling
- The model decides to call a tool and returns a function call
- Claude Desktop routes that function call to the correct MCP server
- The MCP server executes the action and returns the result
- Claude Desktop sends the result back to the model
Function calling is the mechanism. MCP is the protocol that manages which tools exist and where they run. One operates at the model layer, the other at the application layer.
Which one should you learn first?
If you are an end user (adding plugins to Claude Desktop, Cursor, etc.), you only need to know MCP. Function calling happens behind the scenes. Start with How to install an MCP server.
If you are a developer building AI applications, learn both. Function calling is how you give your AI structured tool access. MCP is how you connect it to external services without building every integration yourself.
If you are building tools for others to use, build an MCP server. It will work with every compatible AI app automatically, rather than requiring each developer to implement function calling for your tool. See How to build an MCP server.
Browse available MCP servers on MCP Marketplace.