Skip to content

Writing files from an MCP mode

Write files through MCP

The write protocol mode tool exposes the write_file MCP tool. Add write only to modes that should be able to change host files; modes without that grant do not see write_file. delete_file is not exposed.

The default allowed prefix is .snodo/, for authoring plans, specs, protocols, and queues. A protocol can replace the default by declaring write_allowed_prefixes at its top level:

write_allowed_prefixes:
  - .snodo/
  - docs/specs/

Prefixes are project-relative. The resolved destination must remain inside the project root and one of those prefixes; traversal and symlinks are resolved before the check. A directory cannot be the destination, and refusal messages name the allowed prefixes. The tool writes directly without staging or committing and returns the project-relative path and UTF-8 byte count. Each successful write appends its path, byte count, SHA-256 content hash, mode, and session to the project audit log.

Intent tools

MCP planning tools can record local intent with record_intent (required text, optional issue and supersedes), retrieve a record by get_intent using intent_id, and list newest-first records with list_intents (optional positive limit). get_intent also returns the plans whose intent_ref names the record, each with its task status counts; list_intents does not.