How to Install FastMCP on Windows, macOS and Linux

Check your Python version, install the package with uv or pip, confirm it works and fix the problems people meet most often.

Terminal window showing uv add fastmcp and the fastmcp version output

Key takeaways

  • FastMCP needs Python 3.11 or later.
  • Install with uv add fastmcp or pip install fastmcp inside a virtual environment.
  • Confirm the setup with fastmcp version.
  • Pin an exact version or use a lockfile for production.

FastMCP is distributed as an ordinary Python package on PyPI, so installing it takes only a few commands. This guide walks through every step on Windows, macOS and Linux, then covers verification, optional extras, version pinning, upgrades and the problems people run into most often.

By the end you will have FastMCP installed in an isolated environment, the fastmcp command-line tool available in your terminal and a clear idea of how to keep the installation up to date.

Before You Begin

The current release of FastMCP requires Python 3.11 or later; the package classifiers list support up to Python 3.15. Open a terminal and check which version you have:

python --version
# On macOS and Linux the command is often python3
python3 --version

If the output shows 3.10 or older, install a newer interpreter before continuing. You will also need an internet connection for the first installation, as packages are downloaded from PyPI.

Windows

Download the latest installer from python.org and tick Add python.exe to PATH during setup. Windows also installs the py launcher, which lets you choose a version explicitly, for example py -3.12 --version. Use PowerShell or Windows Terminal for the commands in this guide.

macOS

macOS ships with an older system Python that you should leave alone. Install a current version from python.org or with Homebrew (brew install python@3.12), then use python3 in the Terminal app.

Linux

Most distributions offer a recent Python through their package manager. On Debian or Ubuntu, for example, sudo apt install python3 python3-venv provides both the interpreter and the venv module. If your distribution only offers an older release, uv can download a suitable interpreter for you.

Choosing Between uv and pip

Both tools install exactly the same package. The difference lies in how they manage your project.

uvpip
Recommended by the FastMCP documentationYesFully supported
Creates the virtual environmentAutomaticallyYou create it with venv
Records dependenciespyproject.toml and a lockfileManually, for example in requirements.txt
SpeedVery fastModerate
Best forNew projects and teamsExisting pip-based workflows

If you are starting from scratch, uv is the simpler path. If your organisation already standardises on pip, there is no need to change.

Create a Project Folder

Keeping each project in its own environment prevents version clashes between packages. Choose one of the two options below.

# Option A: uv creates the project and its environment
uv init my-mcp-project
cd my-mcp-project

# Option B: the built-in venv module
mkdir my-mcp-project && cd my-mcp-project
python -m venv .venv
source .venv/bin/activate      # macOS and Linux
.venv\Scripts\activate         # Windows PowerShell

When a virtual environment is active, most shells show its name in brackets at the start of the prompt. That is a quick way to confirm you are installing into the right place.

Install FastMCP with uv

Inside your project folder, add FastMCP as a dependency:

uv add fastmcp

uv resolves the dependency tree, installs everything into the project’s environment, records FastMCP in pyproject.toml and writes uv.lock. Commit both files: anyone who clones the project can recreate the identical environment with uv sync.

To run commands inside the environment without activating it, prefix them with uv run, for example uv run fastmcp version.

Install FastMCP with pip

With your virtual environment active, run:

pip install fastmcp

To make the installation reproducible, record the exact version afterwards:

pip freeze > requirements.txt

Both methods install the same package from PyPI, together with the fastmcp command-line tool.

Verify the Installation

Confirm that the package and its CLI are available:

fastmcp version

The output lists the FastMCP version, the MCP protocol library version, your Python version, the platform and the installation path. If you see these details, the installation is complete.

For a final check, create a two-line server and run it. If it starts without errors, everything is wired up correctly:

# check.py
from fastmcp import FastMCP

mcp = FastMCP("Check")
fastmcp run check.py:mcp

Press Ctrl+C to stop it.

Optional Extras

Some features depend on additional packages that are not installed by default. They are published as extras, which you request in square brackets:

pip install "fastmcp[tasks]"   # background tasks
pip install "fastmcp[apps]"    # interactive app interfaces
uv add "fastmcp[apps]"         # the same with uv

PyPI also lists extras for openai, anthropic, gemini, azure and code-mode, among others. Install only those you need; each one adds dependencies to your environment and to anything you deploy.

Pinning a Version for Production

FastMCP follows semantic versioning, but its documentation notes that breaking changes may appear in minor releases so that the framework can keep pace with the protocol. For anything other people rely on, pin the version deliberately.

# pip
pip install "fastmcp==4.2.0"

# uv
uv add "fastmcp==4.2.0"
A lockfile achieves the same goal with less effort: it records every package and sub-dependency, so CI servers and colleagues install exactly what you tested.

Upgrading an Existing Installation

pip install --upgrade fastmcp
# or, with uv
uv add fastmcp --upgrade

Most servers written for FastMCP 3 run on version 4 without changes, and the official upgrade notes list the exceptions. If you are moving from FastMCP 2, read its separate upgrade guide first. Code that uses the copy of FastMCP 1.0 bundled in the official MCP SDK (from mcp.server.fastmcp import FastMCP) usually needs only an import change.

A sensible routine is to upgrade on a branch, run your test suite, read the release notes for anything relevant and only then merge.

Uninstalling

pip uninstall fastmcp
# or, with uv
uv remove fastmcp

Deleting the project’s .venv folder removes everything that was installed into it.

Common Problems and Fixes

  • “fastmcp: command not found” – the virtual environment is probably not active. Activate it, or run the command through uv run fastmcp version.
  • “Requires-Python >=3.11” error – pip is using an older interpreter. Create the environment with a newer Python, for example py -3.12 -m venv .venv on Windows.
  • Import fails after upgrading with pip from 3.2 or earlier – run pip install --force-reinstall fastmcp. If that does not help, uninstall both fastmcp and fastmcp-slim, then install again. uv upgrades are not affected.
  • The wrong Python is picked up – run which python on macOS and Linux, or where python on Windows, to see which interpreter runs first on your path.
  • Permission errors – never install with sudo pip. Use a virtual environment instead, which needs no administrator rights.
  • Licence scanner flags docutils – older CLI dependencies pulled it in; pip install -U cyclopts rich-rst resolves this in existing environments, and fresh installs are unaffected.

Next Steps

With FastMCP installed, the natural next move is to write a small server. The guide on building your first FastMCP server picks up exactly where this one ends, and the article on tools, resources and prompts explains which component to use for each job.

Frequently Asked Questions

No. Installing into a virtual environment requires no administrator rights on Windows, macOS or Linux. Avoid sudo pip, which can damage the system Python and cause permission problems later.

You can, but it is not recommended. Separate environments stop one project's dependencies from breaking another's, and they make deployments reproducible. uv creates and manages these environments for you automatically.

Run fastmcp version. It prints the FastMCP version together with the MCP library version, your Python version and the platform, which is also useful information to include in a bug report.

No. The ZIP contains the full source repository, which is useful for reading the code or contributing. For building servers, installing from PyPI with pip or uv is simpler and keeps updates straightforward.

Keep reading

Related Guides