Unified MCP Client Library logo

Unified MCP Client Library

by mcp-use

MCP-Use is an open-source library that connects any LLM to any MCP server, enabling the creation of custom agents with tool access. It allows developers to easily integrate LLMs with tools like web browsing and file operations.

View on GitHub

Last updated: N/A

What is Unified MCP Client Library?

MCP-Use is a Python library designed to facilitate the connection between Large Language Models (LLMs) and MCP (Meta-Control Protocol) servers. It allows developers to build custom agents that can leverage various tools exposed by MCP servers, such as web browsing, file system access, and more.

How to use Unified MCP Client Library?

To use MCP-Use, install the library using pip. Configure an MCPClient with server details (either through a dictionary or a configuration file). Create an LLM instance (e.g., using LangChain). Instantiate an MCPAgent with the LLM and MCPClient. Then, use the agent.run() method to execute queries, optionally specifying the target server and disallowed tools.

Key features of Unified MCP Client Library

  • Ease of use: Requires minimal code to create MCP-capable agents.

  • LLM Flexibility: Works with any LangChain-supported LLM that supports tool calling.

  • Code Builder: Interactive tool for exploring MCP capabilities and generating starter code.

  • HTTP Support: Direct connection to MCP servers running on specific HTTP ports.

  • Dynamic Server Selection: Agents can dynamically choose the most appropriate MCP server.

  • Multi-Server Support: Use multiple MCP servers simultaneously.

  • Tool Restrictions: Restrict access to potentially dangerous tools.

  • Custom Agents: Build custom agents with the LangChain adapter.

Use cases of Unified MCP Client Library

  • Web Browsing with Playwright: Automate web interactions and data extraction.

  • Airbnb Search: Build agents to find and filter accommodations on Airbnb.

  • Blender 3D Creation: Create 3D models and scenes using Blender.

  • General Tool Integration: Connect LLMs to any tool exposed through an MCP server.

FAQ from Unified MCP Client Library

What is an MCP server?

An MCP server exposes tools and functionalities that an agent can use to perform tasks.

Which LLMs are supported?

Any LLM supported by LangChain that supports tool calling (e.g., OpenAI, Anthropic, Groq, Llama).

How do I configure MCP servers?

MCP servers can be configured using a dictionary or a JSON configuration file.

Can I restrict the tools an agent can access?

Yes, you can use the disallowed_tools parameter when creating an MCPAgent to restrict access to certain tools.

How do I enable debugging?

You can enable debugging by setting the DEBUG environment variable or using the mcp_use.set_debug() function. You can also set the verbose parameter when creating an MCPAgent.