Installing mcp-use
Prerequisites:
- Install Node.js (version 18 or higher)
- npm, pnpm, or yarn package manager
Option 1: Create an MCP Server (for Building Servers)
The fastest way to scaffold a new MCP server project is to usecreate-mcp-use-app:
- Create a new directory with your project name
- Initialize a TypeScript project with mcp-use configured
- Set up a basic MCP server template with example tools
- Install all dependencies automatically
Check out UI Widgets with support to MCP-UI and OpenAI Apps SDK for ChatGPT.
Option 2: Install as a Library (for MCP Agents)
Install mcp_use using your preferred package manager:Setting Up Your First Project
1
Create your MCP server or install the library
Use
create-mcp-use-app for MCP servers or npm install for agents (see above).2
Configure your LLM provider
Choose and install your preferred LangChain provider.
3
Set up environment variables
Create a
.env file for your API keys:.env
4
Verify installation
Test your installation with a simple script:
Development Installation
If you want to contribute or use the latest features, install from source:Installing MCP Servers
mcp-use connects to MCP servers that provide the actual tools.Check out the Awesome MCP Servers repository for a comprehensive list of available servers.
Environment Setup
Environment Variables
Create a.env file in your project root:
.env
Verification
Verify your installation works correctly:Next Steps
Quick Start
Follow our quickstart guide to build your first agent
Configuration
Learn how to configure MCP servers
LLM Integration
Explore different LLM providers and their setup
Examples
Browse real-world examples and use cases
Troubleshooting
Import errors or module not found
Import errors or module not found
Make sure mcp_use is installed and accessible:
API key errors
API key errors
Verify your
.env file is in the correct location and your API keys are valid:MCP server not found
MCP server not found
Ensure your MCP servers are properly installed and accessible:
Tool Calling Required: Only models with tool calling capabilities can be used with mcp_use. Make sure your chosen model supports function calling or tool use.