All posts
MCP Published 7 min

Why every team's first MCP server should be "list-files"

Smallest useful server. Hardest one to mess up. Teaches the protocol without distracting domain logic. The 60-line server we hand to teams during training.

Jigar JoshiJigar JoshiAgentic AI Architect and Consultant
In this post (5 sections)

When teams start their first MCP server, the temptation is to start with a real business problem. That is the trap. The first server should teach the protocol without burying it under domain logic. List-files is that server, and it is the one we hand teams during training before they touch anything domain-specific.

Why list-files

  • Trivially testable. You already know what files exist, so a wrong answer is obvious without a test harness.
  • No external dependencies, no secrets, no auth surface. Nothing distracts from the protocol itself.
  • Forces the common bits: tool registration, request and response shapes, structured error responses, and parameter validation.
  • Useful immediately. Agents can list files in a sandboxed directory for real tasks on day one.

Why "start with the real problem" backfires

A domain server mixes two unfamiliar things at once: the MCP protocol and your business logic. When something breaks, you cannot tell which layer is at fault, so you learn both slowly and trust neither. List-files removes the second variable entirely. Every bug is a protocol bug, which is exactly what you are there to learn. It is the same reason I tell teams to write their first tool description against a toy tool: isolate the new skill from the messy domain.

The 60-line version

Single tool: list_files(path: string). Returns an array of {name, type, size}. Rejects paths outside the sandbox root. Returns a structured error on missing directories. That is it. No reading file contents, that is the second server. No filtering, that is the third.

name: list_files
description: Use this when the user wants to see what files or folders exist at a path. Takes a path (string) relative to the sandbox root. Returns [{ name, type, size }]. Do not use this to read file contents; see read_file.

Notice the description already follows the registry rules from tool descriptions are prompts: a trigger, a parameter note, and an exclusion. Even the teaching server is a chance to build the habit.

A four-server ladder from protocol to domain
ServerTeachesNew surface introduced
list_filesRegistration, response shape, validationNone beyond the protocol
read_fileReturning content, size limitsPayload handling
write_fileMutations, confirmation, idempotencySide effects
your domain serverReal business logicAuth, external systems

The compounding payoff

Once your team has shipped list-files, the second server (read-file) takes a quarter of the time. The third (write-file with confirmation) takes less. By the fourth, you are reaching for the protocol primitives without thinking, which is when you can take on the domain server you originally wanted to build. With MCP 1.0 now stable, this ladder is also the cleanest way to onboard onto the current spec; see what MCP 1.0 changes.

Common mistakes

  • Skipping the sandbox check. A list-files tool that walks outside its root is a path-traversal hole on day one.
  • Returning a raw error string instead of a structured error. The agent needs to reason about the failure, not parse prose.
  • Jumping straight to the domain server and learning protocol and business logic at the same time.

The smallest server is not a toy. It is the fastest route to a team that understands MCP in its hands rather than in the abstract. If you want that onboarding compressed into a couple of days, it is the backbone of how I run agentic AI training.

The weekly take

Agentic AI patterns, delivered Thursdays

What I am shipping, watching, and pruning out of client stacks each week. One email. No fluff.

Shipping an agentic AI project this quarter?
Book a 30-min consult
Frequently asked

Questions readers ask about this post

Share this post
LinkedIn Facebook