mcp-fs mcp

v1.0.4 · MCP Tool · storage · registry.pascalai.org

Full filesystem manager. Read, write, append, delete, copy, move files; create and remove directories; list, stat, exists, find, count. Supports pagination (offset/limit) and sorting (name/ext/size/date :asc/:desc) for list and find.

filesystemfilesfsstorageioreadwritecopymovedeleteagentpaginationsort

Input Parameters

ParameterTypeDescription
operationrequired string Operation to perform. One of: read, write, append, delete, copy, move, mkdir, rmdir, list, stat, exists, find, count.
pathoptional string File or directory path. Required for all operations.
destoptional string Destination path. Required for: copy, move.
contentoptional string Text content. Required for: write, append.
patternoptional string File name filter pattern (e.g. "*.txt"). Used by: list, find, count. Default: "*"
encodingoptional string Text encoding: utf8 (default), utf16, ansi. Used by: read, write, append.
sortoptional string Sort entries by: name, ext, size, date. Append :asc or :desc suffix. Default: name:asc. Used by: list, find.
offsetoptional integer For read: first line (1-based, default 1). For list/find: entries to skip (default 0).
limitoptional integer For read: number of lines (default 0=all). For list/find: max entries to return (default 0=all).
overwriteoptional boolean Overwrite if destination exists. Used by: write, copy, move. Default: false
recursiveoptional boolean Recurse into subdirectories. Used by: list, find, count, mkdir, rmdir. Default: false

Output Fields

FieldTypeDescription
ok boolean
path string
src string
dest string
content string
size integer
lines integer
total integer
count integer
exists boolean
existed boolean
created boolean
is_dir boolean
modified string
pattern string
entries array[any]
matches array[any]
error string

Examples

Count files before listing

// Input
{
  "operation": "count",
  "path": "C:/src",
  "pattern": "*.pas",
  "recursive": true
}

// Output
{
  "ok": true,
  "total": 142
}

List first 10 largest files

// Input
{
  "operation": "list",
  "path": "C:/src",
  "pattern": "*.pas",
  "sort": "size:desc",
  "limit": 10
}

// Output
{
  "ok": true,
  "total": 142,
  "count": 10,
  "entries": [
    {
      "name": "main.pas",
      "size": 48200,
      "is_dir": false,
      "modified": "2026-03-15T10:22:00"
    }
  ]
}

Find logs sorted by date, page 2

// Input
{
  "operation": "find",
  "path": "C:/logs",
  "pattern": "*.log",
  "sort": "date:desc",
  "offset": 10,
  "limit": 10
}

// Output
{
  "ok": true,
  "total": 35,
  "count": 10,
  "matches": []
}

Read a file

// Input
{
  "operation": "read",
  "path": "C:/data/notes.txt",
  "offset": 1,
  "limit": 50
}

// Output
{
  "ok": true,
  "content": "Hello world",
  "lines": 1,
  "total": 1
}

Install & Discovery

Install

ppm install mcp-fs

Get JSON Schema

GET /v1/packages/mcp-fs/1.0.4/schema

Discover by keyword

GET /v1/mcp/discover?q=filesystem
Discovery hint: Install with ppm install mcp-fs or invoke remotely via POST /v1/invoke/mcp-fs on the MCP Service.

PascalAI Usage

uses toolslib;
var Tool := LoadTool('mcp-fs');
// Count first
var N := Tool.Call(JsonObj(['operation','count','path','C:/src','pattern','*.pas','recursive',True]));
// Then list with pagination
var R := Tool.Call(JsonObj(['operation','list','path','C:/src','pattern','*.pas','sort','size:desc','limit',20]));