read_local_files¶
Read a file from the project (or anywhere the configured filesystem MCP server can see) and answer questions about its contents — the canonical example of an MCP-backed stdlib skill.
When to use¶
- The user asks about a file by name or path: "What does
pyproject.tomldeclare?", "Summarise the licence section of README". - The router emits
read_local_fileswhen the request is filesystem-shaped and a configuredfilesystemserver is available.
When NOT to use¶
- For free-form code search across the project — that's
web_researchor grep-style ops, not single-file reads. - For files inside
.reyn/that the OS already reads via defaultfile.readpermissions — no MCP detour needed. - For binary files; the underlying tool is
read_text_file.
Required setup¶
Setup checklist¶
- MCP filesystem server — add
mcp.servers.filesystemtoreyn.yaml(see block below). - Permission pre-approval — add
mcp.filesystem: allowto thepermissions:block inreyn.yaml. Without this, Reyn prompts interactively on every MCP call; in headless / non-TTY environments (CI, piped stdin, dogfood scripts) the prompt cannot be answered and every call returnspermission_denied, causing the skill to exit empty. - See
cookbook/configs/with-mcp.yamlfor a complete working example — copy it to your project root and rename toreyn.yaml.
A filesystem MCP server MUST be configured in reyn.yaml under that exact name.
Paste the block below into your existing reyn.yaml (both mcp and permissions sections are required):
permissions:
mcp.filesystem: allow # required for headless / non-TTY execution
mcp:
servers:
filesystem:
type: stdio
command: npx
args: ["-y", "@modelcontextprotocol/server-filesystem", "."]
See How-to: use an MCP server for the full setup walkthrough, including installing the [mcp] extra.
Phases¶
| Phase | Purpose |
|---|---|
read_and_respond |
Entry phase. Resolves the requested path, emits an mcp op against filesystem, formats the response. May finish with file_content_response, or transition for follow-up. |
The phase declares permissions.mcp: [filesystem] in its frontmatter.
Final output: file_content_response¶
| Field | Type | Purpose |
|---|---|---|
path |
string | The path that was read (as resolved by the server) |
content |
string | File contents, or the answer derived from them |
summary |
string (optional) | One-paragraph synopsis when the user asked for a summary rather than raw text |
Examples¶
Sample prompts that route here:
- "Read README.md and tell me what reyn is."
- "What licences are mentioned in
LICENSE?" - "Summarise the philosophy section of
docs/concepts/principles.md."
Sample prompts that DO NOT route here:
- "Find all TODO comments in the repo." → broader search; not a single-file read.
- "What's in
.reyn/events.jsonl?" → handled by defaultfile.read, no MCP.
Source¶
src/reyn/stdlib/skills/read_local_files/
See also¶
- Concepts: MCP — how reyn integrates the protocol
- How-to: use an MCP server — the quickstart this skill exercises
- Reference:
reyn.yaml§ MCP servers