LangGraph + MCP in Practice: A Deep Dive into Agent Architecture and the MCP Protocol

MCP protocol unifies LLM-tool interactions, becoming the key infrastructure for deploying AI agents.
MCP (Model Context Protocol), released by Anthropic in November 2024, is built on HTTP/HTTPS and provides a unified communication standard between LLMs and tools, solving the fragmentation caused by incompatible Function Calling implementations across vendors. This article, based on a LangGraph hands-on course, explains the three core agent capabilities (tool invocation, autonomous decision-making, and plan generation) and demonstrates MCP's practical value through an ERP system integration example — including automated form filling, intelligent decision analysis, and seamless cross-system collaboration.
Introduction: Why You Need to Understand the MCP Protocol
In late November 2024, a standard protocol called MCP (Model Context Protocol) was officially introduced. Within just a few months, virtually all major LLMs worldwide announced support for it. Today, whether it's leading LLMs at home or abroad, or smaller, newly released models, MCP has become the de facto industry standard.
The MCP protocol was officially released by Anthropic in November 2024. Before that, interactions between LLMs and external tools relied primarily on each vendor's custom Function Calling mechanisms — OpenAI had its own function calling format, Google Gemini had a different specification, and none were compatible with each other. This fragmented landscape forced developers to build separate tool integrations for each model, dramatically increasing development costs. The emergence of MCP is analogous to how the USB interface unified the connection standards for various peripherals — it provides an open, vendor-neutral protocol specification for interactions between AI models and tools.
This article is based on a live course on Bilibili about LangGraph + MCP hands-on development. It systematically covers the core concepts of agents and the MCP protocol, and provides an in-depth analysis of MCP's practical value in real-world business scenarios.

What Is an Agent? Breaking Down the Three Core Capabilities
An Agent is a central concept in modern AI application development. Unlike traditional Q&A chatbots, agents possess three key capabilities:
- Tool Invocation: The ability to call various external tools and APIs on behalf of humans to perform concrete operations
- Autonomous Decision-Making: Making judgments and choices independently based on contextual information, without human intervention
- Plan Generation: The ability to decompose complex tasks, generate step-by-step execution plans, and carry them out progressively
Traditional chatbots (such as early customer service bots) essentially generate responses based on rule matching or simple intent recognition. They can only operate within predefined conversation flows and cannot perform actual operations. The core breakthrough of agents lies in the introduction of the ReAct (Reasoning + Acting) paradigm — the model can not only reason but also take actions based on its reasoning results, observe the outcomes, and then continue reasoning. This "think-act-observe" loop enables AI to handle open-ended, multi-step complex tasks rather than merely generating text responses.
These three capabilities elevate agents from "conversational assistants" to AI assistants with genuine execution power. For agents to be effective in real business scenarios, they must be able to interact efficiently with external systems — and this is precisely the core problem that the MCP protocol aims to solve.
The MCP Protocol: A Universal Language Between LLMs and Tools
Understanding MCP in One Sentence
MCP stands for Model Context Protocol. In one sentence: MCP is a standard protocol for enabling data communication and interaction between LLMs and tools.

From a technical perspective, MCP is built on top of HTTP and HTTPS. HTTP (Hypertext Transfer Protocol) is the most widely used communication protocol on the internet, defining the basic request-response format between clients and servers. MCP sits on top of HTTP/HTTPS, similar to how GraphQL is built on HTTP — it doesn't replace the underlying transport protocol but instead defines a set of semantic specifications at the application layer specifically for AI model-tool interactions. Specifically, MCP defines standard formats for tool descriptions (including tool names, parameter schemas, and return value formats), session management mechanisms, and service discovery protocols, enabling any MCP-compliant client to automatically identify and invoke any MCP-compliant server-side tool.
Why Do We Need the MCP Protocol?
Many developers ask: since we already have HTTP interfaces, why do we need a separate MCP protocol?
The core reason lies in the diversity of tool sources. In real business scenarios, the tools an agent needs to call may come from:
- Systems developed by other departments within the company (e.g., an ERP system built by the Java team)
- Services provided by third-party companies
- Remote MCP services on the public internet
- Locally deployed services
Each system may have different interface styles, authentication methods, and data formats. The core value of the MCP protocol is providing a unified standard that allows LLMs to interact with all these tools in a consistent manner. Because it's a globally universal protocol, "if you know MCP, programming in China and programming in the US is essentially the same."
MCP vs. Function Calling
Before MCP, LLMs primarily called tools through Function Calling. Function Calling is a capability built into model providers, where developers need to pass tool description information (in JSON Schema format) to the model with each API call. The limitations of this approach include: tool definitions are tightly coupled with model calls, making it impossible to independently publish and discover tools; different vendors have inconsistent Function Calling formats; and there's a lack of standard authentication, authorization, and session management mechanisms. MCP decouples tools from the model side — tools exist as independent services, supporting dynamic discovery and hot-plugging, achieving true "plug-and-play" functionality.
Practical Scenario: How MCP Transforms Traditional Business Systems
ERP System Integration as an Example
The course uses a typical Java ERP system as an example to illustrate MCP's practical application scenarios.

Imagine a company with a Java team that has developed an ERP system using a front-end/back-end separation architecture: the front end uses frameworks like Vue.js, while the back end is built in Java with various business interfaces, such as a "Create Purchase Order" endpoint.
Front-end/back-end separation is the mainstream architecture pattern in modern web development. The front end (e.g., Vue.js, React) handles UI rendering and interaction logic, while the back end (e.g., Java Spring Boot, Python FastAPI) handles business logic and data storage. The two communicate via RESTful APIs or GraphQL. The advantage of this architecture is that the front end and back end can be developed, deployed, and scaled independently. In the MCP context, the back-end service only needs to expose an additional MCP protocol endpoint, allowing AI agents to call back-end business interfaces just like a front-end page would — without modifying any existing business logic code.
In the traditional model, this interface only exposes the HTTP protocol. Now, it's possible to publish both HTTP and MCP protocols simultaneously. This way, agents can directly call the ERP system's "Create Purchase Order" interface through the MCP protocol.

Three Practical Benefits After Integration
Integrating traditional business systems with LLMs through MCP enables a variety of intelligent scenarios:
1. Automated Form Filling for Dramatically Improved Efficiency
A purchase order might have thirty to fifty fields, and filling them out manually is both time-consuming and error-prone. With an agent, users only need to describe their requirements in natural language (e.g., "Create a purchase order for 100 laptops"), and the LLM can automatically generate a complete purchase order — the efficiency gains are immediate.
2. Intelligent Decision-Making and Data Analysis
LLMs can help analyze data within ERP systems, such as:
- Detecting anomalies in business processes
- Performing financial forecasting and procurement trend analysis
- Determining whether this month's procurement data shows abnormal fluctuations
- Identifying potential vulnerabilities or error risks in the system
3. Seamless Cross-System Collaboration
When tools come from different companies or departments, the MCP protocol ensures a unified communication standard, enabling agents to seamlessly invoke services from multiple sources and completely breaking down data silos.
MCP Architecture Overview: Unified Invocation from Local to Remote
The architecture diagram presented in the course clearly shows MCP's overall working model:

The architecture is divided into three core layers:
- Agent Layer (AI Application): Acts as the MCP client, responsible for understanding user intent and deciding which tools to call
- MCP Protocol Layer: Defines the communication standards between client and server, ensuring consistency in data formats and interaction flows
- Service Layer: Includes local MCP services, internal company back-end services, and third-party MCP services on the public internet
The greatest advantage of this architecture is that regardless of where tools are deployed — locally, on an intranet, or on the public internet — agents can invoke them through the unified MCP protocol, greatly reducing the complexity of system integration.
It's worth noting that the MCP protocol supports two transport modes: stdio (standard input/output) for local inter-process communication, suitable for calling local tools; and HTTP+SSE (Server-Sent Events) for remote service calls, supporting streaming responses. These two modes cover all scenarios from local development and debugging to production deployment.
LangGraph Framework: A Powerful Tool for Building Agents
The course uses the LangGraph framework to build agents. LangGraph is a framework within the LangChain ecosystem specifically designed for building stateful, multi-step AI applications. It orchestrates agent workflows through a graph-based approach.
LangGraph was released by the LangChain team in 2024, specifically addressing state management and workflow orchestration challenges in complex AI applications. Unlike LangChain's chain-based invocation pattern, LangGraph adopts a Directed Graph abstraction — each node represents a processing step (such as calling an LLM, executing a tool, or making a conditional judgment), and edges represent transitions between steps. This graph structure naturally supports loops (such as an agent's iterative reasoning), conditional branching (such as deciding the next step based on tool return results), and parallel execution. LangGraph also includes a built-in Checkpoint mechanism, supporting interruption and resumption of long-running tasks, as well as Human-in-the-loop mode.
Key features of LangGraph include:
- Support for stateful multi-turn conversations and task execution
- Workflow definition through nodes and edges for clear logic
- Native compatibility with the MCP protocol for easy integration of external tools
- Built-in persistence and checkpoint mechanisms for complex, long-running task flows
Given LangGraph's inherent complexity, it's difficult to cover all the details in a short time. Developers who are interested are encouraged to dive deeper into its official documentation and tutorials.
Conclusion and Outlook
The emergence of the MCP protocol solves the problem of AI LLMs and external tools "speaking different languages," providing a solid infrastructure foundation for deploying agents in production. For developers, mastering the MCP protocol means not only being able to build more powerful AI applications but also seamlessly integrating AI capabilities into existing business systems.
Looking at industry trends, the MCP protocol is catalyzing an entirely new ecosystem: an increasing number of SaaS providers are beginning to offer MCP endpoints, and the open-source community is producing a wealth of ready-made MCP Server implementations (such as file system operations, database queries, browser automation, etc.). In the future, when developers build AI applications, they may only need to plug in various MCP services — much like installing npm packages — to gain rich tool capabilities.
Whether you're a Python developer, a Java programmer, or an engineer working with other tech stacks, understanding the MCP protocol and learning to use it within frameworks like LangGraph will become an indispensable core skill in the AI era.
Key Takeaways
- MCP (Model Context Protocol) is a standard protocol built on HTTP/HTTPS that enables data communication and interaction between LLMs and tools. By 2025, it has gained support from virtually all major LLMs worldwide
- Agents possess three core capabilities — tool invocation, autonomous decision-making, and plan generation — and the MCP protocol serves as the critical bridge connecting agents to external systems
- Compared to traditional Function Calling, MCP decouples tools from models, supports dynamic discovery and hot-plugging, and is a true "plug-and-play" standard
- Traditional business systems (such as Java ERP) can achieve seamless integration with LLMs by publishing both HTTP and MCP interfaces simultaneously, delivering practical value through automated form filling, intelligent decision analysis, and more
- The MCP architecture supports unified invocation of local services, intranet services, and public third-party services, covering all deployment scenarios through stdio and HTTP+SSE transport modes
- The LangGraph framework builds stateful, multi-step AI applications through directed graph orchestration, with built-in checkpoint and human-in-the-loop mechanisms, making it one of the mainstream choices for agent development today
Related articles
TutorialsCursor + Codex Dual-IDE Collaboration: A Practical Methodology for Open-Source Project Customization
A complete methodology for open-source project customization based on real-world experience, detailing the Cursor+Codex dual-IDE workflow, seven-stage process, MVP validation, and AI source code reading techniques.
TutorialsCursor Multi-Agent in Practice: Building a Full-Stack Next.js Blog in 50 Minutes
Build a full-stack blog in 50 minutes using Cursor IDE's multi-Agent mode with Next.js, Clerk auth, and Supabase. Learn the 4-phase AI Agent workflow and key integration pitfalls.
TutorialsBuilding an AI Software Factory from Scratch: A Cursor Engineer's Hands-On Experience with Multi-Agent Collaboration
Cursor engineer Eric shares practical insights on building an AI software factory: automation levels, guardrail design, parallel Agent management, and scaling to 1000+ Agents for 24/7 development.