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 of 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.