mcp-file-reader mcp
v1.0.0 · MCP Tool · registry.pascalai.org
Read files from the local filesystem. Supports text, binary (base64) and directory listing modes. Optional line range and encoding detection.
Input Parameters
| Parameter | Type | Description |
| pathrequired |
string |
Absolute or relative path to file or directory. |
| modeoptional |
string |
"text", "binary" (base64 output), or "list" (directory listing). Default: "text". |
| encodingoptional |
string |
Text encoding. "auto" detects automatically. Default: "auto". |
| start_lineoptional |
integer |
First line to read (1-based). Omit to read from the beginning. |
| end_lineoptional |
integer |
Last line to read (inclusive). Omit to read to end of file. |
| max_bytesoptional |
integer |
Safety read limit in bytes. Default: 1 MB (1048576). |
Output Fields
| Field | Type | Description |
| content |
string |
File contents as text, or base64 string when mode="binary". |
| path |
string |
Resolved absolute path of the file or directory read. |
| size_bytes |
integer |
Size of the file (or total size of directory contents) in bytes. |
| encoding |
string |
Detected or applied text encoding (e.g. "utf-8", "latin-1"). |
| line_count |
integer |
Number of lines returned. Only present in text mode. |
| mime_type |
string |
Detected MIME type of the file (e.g. "text/plain", "application/json"). |
| entries |
array |
Directory entries, each with name, type ("file" or "dir"), and size_bytes. Only present when mode="list". |
Example
// Read lines 10-20 of a log file
{
"path": "/var/log/app.log",
"start_line": 10,
"end_line": 20
}
// Output
{
"content": "[2026-03-13 10:00] ERROR database timeout\n...",
"path": "/var/log/app.log",
"line_count": 11,
"size_bytes": 420,
"encoding": "utf-8",
"mime_type": "text/plain"
}
Install & Discovery
Install
ppm install mcp-file-reader
Get JSON Schema
GET /v1/packages/mcp-file-reader/1.0.0/schema
Discover by keyword
GET /v1/mcp/discover?q=file+read
PascalAI Usage
uses toolslib;
var
Reader := LoadTool('mcp-file-reader');
Config := Reader.Call(JsonObj(['path', '/etc/app/config.json']));
DbHost := ParseJSON(Config['content'])['database']['host'];