Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/mcp-use/mcp-use/llms.txt

Use this file to discover all available pages before exploring further.

Package Installation

Install mcp-use for Python using your preferred package manager:
pip install mcp-use

Installing LangChain Providers

mcp-use works with various LLM providers through LangChain. You’ll need to install the appropriate LangChain provider package for your chosen LLM:
pip install langchain-openai
Only models with tool calling capabilities can be used with mcp-use. Make sure your chosen model supports function calling or tool use.
For other providers, check the LangChain chat models documentation.

Optional Dependencies

Sandbox Execution (E2B)

To use sandboxed execution for running MCP servers in isolated environments:
pip install "mcp-use[e2b]"
You’ll also need an E2B API key. Sign up at e2b.dev to get your API key.

Search Functionality

For enhanced search capabilities:
pip install "mcp-use[search]"

All Optional Dependencies

To install everything:
pip install "mcp-use[dev,anthropic,openai,e2b,search]"

Environment Setup

Create a .env file with your API keys:
.env
# LLM Provider Keys
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
GOOGLE_API_KEY=your_google_api_key

# Optional: E2B for sandboxed execution
E2B_API_KEY=your_e2b_api_key

Requirements

  • Python: 3.11 or higher
  • Operating System: Linux, macOS, or Windows
  • MCP Servers: Access to MCP server implementations (npm-based or Python-based)

Verifying Installation

Verify your installation by running:
import mcp_use
print(mcp_use.__version__)

Installing from Source

For development or to use the latest features:
git clone https://github.com/mcp-use/mcp-use.git
cd mcp-use/libraries/python
pip install -e ".[dev]"

Next Steps

Quickstart

Get started with your first MCP agent

MCP Agent

Learn about building AI agents with MCP tools

Build docs developers (and LLMs) love