harness · intermediate · 45 min

Build a tool server any assistant can use

Publish your tools over the Model Context Protocol so any assistant that speaks it can call them.

HANDS-ON LAB · YOU RUN IT ON YOUR MACHINE · 4 STEPS
  1. Step 1 of 4

    Write a server with two tools: lookup_parcel and list_claims

    The server runs as a child process and talks over standard input and output. Nothing listens on the network yet.

    Run this to check

    npx @modelcontextprotocol/inspector uv run --with mcp server.py

    You pass when

    The inspector opens and lists both tools with a description and typed arguments.

    Files you write

    • server.py
  2. Step 2 of 4

    Call lookup_parcel with an id that does not exist

    Run this to check

    npx @modelcontextprotocol/inspector uv run --with mcp server.py

    You pass when

    The tool returns a plain sentence saying the parcel was not found. No stack trace reaches the caller.

    Files you write

    • server.py
  3. Step 3 of 4

    Add the server to your coding agent and ask about a parcel

    Run this to check

    claude mcp add parcel -- uv run --with mcp server.py && claude mcp list

    You pass when

    The server is listed as connected, and the agent answers a parcel question by calling your tool. Other agents have their own add command.

  4. Step 4 of 4

    Serve the same tools over HTTP so a remote assistant can reach them

    Local process for tools on your machine, HTTP for tools shared by a team. Flisk scaffolds the second kind with flisk resource --type mcp.

    Run this to check

    npx @modelcontextprotocol/inspector

    You pass when

    With the server started in HTTP mode, the inspector connects by URL and shows the same two tools.

    Files you write

    • server.py
No transcript here on purpose. This page does not show terminal output, because model answers differ from run to run. Each step says what a pass looks like; your own terminal is the proof.