Lädt...

🔧 Unified MCP Client Library


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Introduction

MCP-Use is the open-source way to connect any LLM to any MCP server and build custom agents that have tool access, without using closed source or application clients.

Imagine you're building the next generation of AI agents - assistants that don’t just answer questions, but can act, search, analyze, and retrieve real-world data.

Connecting your agent to real tools like web search, file systems, APIs is messy, and complicated.

You'd have to:

  • Launch separate MCP servers for each tool.
  • Manage server lifecycles manually.
  • Write custom logic to figure out which server should handle which task.
  • Handle failures, retries, and dynamic load balancing.
  • Make sure tools that could be dangerous (like filesystem access) are properly restricted.

What is Unified MCP Client Library?

The Unified MCP Client Library acts as a universal bridge between any LangChain supported LLM and any MCP server. It abstracts away the complexity of launching, managing, and interacting with MCP servers so that you, the developer, can focus on building smarter agents, faster.

Instead of manually coding each server interaction, the Unified MCP Client:

  • Automatically launches or connects to MCP servers
  • Understands how to route tasks to the right server
  • Handles server pooling, retries, and dynamic selection
  • Secures and restricts tool access where needed
  • Let’s your agent use multiple tools in a single, unified conversation

Use-case

Use-case: Travel Planning AI Agent

You want it to:

  • Search Airbnb for convenient homes in Barcelona for example.
  • Bright Data Google Search to find top-rated nearby restaurants and attractions.

Without MCP-Use, you’d have to:

  • Manually code APIs to Airbnb.
  • Scrape websites by leveraging 3rd party providers like Bright Data.
  • Manage headless browsers or search APIs via 3rd party providers like Bright Data.
  • Write task orchestration logic for switching between tools.

With MCP Library - It’s easy to achieve the desired functionality. Based on the specified use-case for building the travel planning agent, here are the high-level aspects which the MCP library based MCP Agent program will perform.

  • Launches the Airbnb MCP server via npx
  • Launches the Bright Data MCP server for Google Search
  • Routes each part of the user's request to the right server
  • Collects and merges the results
  • Returns a single unified response
async def main():
    # Load .env if needed
    load_dotenv()

    # Configure MCP Server
    config = {
            "mcpServers": 
            {
                "airbnb": {
                    "command": "npx",
                    "args": ["-y", "@openbnb/mcp-server-airbnb", "--ignore-robots-txt"]
                },
                "Bright Data": {
                    "command": "npx",
                    "args": ["@brightdata/mcp"],
                    "env": {
                        "API_TOKEN": os.environ["BRIGHT_DATA_KEY"]
                    }
                }
            }
    }

    client = MCPClient.from_dict(config)

    # Set up the Gemini LLM (replace model name if needed)
    llm = ChatGoogleGenerativeAI(model="gemini-2.0-flash")

    # Create MCP Agent
    agent = MCPAgent(llm=llm, client=client, max_steps=30)

    # Run a query that uses tools from multiple servers
    result = await agent.run(
        "Search for a nice place to stay in Barcelona on Airbnb, "
        "then use Google Search to find nearby restaurants and attractions."
    )
    print(result)

Image description

Source code

mcp-use

All credit goes to the original developer "Pietro Zullo" the author or mcp-use library. I just happened to extend with the Bright Data samples.

Conclusion

The future of smart agents isn't just improved models, but instead it's improved access to the world.

The Unified MCP Client Library breaks down the barriers between your LLMs and tools in the real world, making it possible for you to develop smarter, quicker, and more powerful agents without being slowed by infrastructure complexity.

Need to start several MCP servers, direct tasks dynamically, apply security rules, or seamlessly integrate tool use into a chat, the Unified MCP Client can assist you.

Content Credits - This blog-post contents were formatted with ChatGPT to make it more professional and produce a polished content for the targeted audience.

...

🔧 Unified MCP Client Library


📈 34.63 Punkte
🔧 Programmierung

🔧 🧠🥷MCP Security (choose safe MCP and check MCP safety)🛡️


📈 32.95 Punkte
🔧 Programmierung

🔧 Learning MCP the Hard Way: Building a Python Client for Algolia's MCP Server


📈 28.56 Punkte
🔧 Programmierung

🕵️ Zin MCP Client to Reverse Engineer Android APK with Local LLMs using JADX MCP Server


📈 28.56 Punkte
🕵️ Reverse Engineering

📰 How to Install Winscp FTP Client/SFTP Client/SCP Client (WinSCP Client) In Ubuntu


📈 26.37 Punkte
📰 Alle Kategorien

🕵️ GitHub - MCPPhalanx/binaryninja-mcp: MCP Server for Binary Ninja


📈 21.97 Punkte
🕵️ Reverse Engineering

🔧 ❌ A2A "vs" MCP | ✅ A2A "and" MCP - Tutorial with Demo Included!!!


📈 21.97 Punkte
🔧 Programmierung

🔧 Getting Started with Browser MCP: Automate Web Browsing with AI and MCP Protocol


📈 21.97 Punkte
🔧 Programmierung

🔧 Introduce MCP Auth - Plug-and-play auth for MCP servers


📈 21.97 Punkte
🔧 Programmierung

🔧 Self-Documenting MCP: One-Step Algolia Setup via MCP Server in Cursor IDE


📈 21.97 Punkte
🔧 Programmierung

🔧 MCP logging and tracing using mcp-trace | ContexaAI


📈 21.97 Punkte
🔧 Programmierung

🔧 A Journey from AI to LLMs and MCP - 8 - Resources in MCP — Serving Relevant Data Securely to LLMs


📈 21.97 Punkte
🔧 Programmierung

🔧 TRAA MCP Server: A Powerful Screen Capture MCP Server


📈 21.97 Punkte
🔧 Programmierung

🔧 A Journey from AI to LLMs and MCP - 9 - Tools in MCP — Giving LLMs the Power to Act


📈 21.97 Punkte
🔧 Programmierung

🔧 ⚡How to Supercharge Your Workflow with Jira MCP and Supabase MCP Using Composio🦾


📈 21.97 Punkte
🔧 Programmierung

🔧 Build local MCP server or Remote MCP


📈 21.97 Punkte
🔧 Programmierung

🔧 Future of MCP is here with Docker MCP Toolkit


📈 21.97 Punkte
🔧 Programmierung

🔧 A Beginner’s Trial of MCP Server: SafeLine MCP


📈 21.97 Punkte
🔧 Programmierung

🔧 MCP Evals - How to Test Your MCP Tools


📈 21.97 Punkte
🔧 Programmierung

🔧 Docker MCP Toolkit: Future of MCP is here


📈 21.97 Punkte
🔧 Programmierung

🔧 🧠🥷How to make cool Ninja game (Unity MCP + Blender MCP (Cline and Cursor))


📈 21.97 Punkte
🔧 Programmierung

🔧 Why MCP is more than a plug? https://designednotmagic.hashnode.dev/mcp-boyen-the-hype


📈 21.97 Punkte
🔧 Programmierung

🔧 The MCP Trap: Is the "Open Source" MCP Exploiting AI Developers?


📈 21.97 Punkte
🔧 Programmierung

🔧 Docker MCP Catalog to launch next month with 100+ verified MCP tools


📈 21.97 Punkte
🔧 Programmierung

🔧 Discover MCP Servers Effortlessly with @atonomus/mcp-servers-search 🔍


📈 21.97 Punkte
🔧 Programmierung