
This lesson is part of Learn MCP, our free course on the Model Context Protocol, within The MCP Guide.
In this lesson you will set up a machine for building MCP servers. You will install a supported Python and Node.js and create one Python and one TypeScript project with the official v2 SDKs. Then you will run the MCP Inspector without installing anything globally.
This is the first lesson of the Building module. Lessons 14 to 23 assume the setup from this page. If you skipped the earlier modules, read how MCP works first so terms like host, client and server are familiar.
All commands here come from the official SDK docs and the MCP Inspector docs, checked on 28 October 2026.
Key Takeaways
- The current SDKs are version 2:
mcp2.3.0 on PyPI and@modelcontextprotocol/server2.4.0 on npm, both built for the 2026-07-28 spec. - Python needs 3.10 or newer per PyPI, and the SDK README asks for 3.11 or newer, so use 3.11+.
- The TypeScript SDK needs Node.js 20+, but the MCP Inspector needs Node.js 22.19.0+, so install Node 22 or newer.
- Run the Inspector with
npx. It needs no global install. - Every server can speak two protocol eras: "legacy" (2025-11-25 and earlier) and "modern" (2026-07-28). Test both from day one.
Step 1: Check what you already have
Open a terminal and check your versions:
python3 --version
node --version
npm --version
Compare them with these minimums, taken from the package registries on 28 October 2026:
| Tool | Minimum | Source |
|---|---|---|
Python (for the mcp package) | 3.10 per PyPI; 3.11 per the SDK README | PyPI mcp, Python SDK README |
Node.js (for @modelcontextprotocol/server) | 20 | npm package metadata |
| Node.js (for the MCP Inspector 2.13.0) | 22.19.0 | Inspector docs |
The two Python numbers disagree. The SDK's installation page also says 3.11+, so treat 3.11 as the safe floor.
A real-world note: on a Mac whose only Python was 3.9, pip install "mcp[cli]" failed with "No matching distribution found." That message usually means your Python is too old, not that the package is missing.
Step 2: Install uv for Python projects
The official Build an MCP server tutorial uses uv, a fast Python package and project manager. It can also download a newer Python for you, which solves the version problem above.
On macOS and Linux, the tutorial's install command is:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows users get a PowerShell one-liner on the same tutorial page. Restart your terminal after installing so uv is on your PATH.
Step 3: Create the Python project
Create a project, pin a modern Python, and add the SDK with its command-line extra:
uv init bookshop --python 3.12
cd bookshop
uv add "mcp[cli]"
uv run mcp version
The last command should print MCP version 2.3.0 or newer. The [cli] extra adds the mcp command, which includes mcp dev (opens your server in the Inspector), mcp run and mcp install, per the SDK's running guide.
If you prefer plain pip, create a virtual environment with Python 3.11+ and run pip install "mcp[cli]". The SDK docs show both.
One import detail matters. In v2 the high-level server class is MCPServer, imported with from mcp.server import MCPServer. Older tutorials use FastMCP from mcp.server.fastmcp, which v2 removed. Our build guide covers that change.
Step 4: Create the TypeScript project
The TypeScript SDK's first-server guide uses these commands:
mkdir bookshop-ts && cd bookshop-ts
npm init -y
npm pkg set type=module
npm install @modelcontextprotocol/server zod tsx
mkdir src
Three details from that guide:
type=moduleis required, because the SDK ships ES modules only.tsxruns TypeScript directly, so you can skip a build step while learning.- The package name changed in v2. Use
@modelcontextprotocol/server, not@modelcontextprotocol/sdk, which is the v1 line.
If you want a compiled build instead, add TypeScript and a tsconfig.json that targets ES2022 with Node16 modules. The official tutorial shows that setup. Lesson 15 uses tsx and then compiles once.
Step 5: Run the MCP Inspector with npx
The MCP Inspector is the official test client. Version 2 ships one package with three faces: a web UI, a CLI and a terminal UI. You never need to install it globally:
npx @modelcontextprotocol/inspector # web UI
npx @modelcontextprotocol/inspector --cli # scriptable CLI
npx @modelcontextprotocol/inspector --tui # terminal UI
The CLI is the fastest way to check a setup. Point it at any command that starts a stdio server and ask for the handshake only:
npx @modelcontextprotocol/inspector --cli \
uv --directory /ABSOLUTE/PATH/TO/bookshop run server.py \
--method initialize --format json
You will write server.py in the next lesson. Until then, the command fails with a missing-file error, which still proves npx can fetch and start the Inspector.
For CI, the Inspector's smoke-testing guide says to pin an exact version, such as npx --yes @modelcontextprotocol/inspector@2.13.0. A bare npx call resolves the latest release each time.
Step 6: Learn the two protocol eras now
The 2026-07-28 spec changed how a connection starts. Old clients send an initialize handshake; new ones send server/discover. The SDKs call these the "legacy" and "modern" eras, and both v2 SDKs serve both from the same code.
The Inspector CLI picks the era with --protocol-era. Its configuration reference says the default is legacy. So a plain Inspector run tests the old handshake, not the new one.
Make a habit of running both:
npx @modelcontextprotocol/inspector --cli <your server command> --protocol-era modern --method initialize
npx @modelcontextprotocol/inspector --cli <your server command> --protocol-era legacy --method initialize
The protocolVersion field in the output tells you which one you got: 2026-07-28 or 2025-11-25. Our spec reference on MCP stdio transport explains what travels over the pipe in each case.
Step 7: Pick a host for later lessons
You will connect your server to a real AI app at the end of lesson 14. Any MCP host works. The Python SDK's host guide covers Claude Desktop, Claude Code, Cursor and VS Code. It notes that VS Code needs version 1.99 or later with GitHub Copilot in Agent mode.
You do not need a host to finish the Building module. The Inspector covers everything.
Try it
Run these four checks and save the output somewhere:
uv run mcp versioninsidebookshopprints 2.3.0 or newer.npm ls @modelcontextprotocol/serverinsidebookshop-tsprints 2.4.0 or newer.node --versionprints v22.19.0 or newer.npx @modelcontextprotocol/inspector --cli --helpprints the CLI flag list.
The commands in this lesson ran on 28 October 2026. Versions: mcp 2.3.0 on Python 3.12 (installed by uv 0.13.6), @modelcontextprotocol/server 2.4.0 on Node.js 24, and @modelcontextprotocol/inspector 2.13.0. If all four checks pass, you are ready for lesson 14.
Recap
- Use Python 3.11+ and Node.js 22.19+ to cover the SDKs and the Inspector together.
- Create Python projects with
uv initanduv add "mcp[cli]". - Create TypeScript projects with
npm pkg set type=moduleand@modelcontextprotocol/server. - Run the Inspector through
npx, and pin its version in CI. - Test both protocol eras, because the Inspector defaults to legacy.
Next step
When a server moves from a laptop to a team or a customer, the setup grows: secrets management, CI, hosting and review. If you would rather have that built for you, see eSEOspace MCP development. Otherwise, keep going with the Learn MCP course.
Course navigation
Previous lesson: Lesson 12: Remote vs Local Servers in Practice.
Next lesson: Lesson 14: Build Your First Tool in Python.
Back to the Learn MCP course outline.
Frequently asked questions
Do I need both Python and TypeScript?
No. Pick the language your team already uses. Lessons 14 and 15 build the same server in each language, and later lessons show both where they differ. The protocol is identical either way.
Can I keep using the v1 SDKs?
For existing code, yes, for a while. The TypeScript README says v1 gets bug fixes and security updates for at least six months after the 27 July 2026 v2 release. New code should start on v2, because v1 tutorials use import paths that no longer exist.
Why does the Inspector need a newer Node.js than the SDK?
They are separate packages with separate requirements. On npm, @modelcontextprotocol/server 2.4.0 declares Node.js 20+, while @modelcontextprotocol/inspector 2.13.0 declares Node.js 22.19.0+. Installing Node 22 or newer satisfies both.
Is it safe to run the Inspector?
It is the official tool, but it handles secrets. Its docs warn that it stores OAuth tokens and stdio environment values in the OS keychain, or in an unencrypted file on machines without one. Read that warning before you test against production credentials.
What is the difference between the legacy and modern eras?
Legacy covers spec versions up to 2025-11-25, which open with an initialize handshake. Modern is 2026-07-28, which uses server/discover and treats each request as self-contained. Our spec changelog covers the details.











