Prerequisites:
- Install Python (version 3.11 or higher)
- pip, uv, or poetry package manager
Install mcp-use
This gives you access to everything: MCPAgent, MCPClient, and MCPServer.
LLM Providers (for Agents)
If you’re building agents, install your preferred LLM provider:
pip install langchain-openai
Tool Calling Required: Only models with tool calling capabilities can be used with mcp-use agents.
Environment Variables
Create a .env file in your project root:
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_API_KEY=AI...
GROQ_API_KEY=gsk_...
Load them in your scripts:
from dotenv import load_dotenv
load_dotenv()
Development Installation
Install from source for the latest features or to contribute:
git clone https://github.com/mcp-use/mcp-use.git
cd mcp-use/libraries/python
pip install -e .
Next Steps