mcp-use  by mcp-use

Connect LLMs to MCP servers for custom agents

created 4 months ago
5,057 stars

Top 10.1% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

MCP-Use provides a Python library for integrating any Large Language Model (LLM) with any "MCP" (Meta-Cognitive Process) server, enabling the creation of custom agents with tool access. It targets developers looking to build sophisticated AI agents that can leverage external tools like web browsing or file operations without relying on proprietary clients.

How It Works

MCP-Use acts as a bridge between LLMs and MCP servers. It utilizes LangChain's tool-calling capabilities to allow LLMs to select and invoke functions exposed by MCP servers. The library supports direct HTTP connections and dynamic server selection, allowing agents to manage multiple MCP server instances simultaneously and intelligently choose the appropriate server for a given task.

Quick Start & Requirements

  • Install via pip: pip install mcp-use
  • Requires Python 3.11+ and LangChain with appropriate LLM provider packages (e.g., langchain-openai).
  • LLMs must support tool calling.
  • API keys for LLM providers are needed.
  • Example setup involves creating an MCPAgent with an LLM and an MCPClient configured with server details (e.g., Playwright, Airbnb, Blender MCP).
  • Documentation: https://github.com/pietrozullo/mcp-use

Highlighted Details

  • Supports LLM flexibility with any LangChain-compatible tool-calling model (OpenAI, Anthropic, Groq, Llama).
  • Enables multi-server support and dynamic server selection with an optional server manager.
  • Allows tool restriction for enhanced security and control.
  • Provides an interactive code builder for exploring MCP capabilities.

Maintenance & Community

  • The project is maintained by Pietro Zullo.
  • Contributions are welcomed via issues and pull requests.
  • A roadmap indicates completed features like multi-server support and remote connector testing.

Licensing & Compatibility

  • Licensed under the MIT License.
  • Permissive for commercial use and integration with closed-source applications.

Limitations & Caveats

The library requires LLMs specifically capable of tool/function calling. While it supports multiple servers, managing complex interactions between many servers might require careful configuration and potentially the use of the use_server_manager feature.

Health Check
Last commit

1 day ago

Responsiveness

1 day

Pull Requests (30d)
28
Issues (30d)
18
Star History
2,684 stars in the last 90 days

Explore Similar Projects

Starred by Didier Lopes Didier Lopes(Founder of OpenBB), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
2 more.

fastmcp by jlowin

2.1%
15k
Pythonic SDK for building Model Context Protocol (MCP) servers/clients
created 8 months ago
updated 1 day ago
Feedback? Help us improve.