Skip to main content
Glama
kujirahand

filesystem-mcp

by kujirahand

filesystem-mcp

An MCP server (Python) that can only read and write files inside folders you explicitly allow.

→日本語版はこちら (README-ja.md)

  • Uses the Python MCP SDK (mcp v2), following the latest MCP specification

  • Communicates over stdio

  • Every tool supports outputSchema / structuredContent (structured output)

Tools

Tool

Description

Arguments

list_allowed_directories

Returns the list of allowed directories

none

list_directory

Lists files and folders inside a directory

path

read_file

Reads a text file

path, encoding (default utf-8)

write_file

Writes or appends to a file

path, content, append, encoding

Related MCP server: MCP File Server

Usage

Pass one or more allowed directories as startup arguments.

uvx filesystem-mcp ~/Documents/work ~/tmp

To run from source, uv sync first, then:

uv run filesystem-mcp ~/Documents/work ~/tmp
uv run python -m filesystem_mcp ~/Documents/work

Any access outside the specified directories (and their subdirectories) fails with an error. Escaping via .. or a symlink is blocked too, since paths are checked against their resolved (real) location.

Registering with clients

uvx lets you run the server without installing it up front (it's fetched automatically on first use).

Run it from PyPI:

uvx filesystem-mcp ~/Documents/work

You can also install it with pip:

pip install filesystem-mcp
filesystem-mcp ~/Documents/work

Run it from a local checkout during development:

uvx --from /path/to/mcp_server-filesystem filesystem-mcp ~/Documents/work

Or run it directly from GitHub:

uvx --from git+https://github.com/kujirahand/mcp_server-filesystem filesystem-mcp ~/Documents/work

The trailing arguments (one or more) are the allowed directories.

Claude Code

claude mcp add filesystem -- uvx filesystem-mcp ~/Documents/work

Check the registration with claude mcp list, remove it with claude mcp remove filesystem.

Codex CLI

codex mcp add filesystem -- uvx filesystem-mcp ~/Documents/work

Or configure it directly in ~/.codex/config.toml:

[mcp_servers.filesystem]
command = "uvx"
args = ["filesystem-mcp", "~/Documents/work"]

List servers with codex mcp list, remove with codex mcp remove filesystem.

Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "filesystem": {
      "command": "uvx",
      "args": ["filesystem-mcp", "~/Documents/work"]
    }
  }
}

Testing with MCP Inspector

MCP Inspector lets you try out the tools without registering the server with a client (requires Node.js).

Using the GUI

npx -y @modelcontextprotocol/inspector uv run filesystem-mcp ~/Documents/work

When the browser opens, click Connect on the left to connect, then go to the Tools tab and click List Tools to see the available tools. Select a tool, fill in its arguments, and click Run Tool to see the result (including structured output).

To test against the published PyPI version instead, swap out the uv run part:

npx -y @modelcontextprotocol/inspector uvx filesystem-mcp ~/Documents/work

Using the CLI

Adding --cli returns the result as JSON without opening a browser, which is handy for quick checks and automation.

List tools:

npx -y @modelcontextprotocol/inspector --cli uv run filesystem-mcp ~/Documents/work \
  --method tools/list

Check the allowed directories:

npx -y @modelcontextprotocol/inspector --cli uv run filesystem-mcp ~/Documents/work \
  --method tools/call --tool-name list_allowed_directories

List a directory:

npx -y @modelcontextprotocol/inspector --cli uv run filesystem-mcp ~/Documents/work \
  --method tools/call --tool-name list_directory --tool-arg path=$HOME/Documents/work

Write and read a file (add one --tool-arg per argument):

npx -y @modelcontextprotocol/inspector --cli uv run filesystem-mcp ~/Documents/work \
  --method tools/call --tool-name write_file \
  --tool-arg path=$HOME/Documents/work/memo.txt --tool-arg content=hello

npx -y @modelcontextprotocol/inspector --cli uv run filesystem-mcp ~/Documents/work \
  --method tools/call --tool-name read_file --tool-arg path=$HOME/Documents/work/memo.txt

Pointing at a path outside the allowed directories returns "isError": true with a message like Path not allowed.

Tests

uv run pytest

License

MIT

Available Tools

4 tools
list_allowed_directories許可フォルダの一覧A
Read-onlyIdempotent

このサーバーが読み書きを許可されているフォルダの一覧を返します。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
directoriesYes許可フォルダの絶対パスの一覧

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint=true and idempotentHint=true, so the safety profile is covered. The description adds the useful scope that only server-authorized directories are returned, but it does not disclose other behavioral details such as ordering, errors, or permission-related failure modes. There is no contradiction with the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one compact Japanese sentence with no filler. It front-loads the resource and action clearly, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameterless, read-only, idempotent tool with an output schema, the description is nearly complete. The only minor gap is that it does not explicitly connect the returned directory list to the sibling file-operation tools, but this is not necessary for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so there are no parameter semantics to document. The description appropriately focuses on what the tool returns. Baseline 4 is appropriate for a parameterless tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource: it returns the list of folders the server is permitted to read and write. This clearly distinguishes it from siblings like list_directory, read_file, and write_file, which operate on directory contents or files rather than on the authorization boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use—discovering which directories are accessible before using file tools—is implied by the description, but it does not explicitly state when to use this tool instead of alternatives or mention any exclusions. No direct routing guidance to sibling tools is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_directoryフォルダのファイル一覧A
Read-onlyIdempotent

許可フォルダ内にあるフォルダの、ファイル・フォルダの一覧を返します。

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes一覧を取得するフォルダのパス

Output Schema

ParametersJSON Schema
NameRequiredDescription
pathYes実際に読んだフォルダの絶対パス
entriesYesフォルダの中身

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint and idempotentHint, so the safety profile is covered. The description adds the permission-boundary behavior ('許可フォルダ内') beyond annotations, but does not disclose other behaviors like non-recursive listing or behavior when the path is invalid.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, front-loads the action and scope, and contains no redundant words. Every part contributes to the meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter, read-only tool with an output schema, the description covers the essential behavior and the authorization scope. It is slightly incomplete only in not specifying whether the listing is immediate children or recursive, which would make it fully unambiguous.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the path parameter is already documented. The tool description adds no parameter-specific detail beyond the schema, only the general allowed-folder constraint; baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('返します') and resource (files/folders in a folder), and adds the scope constraint '許可フォルダ内' (within an allowed folder). It clearly describes the tool's function, though it does not explicitly call out how it differs from list_allowed_directories or read_file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this tool is for listing the contents of a folder under an allowed root, but it does not state when to prefer this over list_allowed_directories or read_file, nor does it mention prerequisites such as first discovering the allowed folders. Usage context is implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_fileファイルの読み込みA
Read-onlyIdempotent

許可フォルダ内にあるテキストファイルの内容を読み込んで返します。

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes読み込むファイルのパス
encodingNo文字コードutf-8

Output Schema

ParametersJSON Schema
NameRequiredDescription
pathYes実際に読んだファイルの絶対パス
sizeYesファイルのバイト数
contentYesファイルの内容

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and idempotentHint=true, so the safe, non-mutating behavior is covered. The description adds useful scope constraints beyond the schema: text files only, and only within permitted folders. There is no contradiction with the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence conveys the operation, resource type, and scope restriction with no redundant words. It is appropriately sized for a simple read tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a low-complexity read tool, the description, annotations, full schema coverage, and presence of an output schema collectively leave no critical gap. The important contextual restriction—allowed-folder scope—is explicitly stated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so both 'path' and 'encoding' are already documented in the input schema. The description does not add parameter-specific meaning, but at full schema coverage the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb (reads and returns) and a precise resource (contents of text files in allowed folders). This clearly distinguishes read_file from siblings like list_directory, list_allowed_directories, and write_file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context: use this tool when you need the content of a text file within the allowed folder. It does not explicitly mention alternatives or when-not-to-use conditions, but the purpose is unambiguous enough to infer the correct choice from sibling names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

write_fileファイルの書き込みA
Destructive

許可フォルダ内のファイルにテキストを書き込みます。既存のファイルは上書きされます(append を True にすると末尾に追記します)。

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes書き込むファイルのパス
appendNoTrueなら追記、Falseなら上書き
contentYes書き込む内容
encodingNo文字コードutf-8

Output Schema

ParametersJSON Schema
NameRequiredDescription
pathYes書き込んだファイルの絶対パス
appendedYes追記した場合はTrue
bytes_writtenYes書き込んだバイト数

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already signal destructiveness (destructiveHint=true). The description adds valuable behavioral detail by explicitly stating that existing files are overwritten and that append=true appends instead. This goes beyond the annotation without contradicting it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, focused sentence that front-loads the core action and constraint, with a parenthetical clarifying the append option. No wasted words or redundancy with the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With annotations covering safety, the schema covering parameters, and an output schema present, the description covers the essential behavior (overwrite vs. append) and scope. Nothing critical is missing for a competent agent to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the parameters are already fully documented. The description adds minimal extra meaning beyond the schema, mainly reinforcing the overwrite/append behavior already visible in the schema defaults and descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('書き込みます' — writes) and the resource ('ファイル' — file), and explicitly notes the allowed-folder scope. This sets it apart from sibling read/list tools without any ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The usage context is implied: it handles writes within the allowed folder, while siblings handle reading and listing. However, it does not explicitly mention when to prefer this tool over read_file, or what conditions would make writing inappropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv1.0.2
    • First observedlist_allowed_directories
    • First observedlist_directory
    • First observedread_file
    • First observedwrite_file

TDQS

A3.9/5.0
Disambiguation5/5

Each tool has a distinctly different purpose: listing allowed roots, listing directory contents, reading a file, and writing a file. The only potentially similar pair is list_allowed_directories and list_directory, but the descriptions clearly separate them.

Naming Consistency5/5

All tool names follow a consistent verb_noun snake_case pattern: list_*, list_*, read_file, write_file. The naming is predictable and easy to extend.

Tool Count5/5

Four tools is a reasonable, focused count for a minimal filesystem access server. Each tool covers a distinct core operation and none feel redundant.

Completeness2/5

The set covers listing and file read/write, but lacks essential filesystem operations like creating or deleting directories, deleting or renaming files, and checking file metadata. Common workflows will hit dead ends.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    Enables secure filesystem operations with directory sandboxing and optional read-only mode. Supports file reading/writing, directory management, file searching, and text operations while restricting access to specified directories.
    12
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides secure, sandboxed filesystem operations including reading, writing, listing, searching, and managing files and directories within a configurable working directory with strict security controls.
    3
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides sandboxed access to local filesystem operations including directory and file management, content search with glob and regex patterns, and binary file support with configurable safety limits.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides secure access to local files from specified directories. Enables listing files, reading contents, and configurable file size and extension filtering.
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kujirahand/mcp_server-filesystem'

If you have feedback or need assistance with the MCP directory API, please join our Discord server