MCP vs Function calling: What's the difference?
If you are integrating AI into your application or learning about how to integrate it, you may have asked whether it is the same as MCP but with simpler code. These terms are new, and developers, including me, often get confused about why there are so many concepts. Today, I will explain how function calling differs from MCP in implementation, functionality, and use cases.

What does function calling do?
Function calling, or tool calling, lets an LLM request to call predefined tools. Function calling does not execute the tool itself, but the application does. A tool may be an external API, interactions with Model Context Protocol (MCP) servers, a C# method, or any executable operation. Multiple LLM providers support function calling, though implementation and API formats vary by provider.
How does function calling work?
The process of function calling involves the following steps
- You define functions and describe their purpose and parameters to the AI.
- The AI decides which function to call and returns its name and arguments.
- Your application executes the function and sends the result back to the AI.
- The AI uses the result to generate a response for the user.
What is MCP for?
MCP (Model Context Protocol) standardizes how LLMs find, use, and manage many tools across different models and providers. MCP acts as a universal layer to decouple tools from the AI. It is a standardized protocol where tools are hosted on separate MCP servers. The LLM communicates with these servers (via a host/client) to discover, request, and use tools, handling the logic externally.
How does MCP work?
The MCP flow consists of processes
- An MCP server exposes tools and resources, such as database queries or file access.
- The AI application connects to the server and discovers available tools.
- When needed, the LLM requests a tool call, and the application invokes it through the MCP server.
- The LLM receives the result and generates a response.
You can define your own MCP server or use an existing one.
Comparing function calling and MCP in practice
Let's look at the differences in approach and usage in .NET.
Function Calling Approach
The application defines the tool schema, sends it to the model, executes the requested C# method, and returns the result.
Configure the LLM client
IChatClient chatClient = new YourProviderChatClient(...);It is a provider-specific setup.
Define the tool
[Description("Search support tickets by status and priority")]
static List<Ticket> SearchTickets(
[Description("Ticket status: open, closed, or pending")] string status,
[Description("Priority: low, medium, high, or critical")] string? priority = null,
int limit = 10)
=> ticketService.Search(status, priority, limit);
// Register the function and enable invocation
var chatOptions = new ChatOptions
{
Tools = [AIFunctionFactory.Create(SearchTickets)]
};
var response = await chatClient.GetResponseAsync(
"Show me open critical tickets",
chatOptions,
cancellationToken);The ticketService is an injected instance of your application's code.
What's needed: An LLM provider/API configuration, a function definition, tool registration, and an invocation loop or middleware to execute tool calls and return results.
Each application that needs ticket-search functionality must define the tool, handle its execution, and connect to the ticket database. Ten applications adopt this functionality, meaning the same logic at ten places.
MCP Approach
An MCP server exposes functions that AI clients use by connecting to that server. Here’s an overview of how to create an MCP server in .NET.
MCP server configuration
var builder = Host.CreateApplicationBuilder(args);
builder.Services
.AddMcpServer()
.WithStdioServerTransport()
.WithToolsFromAssembly();
await builder.Build().RunAsync();Expose the tool
[McpServerToolType]
public class TicketTools(TicketService ticketService)
{
[McpServerTool]
[Description("Search support tickets by status and priority")]
public List<Ticket> SearchTickets(
string status,
string? priority = null,
int limit = 10)
=> ticketService.Search(status, priority, limit);
}MCP client configuration
var client = await McpClient.CreateAsync(
new StdioClientTransport(new StdioClientTransportOptions
{
Name = "Support Tickets",
Command = "dotnet",
Arguments = ["run", "--project", "../TicketMcpServer"]
}));
var tools = await client.ListToolsAsync();Ticket, QueryTicketDatabase, and their database implementation are your application's code. You can build an MCP server with more complex tools.
What's needed: An MCP server, tool registration, a transport configuration, and an MCP client connected to an LLM-capable application.
A single MCP server exposes the ticket-search functionality to all connected clients. Each client discovers the available tools through the server. When you add a new filter or parameter, you update only the server, and connected clients discover the updated tool definition without maintaining separate implementations.
When function calling is the right choice
Function calling is suitable when task scopes are predictable and straightforward. Listed are some use cases where function calling is the better choice
Single-model applications: If your application chats with one LLM provider and its tools are designed specifically for that application's workflow, function calling is usually the simpler choice. You don't need to run a separate server, maintain client-server connections, or manage an additional layer of infrastructure. Tool definition and implementation live directly within the application that uses them.
Strict security boundaries: When tool execution must stay within an application's existing authorization and permission system, function calling can simplify integration. For example, a financial assistant app can use the authenticated user's existing session and permissions to retrieve account information or initiate permitted transactions.
Ephemeral or dynamic tools: Some applications need tools that change depending on the current conversation context. For example, an e-commerce assistant might expose product-search tools when a customer is browsing and order-tracking or return-processing tools when they ask about an existing purchase. Function calling makes this straightforward because tool definitions are passed with each API request and can change based on the current context.
Application-specific business logic: When tools are tightly coupled to an application's internal logic, function calling keeps everything in one codebase. For example, an HR application might expose tools to calculate employee bonuses, check leave balances, and generate payroll summaries. There's little benefit in introducing a separate MCP server when only that application uses these tools.
Latency-sensitive paths: Function calling happens within a single API call. MCP adds a network hop to a separate server. For applications where every millisecond matters, the simpler architecture may be worth the portability trade-off.
When MCP is the right choice
MCP is a better choice when you need reusable tools that multiple AI applications and clients can discover and access through a standardized protocol without duplicating integrations.
Shared access across clients: When multiple applications need to use the same tools, MCP avoids implementing the same integrations repeatedly. For example, you can build a tool once and make it available to GitHub Copilot, Cursor, ChatGPT, and an automated n8n workflow through a single MCP server.
Regulatory compliance tools: Applications operating in regulated industries must ensure that AI-generated responses and actions follow applicable laws, policies, and restrictions. For example, a financial services chatbot must not recommend products to customers who don't meet certain eligibility requirements. An MCP server could expose approved compliance guidelines and eligibility-checking tools. The assistant can retrieve these requirements before generating a response.
Enterprise workflow automation: Instead of performing one isolated operation, an AI assistant coordinates multiple actions across different business applications to complete a larger task. For instance, a customer reports a damaged product. An AI-powered support assistant could retrieve the customer's order from the CRM. It could check the order details in the ERP and create a support ticket. Then, it could initiate a replacement request and update the customer with the result. Different MCP servers can expose these systems' capabilities through a common interface.
Multi-model plugging: An MCP server is like a USB-C port where any MCP client can connect regardless of which LLM powers it. Your code is not stitched to a single AI provider's format, and you can freely switch models, and your tools keep working without changes.
Domain-specific assistants: AI assistants designed for a particular industry need access to specialized information, rules, and business knowledge rather than relying only on general LLM knowledge. Like A banking assistant might need to answer questions about loan eligibility and bank-specific policies. MCP servers can expose these resources and tools so the assistant can retrieve relevant information when answering questions. Manually catching every possible query can be a nightmare.
Centralized team integrations: MCP pays off when multiple teams such as developers, executives and agents need to access tools via their respective AI applications. MCP keeps the implementation in one place, so updates are available to every connected client.
Centralized security and monitoring. In production environments, MCP servers can be placed behind a gateway responsible for authentication, rate limits, access policies, and audit logs. This makes it easier to track which agent invoked a tool, what arguments it supplied, and when the request occurred. With function calling, these controls typically need to be implemented separately within each application.
Ready-made integrations: The MCP server ecosystem has hundreds of pre-built servers covering an array of requirements. GitHub, Slack and many others provide ready-made solutions. Opting for MCP steps you into a ready-made world instead of building and maintaining every integration from scratch.
They are partners, not rivals
A worth-noting part of choosing function calling or MCP is that the choices are not mutually exclusive. We’ve seen the usability of each however, a system's requirements can overlap where you need function calling and MCP to work together. MCP is useful for tools and resources that need to be shared across multiple applications, while function calling works well for operations that are specific to a particular application's logic.
Consider an AI-powered customer support assistant. It needs several tools to handle customer requests.
1. Check order status: The assistant retrieves order details from the company's order management system. Since other applications, such as an internal support dashboard or website chatbot, might need the same functionality, exposing it through an MCP server avoids duplicating the integration.
2. Search the knowledge base: The assistant searches company documentation, troubleshooting guides, and FAQs. Since multiple AI assistants across the organization can benefit from this information, an MCP server provides a centralized integration that everyone can reuse.
3. Format customer responses: After retrieving the necessary information, the assistant converts it into a friendly, concise message that follows the company's customer support style. This is specific to this assistant's workflow, so implementing it through function calling keeps things simple. There's no real benefit in creating a separate MCP server just to format its responses.
4. Track execution steps: The application records which operations the assistant performed, how long they took, and whether they succeeded or failed. Since this functionality is specific to the application's internal monitoring and debugging, there's little reason to expose it through an MCP server.
In this architecture, MCP handles the shared integrations, while function calling handles the application-specific operations. Together, they complete the customer's request without adding unnecessary infrastructure or duplicating integrations.
Conclusion
MCP and function calling are not universal replacements for each other, they are complementary. With function calling, your application sends tool schemas to the LLM and handles execution. With MCP, a server handles both the schema and the execution, and clients discover tools at runtime. The right choice depends on your application's requirements, and in many cases, combining both is the most practical solution.
elmah.io: Error logging and Uptime Monitoring for your web apps
This blog post is brought to you by elmah.io. elmah.io is error logging, uptime monitoring, deployment tracking, and service heartbeats for your .NET and JavaScript applications. Stop relying on your users to notify you when something is wrong or dig through hundreds of megabytes of log files spread across servers. With elmah.io, we store all of your log messages, notify you through popular channels like email, Slack, and Microsoft Teams, and help you fix errors fast.
See how we can help you monitor your website for crashes Monitor your website