Checking support
Before attempting to use filesystem methods, Agents MUST verify that the Client supports these capabilities by checking the Client Capabilities field in the Client’sinitialize request:
readTextFile or writeTextFile is false or not present, the Agent MUST NOT attempt to call the corresponding filesystem method.
Reading files
Thefs/read_text_file method allows Agents to read text file contents from the Client’s filesystem, including unsaved changes in the editor.
The Session ID for this request. The
session determines which filesystem roots are in scope for the path.
Writing files
Thefs/write_text_file method allows Agents to write or update text files in the Client’s filesystem.
The Session ID for this request. The
session determines which filesystem roots are in scope for the path.
Absolute path to the file to write.The Client MUST create the file if it doesn’t exist.
Security
The Client performs these operations itself, so it is responsible for checking them. A permission request from the Agent does not replace the Client’s own checks.- Clients SHOULD check requested paths against the session’s root set at the time of use, and deny the request or ask the user outside them.
- Clients SHOULD ask the user before
fs/write_text_filechanges files that control execution or approval, such as version-control hooks, editor or Agent settings, and MCP configuration.