mcpMCP Client

gllm-toolsarrow-up-right | Tutorial: Model Context Protocol

Model Context Protocol (MCP) Integration

One of the primary tools in this library is the MCP client, which connects to Model Context Protocol servers. MCP is an open standard that defines how LLMs communicate with external data sources and services. Think of MCP as a universal adapter—it standardizes the way models request and receive information from various sources, whether that's databases, APIs, file systems, or specialized tools.

The relationship is straightforward: Tools are what LLMs use to interact with the world, and MCP is the protocol that standardizes how those interactions happen.

Framework-Agnostic Design

A key advantage of this MCP client implementation is its framework-agnostic architecture. Unlike solutions tied to specific platforms, this tool provides direct connectivity to any MCP server and can be easily integrated into any agentic framework, including:

  • LangGraph - For building stateful, multi-actor applications

  • Google ADK - For Google's agent development toolkit

  • CrewAI - For orchestrating role-playing AI agents

  • AutoGen, Haystack, or any custom framework

This flexibility means you can leverage MCP's standardized server ecosystem regardless of your chosen development stack, avoiding vendor lock-in and maintaining portability across different AI architectures.

Pre-Requisites

  • Python 3.11+

  • Python package manager (pip, poetry, uv)

Setting Up

1

Installation

2

Set up the Client

3

List all Tools

4

Executing a Tool Directly

triangle-exclamation

Working with other Agentic Frameworks

Langgraph

We have provided a LangchainMCPClient that adapts MCP for specific agentic frameworks. Here is an example of implementing an Agent using Langgraph utilizing our MCP Client. The complete source code can be found herearrow-up-right.

Others

The base MCPClient is framework-agnostic and returns raw MCPTool object. To integrate with specific agentic frameworks (like Langchain, CrewAI, Google ADK, etc.), you extend the client to create framework adapters that allow other agentic frameworks to connect to MCP servers. Please refer to the Langgraph section above to see a full complete adapter.

Last updated