Introduction
Welcome to mcp_use - The Open Source MCP Client Library
What is mcp_use?
mcp_use is an open source library that enables developers to connect any Language Learning Model (LLM) to any MCP server, allowing the creation of custom agents with tool access without relying on closed-source or application-specific clients.
Key Features
Open Source
Connect any LLM to any MCP server without vendor lock-in
Flexible Configuration
Support for any MCP server through a simple configuration system
Easy Setup
Simple JSON-based configuration for MCP server integration
Universal LLM Support
Compatible with any LangChain-supported LLM provider
HTTP Connection
Connect to MCP servers running on specific HTTP ports for web-based integrations
Dynamic Server Selection
Agents can dynamically choose the most appropriate MCP server for the task.
Getting Started
Installation
Install mcp_use and set up your environment
Configuration
Learn how to configure mcp_use with your MCP server
Streaming Agent Output
MCP-Use supports asynchronous streaming of agent output using the astream
method. This allows you to receive incremental results, tool actions, and intermediate steps as they are generated by the agent.
How to use
Call agent.astream(query)
and iterate over the results asynchronously:
Each chunk is a dictionary containing keys such as actions
, steps
, messages
, and (on the last chunk) output
. This enables real-time feedback and progress reporting in your applications.
See the README for more details and usage patterns.