LangChain + MCP in Practice: A Beginner's Guide to Agent Tool Integration

How LangChain, Agents, and MCP work together to solve tool-calling fragmentation across LLMs.
This article explains how LangChain serves as an AI application framework, how Agents add autonomous reasoning and tool execution on top of LLMs, and how Anthropic's MCP protocol solves the fragmentation problem of rewriting tool integrations when switching models — enabling develop-once, reuse-everywhere tool ecosystems.
In the wave of building AI applications, LangChain and MCP (Model Context Protocol) have become two keywords that developers can't avoid. Based on a beginner-friendly hands-on tutorial series from Bilibili, this article systematically covers the core concepts of both, their collaborative relationship, and how they help developers focus their energy on business logic rather than getting bogged down in the details of underlying LLM calls.
The Limitations of LLMs: Why We Need Tools and Frameworks
Large language models excel at reasoning and comprehension. Whether conversing with people or organizing a pile of unstructured files into logically coherent content, they rely on their powerful reasoning capabilities. But they have an inherent weakness — their responses are based solely on training data and cannot perceive your company's real-time business information.
The root cause of this limitation lies in how LLMs are trained. The training process for models like GPT-4, Claude, and DeepSeek takes weeks or even months, using publicly available internet data up to a certain cutoff date. This means models know nothing about events after their training cutoff and cannot access enterprise-internal systems like CRM, ERP data, or internal document repositories. This limitation is called "Knowledge Cutoff." Even RAG (Retrieval-Augmented Generation) technology requires external tools to inject real-time data into the model's context window to compensate for this deficiency.
The solution is actually quite straightforward: bind tools to the LLM. Once tools are bound, the model can not only understand your questions but also proactively invoke tools to retrieve internal business data or text content, then use its reasoning capabilities to organize the results into valuable answers.
The technical foundation for tool binding is the Function Calling mechanism. When an LLM receives a user request, it determines whether it needs to call external tools to obtain information. If so, the model generates a structured JSON-format call request containing the function name and parameters. However, it's important to note that the model itself doesn't execute the function — it only "suggests" the call. Actual execution needs to be handled by an external system (such as an Agent framework). OpenAI first introduced this mechanism in June 2023, and major model providers subsequently followed with similar implementations.

The problem is, if you hand-write all the underlying logic for LLM calls, tool management, and conversation history management from scratch, all your energy gets consumed by infrastructure rather than business logic. This is precisely why frameworks exist.
What Exactly Is LangChain?
LangChain is a framework specifically designed for developing LLM applications (AI applications). It encapsulates tedious underlying tasks like LLM calls, tool management, and conversation content management, allowing developers to focus their attention back on business logic.
LangChain was originally released by Harrison Chase in October 2022 and has since grown into a massive ecosystem. Its core components include: LangChain Core (base abstraction layer), LangChain Community (community integrations), LangGraph (for building stateful multi-step Agent workflows), and LangSmith (observability and debugging platform). The framework adopts a Chain design philosophy, linking prompt templates, model calls, and output parsing into reusable pipelines. Its greatest value lies in providing unified interface abstractions — regardless of which model API is used underneath, the upper-layer code requires almost no changes.
It's worth emphasizing that LangChain is not the only framework for building AI applications — Claude SDK, OpenAI SDK, and others can serve the same purpose. But there's one clear piece of advice: don't insist on writing your own framework from scratch. These frameworks were obviously built from the ground up, but if you insist on cobbling together your own LangChain or Claude SDK using a particular LLM API, you'll only waste time on low-level details like concurrency handling, state management, and conversation management. Standing on the shoulders of giants and leveraging existing frameworks is the more efficient approach.

From LLMs to Agents: Higher-Level Intelligent Encapsulation
Beyond simple conversation and tool calling, there's an even hotter concept — Agent (intelligent agent). An Agent also contains an LLM internally, but it adds higher-level encapsulation on top of the model.
This "higher level" manifests in several ways:
- Automatic conversation history management: Your interactions with an LLM generate extensive chat records, and an Agent can automatically manage all of this.
- Actually executing tool calls: When an LLM alone calls a tool, it "knows it should call" but doesn't actually execute. An Agent can truly operate tools and return results.
- Autonomous decision-making on whether to continue calling: An Agent can also determine, based on tool return results, whether to invoke tools again, forming a closed loop of reasoning → execution → re-reasoning.
This "reasoning → execution → re-reasoning" closed loop of Agents is academically known as the ReAct (Reasoning + Acting) paradigm, proposed by Google and Princeton University in 2022. In this paradigm, an Agent alternates between three steps: Thought, Action, and Observation. For example, when a user asks "What's the weather like in Beijing today?", the Agent first thinks about needing to call a weather API, then executes the call, observes the returned data, and finally decides whether further action is needed (such as querying clothing recommendations) or whether to directly output the final answer to the user. LangGraph is specifically designed for building such complex multi-step decision-making workflows.
In other words, building an Agent application with LangChain is essentially building an intelligent entity that can autonomously manage conversations, execute tools, and make decisions. This is also the mainstream paradigm for current AI application and intelligent agent development.
MCP Protocol: Solving the Fragmentation Problem of Tool Calls
Once you understand LangChain, the value of MCP becomes much clearer.
Switching Models Breaks Everything: The Pain of Fragmentation
In the early days of building Agents, there was a serious problem: different vendors' LLMs had completely different conventions for calling tools. Suppose Model A needs to call tools 1, 2, 3, and 4, each with its own proprietary API format; switch to Model B, and you'd have to rewrite all four tools; switch to Model C, and you'd have to do it all over again.

The consequence is — once you switch the underlying LLM, all tool-calling code must be completely rewritten. For developers, this represents massive duplicated effort and makes systems extremely fragile.
One Protocol to Unify Tool-Calling Standards
MCP (Model Context Protocol) was created precisely for this purpose. It's a standard protocol that specifies how tools should be discovered, how they should be called, and how return results should be handled.
From a technical architecture perspective, the MCP protocol defines three core roles: Host (the host application, such as an IDE or chat interface), Client (the MCP client, with one Client instance per Server), and Server (the MCP server, exposing specific tool capabilities). At the communication layer, MCP supports two transport methods: stdio (standard input/output, suitable for local inter-process communication) and HTTP+SSE (Server-Sent Events, suitable for remote service calls). The protocol is based on the JSON-RPC 2.0 specification, and a Server can expose three types of capabilities: Tools (tools that models can proactively call), Resources (read-only access to files or data), and Prompts (predefined interaction templates).
As long as you develop tools according to the MCP protocol, they'll be compatible with any upper-layer model — whether it's OpenAI, DeepSeek, Claude, or models from Amazon or Microsoft. You only need to connect and write your tools once following this standard protocol, and that code can support numerous model providers above — when switching models, you never need to rewrite tool-calling code again.
The Perfect USB Analogy
Here's a very intuitive metaphor to explain MCP's architecture: MCP is like a computer's USB port.

Various tools are like USB drives, hard drives, floppy disks, and other external devices. As long as these devices are USB-compatible, they can be recognized and used when plugged into the computer. Similarly, MCP on one end is equivalent to the LLM — no matter which LLM you switch to, as long as tools are developed according to the MCP protocol, they can all be called — it works the same regardless of the model.
MCP's Industry Status and Future Outlook
The MCP protocol was proposed by Anthropic (the company behind Claude) in November 2024. Anthropic was founded in 2021 by former OpenAI VP of Research Dario Amodei and his sister Daniela Amodei, and is renowned for AI safety research. The open-source release of the MCP protocol (Apache 2.0 license) represents an important initiative in driving AI ecosystem standardization.
It's worth noting that MCP isn't the first attempt at standardizing tool calls — OpenAI's Plugin ecosystem and AutoGPT's tool registration mechanism made similar attempts previously, but none achieved broad consensus. MCP's rapid industry acceptance stems partly from its design simplicity and universality, and partly because the timing coincided perfectly with the explosion of Agent applications in 2024, when the industry's need for a unified standard had become extremely urgent.
Since its release, virtually all major AI providers — DeepSeek, Tongyi Qianwen, Microsoft, Bailian, and others — have adopted MCP. This means tools developed according to the MCP protocol can be directly called by the vast majority of mainstream LLMs.
This rapid industry consensus has brought tremendous convenience to AI application development: tool ecosystems can be reused, model switching costs have dropped dramatically, and developers can truly focus their energy on business innovation.
Recommended Learning Path for Beginners
For readers looking to get started with AI application development, the recommended learning path is:
- Understand LangChain: Master its positioning and core capabilities as an AI application development framework
- Master Agent development: Learn about autonomous execution and decision-making mechanisms of intelligent agents
- Connect the tool ecosystem with MCP: Use the standard protocol to achieve develop-once, reuse-across-models
Combining all three is what enables you to build modern AI applications that are both flexible and maintainable.
Key Takeaways
Related articles

Claude Autonomously Designs Proteins with 35% Success Rate, Far Exceeding Human Expert Performance
Anthropic's Claude achieves 35% wet-lab success rate in autonomous protein design, far surpassing the 10-15% human expert average, signaling AI's move toward real scientific productivity.

Perplexity Discover's Multilingual Support Suddenly Disappears — Why Are International Users Upset?
Perplexity Discover's multilingual news feature suddenly dropped non-English support, frustrating international users. We analyze possible causes and the broader challenges of AI product internationalization.

GitHub Daily · August 20: Mojo Tops the Charts & The Local-First Open Source Rebellion
GitHub Trending Aug 20: Mojo tops charts for AI compute stack ambitions, OpenLogi surges 1225 stars with local-first philosophy, and privacy rebellion dominates.