MCP servers that can list files

3 verified servers expose a tool that can list files in a directory

Before an agent reads or writes a specific file, it often has to find it: see what is in a folder, a vault, or a share. A list-files tool returns the contents of a directory so the agent can navigate to the file it actually needs.

These verified servers let an agent list the files in a directory.

Top pick

Obsidian

MarkusPfundstein

Community

Let an agent read, search, and edit your Obsidian vault through the Local REST API plugin.

knowledge-base3,823
Tool:
  • list_files_in_vault

list_files_in_vault lists the files and directories in an Obsidian vault, the navigation step for an agent working over a Markdown knowledge base.

Pick 2

Nextcloud

Chris Coutinho

Community

Production-ready community MCP server for Nextcloud: files, notes, calendar, contacts, tables, deck, talk, and more across 110+ tools.

file-storage248
Tool:
  • nc_webdav_list_directory

nc_webdav_list_directory lists a directory's contents over WebDAV, the way an agent browses files held in Nextcloud storage.

Pick 3

Filesystem

Anthropic (reference)

Official

Reference MCP server for secure local file access: read, write, edit, search, and explore within allowed directories.

dev-tools
Tool:
  • list_directory

list_directory returns the contents of a local directory, marking files and folders, for an agent navigating a path on disk.

What to know

Listing is the navigation step that read and write hang off. An agent rarely knows the exact path up front; it lists a directory, sees the files and subfolders, and walks to the one it wants. Where the files live shapes the tool: a note vault, a WebDAV share, a local path on disk. They return the same kind of thing, a set of files and directories, in the addressing scheme of wherever the content sits.

Directory contents change as files come and go, so a fresh list each time is usually right. What is worth holding onto is the structure the agent learned, where a given kind of file lives, so it can go straight there next time instead of re-walking the tree from the root.

Questions

How does this pair with reading a file?
Listing finds the path; reading fetches the contents. An agent that does not know the exact filename lists the directory first, picks the file it needs, then calls the read tool on that path. The two go together in most file work.
Does it list subfolders too?
Yes, these return both files and directories so an agent can walk a tree. It lists a folder, sees the subfolders, and descends into the one it wants, the same way a person navigates a file browser.