Sarghaby Araghatta
Home / Knowledge Base / MCP (Model Context Protocol)
Agents & orchestration · AI Engineering

MCP (Model Context Protocol)

A standard client-server protocol for exposing tools, resources, and prompts to LLM apps, so a capability written once is usable by any MCP-speaking client (Claude Desktop, IDEs, agents).

Client requests toolsServer responds with toolsModel calls toolsModel uses toolsMCP ClientDiscovers ToolsMCP ServerAdvertises ToolsTool Invocationby ModelStandardizedDiscovery & SchemaReusable ToolEcosystem
MCP Client-Server Interaction

How it works

An MCP server operates by advertising its tools and resources over a defined transport layer, which could be standard input/output (stdio) or HTTP. This means that the server makes its capabilities known to any client that connects to it. When an MCP client, such as an application or an IDE, starts up, it discovers these tools through a standardized process. This discovery allows the client to present the available tools to the model as callable resources, enabling the model to interact with them smooth.

Once the tools are discovered, the model can call them just like it would call any function. However, the key advantage of MCP is that it standardizes the entire process of discovery, schema definitions, and invocation across different vendors. This means that regardless of which MCP server a client connects to, the way tools are called and interacted with remains consistent. For example, if an MCP server offers a tool for data analysis, any client that implements MCP can use that tool without needing to know the specifics of how it works.

Consider a scenario where a client application needs to access a machine learning model for predictions and a separate tool for data visualization. With MCP, the client can discover both tools from the server and use them interchangeably. If the server updates or changes the tools, the client can adapt without needing to rewrite the integration logic. This flexibility is crucial in environments where tools evolve rapidly, and it allows developers to focus on building features rather than managing integrations.

  • MCP Client discovers tools from MCP Server.
  • Server advertises tools over defined transport.
  • Model invokes tools using standardized schema.
  • Use MCP for tool reuse across apps.
  • Avoid MCP for single bespoke tool integrations.

The software-engineering analogue

The closest analogy in software engineering is the Language Server Protocol (LSP). LSP allows a single language server to serve multiple code editors, providing language intelligence like autocompletion and error checking. This means that developers can use different editors without losing functionality. However, the key difference with MCP is that it brokers tools and data specifically for a large language model (LLM) host instead of providing language intelligence to an editor. In MCP, the focus is on enabling LLMs to access a variety of tools and resources, making it more about functionality than just code editing.

Why not the obvious alternative

A newcomer might think that the simplest approach is to hand-write a wrapper for each tool they want to use. While this might work for a small number of tools, the problem arises when you consider the scale: if you have N tools and M applications, you end up with N × M integrations to build and maintain. This approach quickly becomes unmanageable, as every time a tool changes, you need to update every integration. This leads to a lot of duplicated effort and potential inconsistencies across applications.

In contrast, MCP standardizes the protocol, reducing the complexity to N + M. This means any MCP client can communicate with any MCP server, regardless of the underlying tools. While you do give up some per-tool control, you gain a reusable and swappable contract that simplifies maintenance and enhances interoperability. This trade-off allows developers to focus on building new features rather than getting bogged down in integration details.

When to use which

Use MCP when you have tools that need to be reused across multiple applications or shared externally. It shines in environments where different clients may need to access the same set of tools, allowing for a consistent interface and easier updates. On the other hand, if you have a single bespoke tool that only needs to function within one application, the protocol overhead of MCP may not be justified. In such cases, a direct function definition is simpler and more efficient, as it avoids the complexities of the protocol.

Tradeoff of Control vs. Reusability MCP sacrifices some per-tool control for the benefit of a unified, reusable interface across multiple applications.

In production: when it breaks

The scenario MCP fails to connect in 20% of requests, causing timeouts.
Timeout ErrorsNetwork LatencyProtocol MismatchInspect Network LogsCheck MCP VersionIncrease Timeout SettingsUpdate Client Protocol
MCP Debugging Flow

Why it happens. This can occur due to a bottleneck in the server's ability to handle concurrent requests, particularly if the context retrieval mechanism is not optimized for high throughput. If the server is overloaded or if there are network latency issues, this can exacerbate the delays and lead to timeouts.

  • Step 1: Measure the response times of the MCP server for context retrieval requests under load.
  • Step 2: Log the server's CPU and memory usage during peak times to identify resource constraints.
  • Step 3: Check the network latency between the client and the MCP server using ping tests.
The call The fix + the tradeoff + what to monitor> To resolve this, consider optimizing the context retrieval algorithm or scaling the MCP server horizontally to handle more requests. The tradeoff may involve increased infrastructure costs. Monitor the average response time and server resource use to ensure performance remains within acceptable thresholds.

What it delivers

MCP delivers a portable and composable tool ecosystem. By writing a connector once, you can plug it into any MCP-compliant client. This means you can easily swap out implementations without needing to modify the model itself. The result is a flexible architecture that supports rapid development and integration, allowing teams to innovate without being hindered by the limitations of their tools.