Unified MCP Client Library
@mcp-use
关于 Unified MCP Client Library
mcp-use is the easiest way to interact with mcp servers with custom agents
概览
What is Unified MCP Client Library?
Unified MCP Client Library (mcp-use) is an open-source Python library that connects any LLM to any MCP server, enabling developers to build custom agents with tool access. It runs on any platform supporting Python and is designed for developers who want to integrate MCP tools without proprietary clients.
How to use Unified MCP Client Library?
Install the library with pip install mcp-use and the appropriate LangChain provider for your LLM (e.g., langchain-openai). Configure MCP servers via a JSON configuration file or dictionary, create an MCPClient and MCPAgent, then run queries asynchronously. See the README for a six-line starter example.
Key features of Unified MCP Client Library
- Connect any LangChain-compatible LLM with tool-calling support
- Support for multiple MCP servers in a single agent
- Dynamic server selection based on task requirements
- HTTP connection support for MCP servers
- Tool access restriction for safety
- Asynchronous streaming of agent output
- Interactive code builder for exploring MCP capabilities
- Custom agent creation via LangChain adapter or new adapters
Use cases of Unified MCP Client Library
- Web browsing and automation using Playwright MCP server
- Travel planning with Airbnb MCP server and natural language queries
- 3D scene creation in Blender via MCP tool calls
- Building custom agents that combine file operations, network access, and other MCP tools
- Real-time applications like chatbots and dashboards using streaming
FAQ from Unified MCP Client Library
Which LLMs are supported?
Any LLM from LangChain that supports function/tool calling, such as OpenAI (GPT-4o), Anthropic (Claude 3.5 Sonnet), Groq (Llama 3), and others.
How do I install the library?
Run pip install mcp-use from PyPI, or clone the repository and install from source using pip install -e ..
Does the library support streaming?
Yes. Use the astream method on MCPAgent to receive incremental results, tool actions, and intermediate steps asynchronously.
Can I restrict which tools the agent can use?
Yes. The “Tool Restrictions” feature allows you to block potentially dangerous tools like file system or network access.
What are the system requirements?
Only Python 3.x (version shown as 3.8+ likely) and an LLM provider’s API key. The library works cross-platform.
智能体框架 分类下的更多 MCP 客户端
MCPHost 🤖
mark3labsA CLI host application that enables Large Language Models (LLMs) to interact with external tools through the Model Context Protocol (MCP).
SSE-based Server and Client for
sidharthrajaramA working pattern for SSE-based MCP clients and servers
Nerve
evilsocketThe Simple Agent Development Kit.
LangChain.js MCP Adapters
langchain-ai** THIS REPO HAS MOVED TO
评论