
Prerequisites and environment setup
Skill packs and prompts are provided in English so they work best with the AI tools. Use them as-is.
Prerequisites and environment setup
Where you are
Module 0, lesson 2. You know what problem MCP solves (L01). Before any protocol detail, you set up a machine that can run every lab in this course with the exact versions the labs were verified with on 2026-11-26. This lesson assumes you already use a terminal, Git and a code editor; it does not teach them.
What you will be able to do
- Install the course toolchain: Python 3.12, uv, a qualifying Node.js release, npm and Git.
- Read a version range such as
^22.23.4 || ^24.22.1 || >=26.12.1and decide whether your Node release satisfies it. - Explain why every lab uses exact pins and a lock file, and why the course never runs an unpinned
npxdownload. - Run the lab-l02 checker and read its PASS, FAIL and INFO rows.
The labs and the download
Download Lab files (ZIP) from this lesson and unzip it in a working folder. It holds one folder per lab (for example lab-l02, lab-l08, lab-l09, lab-l10). Each lab has a README.md, a run.sh and a VERIFY-OUTPUT.txt with a real recorded run, so you can compare your output with the expected one.
The scripts are Bash. They were built and run on macOS (arm64). On Linux they should behave the same; on Windows, use WSL. Neither Linux nor WSL was tested by the course.
What you need, and why
| Tool | Requirement | Why |
|---|---|---|
| Python | 3.12.x | Every Python lab pins requires-python = "==3.12.*". The mcp 2.3.0 SDK itself needs Python 3.10 or later. |
| uv | a recent release (labs tested with 0.10.2) | Installs each lab's uv.lock (exact versions with sha256 hashes) into a local .venv. Nothing goes into your global Python. |
| Node.js | ^22.23.4 || ^24.22.1 || >=26.12.1 | The engines field of @modelcontextprotocol/inspector 2.16.0, the patched Inspector used in L09. |
| npm | ships with Node | Used only with package-lock.json (npm ci). |
| Git | any | To version your copy of the labs. |
| An MCP host | optional (INFO only) | Later lessons connect a server to a host, for example Claude Code. The labs' scripted checks do not need one. |
Python and uv. Install uv from its official installation page (standalone installer, Homebrew, pipx install uv and other methods are listed there). Then let uv provide Python: uv python install 3.12. You do not need to create or activate a virtual environment by hand. Each lab's run.sh runs uv sync --locked, which builds .venv inside the lab folder and fails if the lock file no longer matches pyproject.toml. That failure is a feature: you never run versions nobody tested.
Node.js. Install a qualifying release from nodejs.org or with a version manager such as nvm or fnm. Distribution packages (apt install nodejs) often lag behind and may be too old. Read the range carefully:
^22.23.4means 22.23.4 or any later 22.x. So 22.14.0 fails.^24.22.1means 24.22.1 or any later 24.x. So 24.22.0 fails.>=26.12.1means 26.12.1 or anything newer, including 27.- Node 20, 23 and 25 do not qualify.
Important: the Inspector 2.16.0 does not enforce this range itself. In the L09 lab build it also started under Node 22.14.0 and 24.22.0. Running outside the range is untested by its maintainers, so the labs check the version before they launch it. Do not lower the requirement to make an old Node work: older Inspector releases have published remote code execution advisories (L09).
Pinning and supply chain
npx some-package downloads code from the registry and runs it with your user's privileges. The official security best practices use exactly this pattern (npx malicious-package) as an example of local server compromise. The course rules:
- Every dependency has an exact version, and a lock file records hashes:
uv.lockfor Python,package-lock.jsonfor Node. - Node tools are installed locally with
npm ci --ignore-scriptsand run fromnode_modules/.bin, never fetched at launch time. - If you must use
npx, pin the exact version (npx @modelcontextprotocol/inspector@2.16.0) and check the publisher.
Version labels used in the course: current protocol is revision 2026-07-28; the SDKs pinned here are mcp 2.3.0 (Python) and @modelcontextprotocol/server 2.4.0 (TypeScript). Anything else is labelled legacy, deprecated or host-specific where it appears.
Worked example: the lab-l02 checker
lab-l02/check-env.sh is read-only. It runs --version commands, installs nothing, opens no port and makes no network call. The Node row compares your version with the Inspector range:
if [ "$MA" -eq 22 ] && ge 23 4; then ok=1; fi
if [ "$MA" -eq 24 ] && ge 22 1; then ok=1; fi
if [ "$MA" -eq 26 ] && ge 12 1; then ok=1; fi
if [ "$MA" -gt 26 ]; then ok=1; fi
./run.sh first runs a self-test of that logic against 12 fixed versions, then prints your table. The recorded run on the build machine failed on purpose, because the default Node was too old:
RESULT TOOL VERSION DETAIL
------ ---------- ---------------------- ------------------------------------------
PASS python 3.12.12 /opt/homebrew/opt/python@3.12/bin/python3.12
PASS uv 0.10.2 /opt/homebrew/bin/uv
FAIL node 22.14.0 need ^22.23.4 || ^24.22.1 || >=26.12.1 (Inspector 2.16.0)
PASS npm 10.9.2 /usr/local/bin/npm
PASS git 2.50.1 /usr/bin/git
INFO claude 2.1.332 MCP host found (optional)
ENVIRONMENT NOT READY: 1 required check(s) failed
With Node 24.22.3 first on PATH, the same check printed PASS node 24.22.3 matches ^22.23.4 || ^24.22.1 || >=26.12.1 and ENVIRONMENT OK: all required checks passed.
The claude row is INFO only. It never fails the check, because any MCP host can be used for the host-connection steps, and the labs verify servers with scripted clients instead.
Practice
- Install the tools from the table.
- In the unzipped labs, run:
cd lab-l02
./run.sh
- If a row fails, fix that tool and run
./run.sh check(table only) until it passes.
Check your result
- The self-test ends with
self-test: 12/12 cases correct. - Every required row (python, uv, node, npm, git) shows
PASS. - The last line is
ENVIRONMENT OK: all required checks passedand the exit code is 0 (echo $?prints0).
Compare your table with lab-l02/VERIFY-OUTPUT.txt. Paths and patch versions will differ; the PASS column must not.
Check your understanding
-
Your machine has Node 24.22.0. The checker says FAIL. Is it wrong, given that 24.22.0 is newer than 22.23.4? It is right.
^24.22.1only accepts 24.22.1 or later within 24.x, and the 22.x clause only covers 22.x releases. Each supported line has its own patched minimum. Upgrade to 24.22.1 or later. -
The Inspector starts fine under your Node 22.14.0. Why not keep it? Because "it starts" is not "it is supported". The Inspector does not enforce its own
enginesrange, so a start proves nothing. The range names the patched release on each Node line; outside it you run an untested combination of a tool that launches local processes. -
A teammate deletes
uv.lockbecauseuv sync --lockedfailed after they editedpyproject.toml. What did they lose? The exact, hash-checked versions the lab was verified with. The failure was the lock doing its job: it flagged that the declared dependencies no longer match the tested set. Regenerate the lock on purpose, re-run the lab's verifier, and review what changed.
Sources
- uv installation: https://docs.astral.sh/uv/getting-started/installation/
- MCP Inspector (Node requirement, secrets warning): https://github.com/modelcontextprotocol/inspector
- Python SDK (
MCPServer,uv add "mcp[cli]"): https://github.com/modelcontextprotocol/python-sdk - TypeScript SDK v2 packages: https://github.com/modelcontextprotocol/typescript-sdk
- Security best practices (local server compromise): https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/security_best_practices
- Course lab:
lab-l02/README.md,lab-l02/check-env.sh,lab-l02/VERIFY-OUTPUT.txt(run 2026-11-26)
