How to Install FastMCP with pip
Install FastMCP with pip, verify the correct environment, add optional extras, upgrade safely, and fix the most common installation errors.
Use the Python interpreter for your project and run:
python -m pip install fastmcp
Then verify that the command-line tool is installed in the same environment:
fastmcp version
The version command reports FastMCP, MCP, Python, and platform information. If your project uses a virtual environment, activate it before installing. FastMCP is the standalone Python framework for building Model Context Protocol (MCP) servers and clients. It is separate from the older mcp.server.fastmcp implementation that was incorporated into the official MCP Python SDK.
Install FastMCP step by step
1. Check your Python interpreter
python --version
python -m pip --version
On systems where python maps to Python 2 or is unavailable, use python3 consistently:
python3 --version
python3 -m pip --version
Using python -m pip (or python3 -m pip) ties pip to the interpreter that will import FastMCP. A standalone pip command can point at a different environment.
2. Create and activate a virtual environment
A virtual environment keeps FastMCP and its dependencies isolated from system packages.
python -m venv .venv
Activate it on macOS or Linux:
source .venv/bin/activate
Activate it in Windows PowerShell:
.venv\Scripts\Activate.ps1
Activate it in Windows Command Prompt:
.venv\Scripts\activate.bat
After activation, confirm the interpreter path:
python -c "import sys; print(sys.executable)"
3. Install the package with pip
python -m pip install fastmcp
The FastMCP documentation documents pip installation. The FastMCP repository recommends uv for package management, but uv is not required when pip is the convention for your project.
4. Verify the installation
fastmcp version
You can also verify imports and the exact interpreter in one command:
python -c "import fastmcp, sys; print(fastmcp.__file__); print(sys.executable)"
If both commands succeed, FastMCP is installed in the environment your project is using.
Install optional FastMCP features
Install the base package for ordinary server and client work. Add an extra only when your application needs the feature it provides. For example, the documentation uses the tasks extra for background tasks:
python -m pip install "fastmcp[tasks]"
You can combine extras when a release documents more than one:
python -m pip install "fastmcp[extra-one,extra-two]"
Use the extras listed for the FastMCP release you are installing; optional names and supported features can change.
Upgrade FastMCP safely
Upgrade the package in the active environment with:
python -m pip install --upgrade fastmcp
The project also documents the shorter equivalent:
pip install fastmcp -U
Running pip through Python avoids upgrading a different interpreter by mistake. FastMCP 4 was announced stable and generally available on August 31, 2026. Existing FastMCP 3 applications may require few or no code changes, but review the project’s upgrade guidance before upgrading production systems.
Capture the current dependency state before a planned upgrade:
python -m pip show fastmcp
python -m pip freeze > requirements-before-fastmcp-upgrade.txt
After upgrading, run your MCP server and client checks, then record the resulting lockfile or requirements change.
pip versus uv
| Choice | When it fits | Command |
|---|---|---|
| pip | Your project, CI system, or team already uses Python’s standard package installer. | python -m pip install fastmcp |
| uv | You want to follow the FastMCP repository’s recommended workflow for fast environment and dependency management. | uv pip install fastmcp |
Both approaches install the standalone fastmcp package. Choose the one that matches the rest of your project and lock dependencies consistently.
Common installation errors and fixes
| Error or symptom | Cause | Fix |
|---|---|---|
pip: command not found |
pip is not on PATH or is not installed for the selected interpreter. | Run python -m pip or python3 -m pip. If pip itself is missing, repair that Python installation or virtual environment. |
fastmcp: command not found |
The console script was installed into another environment, or the environment is not activated. | Activate the intended environment, run python -m pip install fastmcp again, and check python -m pip --version. On Windows, reopen the shell if PATH was changed. |
ModuleNotFoundError: No module named 'fastmcp' |
Your application runs with a different Python interpreter than the one used by pip. | Compare python -c "import sys; print(sys.executable)" with the interpreter launching the application, then install with that interpreter. |
externally-managed-environment |
Your operating system protects its system Python from global pip changes. | Create a virtual environment and install there. Avoid forcing a global install into the managed interpreter. |
| Permission denied | You attempted to write to a system site-packages directory. | Use a virtual environment. A user install (python -m pip install --user fastmcp) is another option where supported, but its scripts directory must be on PATH. |
| Dependency resolution or SSL errors | Outdated packaging tools, an unavailable package index, proxy settings, or certificate configuration. | Upgrade packaging tools inside the environment with python -m pip install --upgrade pip setuptools wheel, then check your index, proxy, and certificate settings. |
| The wrong FastMCP package or import appears | The project is using the MCP SDK’s older embedded implementation instead of the standalone package. | Confirm python -m pip show fastmcp, inspect fastmcp.__file__, and follow the standalone project’s current documentation. |
Reproducible installation checklist
- Create or activate the project’s virtual environment.
- Run
python -m pip install fastmcpwith that environment’s interpreter. - Add an extra such as
fastmcp[tasks]only when the application needs it. - Run
fastmcp version. - Confirm the import path with
python -c "import fastmcp; print(fastmcp.__file__)". - Record dependencies in your requirements file or lockfile.
- Review upgrade notes before moving between major FastMCP versions.
Or skip the browser setup
If your MCP project needs screenshots of web pages, ScreenshotNeo provides a website screenshot API and MCP server. One request returns a PNG, JPEG, WebP, or PDF, so you do not need to install or operate Playwright or Chromium for this capture step.
cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
See the ScreenshotNeo API documentation for the available options. Cookie and consent banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server lets AI agents such as Claude and Cursor call take_screenshot, get_page_info, and capture_pdf. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Create a free ScreenshotNeo account and get 1,000 screenshots a month with no card.
Performance, reliability, and cost notes
- Install into a virtual environment to prevent dependency conflicts between projects.
- Use a lockfile or pinned requirements in CI so deployments resolve the same dependency set.
- Run verification in CI with
python -c "import fastmcp"and, where appropriate,fastmcp version. - Do not assume an optional extra is harmless: extras add dependencies and should match features your application actually uses.
- For production upgrades, test the server and client together and read the release’s migration notes.
FAQ
How do I check whether FastMCP installed?
Run fastmcp version and python -c "import fastmcp; print(fastmcp.__file__)".
Do I need fastmcp[tasks]?
Only if your application uses the background-task feature documented for that extra. The base package is sufficient for ordinary use.
Is FastMCP the same as mcp.server.fastmcp?
No. FastMCP is the standalone project; FastMCP 1.0 was incorporated into the official MCP Python SDK in 2024.
Should I use pip or uv?
Use pip when it matches your project workflow. The FastMCP repository recommends uv, while the documentation also documents pip.
How do I upgrade?
Run python -m pip install --upgrade fastmcp in the environment used by your application, then review upgrade notes and run your checks.


