Video summary

How to build MCP Client using LangGraph | Agentic AI using LangGraph | CampusX

Main summary

Key takeaways

Technology

Summary

CampusX instructor Nitesh (Nitish) Singh resumes the Agentic AI with LangGraph playlist with a tutorial on connecting Model Context Protocol (MCP) servers to a LangGraph chatbot. The video recaps earlier topics—including LangGraph workflows and a chatbot with streaming, chat history, observability, and tools—before explaining how MCP can make tool integrations easier to maintain.

Why use MCP?

The instructor contrasts direct tool integrations with MCP:

  • With a direct integration, the chatbot contains code to call an external API and interpret its response. If the API changes, that code may need updating.
  • As a company adds more tools and chatbots, maintaining duplicated integrations can become burdensome.
  • MCP separates tool implementation into a server. The chatbot acts as a client that connects to the server, discovers its tools, and uses them without implementing each integration itself.

The video presents MCP as a standardized way to connect tools to LLM applications and recommends a separate MCP playlist for a deeper look at its architecture and lifecycle.

Tutorial: Build an MCP client in LangGraph

The walkthrough starts with a LangGraph chatbot that uses a calculator tool, then replaces that integration with an MCP client.

  1. Convert the chatbot to asynchronous code. The MCP client library used in the tutorial is asynchronous, so the instructor updates the graph’s custom node and model invocation to use async/await. He briefly explains that asynchronous execution can allow independent operations to proceed concurrently.

  2. Connect to a local math MCP server. The server provides tools for addition, subtraction, multiplication, division, powers, and modulus. The client uses MultiServerMCPClient from langchain-mcp-adapters and the stdio transport to launch the local server. It then retrieves the available tools and binds them to the LLM. A calculation prompt confirms that the connection works.

  3. Add a remote expense-tracker server. The client configuration is extended with a second server, using its URL and streamable HTTP transport. The expense server exposes tools to add expenses, list them, and summarize spending. In the demo, the chatbot adds a ₹500 Udemy-course expense and retrieves the November expense list—all without expense-tracking logic in the client-side code.

The demonstrated installation command is:

pip install langchain-mcp-adapters

The instructor also mentions using uv.

Integrated chatbot and caveats

The instructor demonstrates combining MCP with existing direct tools, such as web search and stock-price lookup. The chatbot can use both ordinary tools and MCP-provided tools; the approaches can be mixed.

The final integration combines LangGraph, MCP clients, Streamlit, and SQLite. Because the MCP client is asynchronous while Streamlit and the original SQLite setup are primarily synchronous, the instructor describes the resulting code as a workaround rather than production-ready. The example uses an asynchronous SQLite counterpart and asynchronous streaming.

For a more suitable production architecture, he suggests exposing the backend through FastAPI and using a React or Next.js frontend.

Tutorial resources and next topic

  • The instructor refers viewers to his separate MCP playlist for a deeper guide to MCP concepts and server creation with FastMCP.
  • Links to the chatbot and MCP-client code are in the video description.
  • The next planned topic in the LangGraph playlist is adding RAG so the chatbot can answer questions about internal documents.

Main speaker/source: Nitesh (Nitish) Singh, teaching on the CampusX YouTube channel.

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video