Lab 01 — Tour the filesystem MCP server
Lesson 01 · ~20 min · Claude Desktop or MCP Inspector
By the end of this lab you will be able to:
- Connect Claude Desktop (or the
mcp inspector) to a working MCP server. - Call one of the server's tools from a real client.
- Re-run that tool through Inspector and inspect the raw JSON-RPC traffic.
What you need
- Python 3.10+ — for the course virtualenv and the
mcpCLI. - Node.js 18+ — required for
npx, which we use to run the reference MCP servers. - One of:
- Claude Desktop (preferred — it's the most natural MCP client and you'll see the tool calls inline in chat), or
- MCP Inspector (
@modelcontextprotocol/inspector) — a small web UI that shows the raw JSON-RPC traffic. Great if you don't have Claude Desktop installed.
Step 1 — Install dependencies
From the repo root:
cd mcp-servers
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
Sanity check — this should print a version, not "command not found":
mcp --version
Step 2 — Set up a sandbox
The filesystem MCP server is sandbox-scoped — it can only see paths you explicitly hand it. Give it a tiny directory with one file in it:
mkdir -p /tmp/mcp-demo
echo "Hello from MCP lesson 01" > /tmp/mcp-demo/hello.txt
This is the only directory the server will be allowed to touch for the rest of the lab.
Step 3 — Connect Claude Desktop to the filesystem server
Claude Desktop reads its MCP configuration from a JSON file on disk. Edit the file for your OS:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json
If the file doesn't exist yet, create it. Add (or merge into) the following:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp/mcp-demo"]
}
}
}
Save the file, then fully quit and restart Claude Desktop (a window reload is not enough — the server is spawned at app launch).
Once it's back up, open the tools panel — you should see filesystem listed with a handful of tools underneath it (list_directory, read_file, write_file, ...).
Step 4 — Use a filesystem tool from inside Claude Desktop
Ask Claude, in plain English:
List the files in /tmp/mcp-demo.
Watch the chat carefully. You should see, in order:
- A tool call block — Claude deciding to invoke
list_directorywithpath="/tmp/mcp-demo". - A tool result block — the server's response listing
hello.txt. - Claude's natural-language summary of what it found.
That round-trip — model → tool call → server → tool result → model — is the whole MCP protocol from the user's point of view.
Step 5 — Alternative: use the MCP Inspector
If you don't have Claude Desktop, or if you just want to see the raw protocol, run Inspector. It launches the server and gives you a web UI to talk to it:
npx @modelcontextprotocol/inspector \
npx -y @modelcontextprotocol/server-filesystem /tmp/mcp-demo
Inspector prints a URL on stdout (typically http://localhost:6274). Open it. You'll see three panes:
- Tool list — every tool the server advertises.
- Call form — auto-generated from each tool's input schema; fill in arguments and hit Call.
- JSON-RPC transcript — every request and response on the wire, including the
initializehandshake.
Step 6 — Call list_directory through Inspector
In the tool list, pick list_directory. In the call form, set path to /tmp/mcp-demo and click Call.
Now look at both the rendered output above the form and the JSON-RPC transcript on the right. You should see a tools/call request go out and a response come back containing your hello.txt entry. That's the exact same exchange Claude Desktop was doing in Step 4 — just made visible.
Step 7 — What you should see at the end
You're done when you can produce, side-by-side:
- A screenshot of Claude Desktop calling a filesystem tool inline in a conversation, and
- A screenshot of the Inspector transcript showing a
tools/callrequest and its response.
If you have both, you've seen MCP from both sides — the polished client experience and the raw protocol underneath.
Troubleshooting
- "Claude Desktop doesn't see the server" — use absolute paths in
args, fully restart Claude Desktop (not just reload), and validate the JSON config withjq . claude_desktop_config.jsonto catch syntax errors. - "Inspector port already in use" — a previous run left an
npxprocess hanging. Find and kill it:pgrep -fl modelcontextprotocol, thenkill <pid>. - "Filesystem server refuses path" — by design. Only paths passed in
argsare reachable; the server is sandbox-scoped on purpose. Add another root directory toargsif you need broader access.
Self-check
- ✓ You've installed the
mcpCLI and verified it withmcp --version. - ✓ You connected Claude Desktop (or Inspector) to the filesystem MCP server.
- ✓ You triggered a tool call and saw both the result and the model's summary.
- ✓ You opened Inspector and watched a
tools/callrequest/response on the wire.