This is a FastMCP server that provides basic file system operations within a restricted directory (fs/).
Install the dependencies using pip:
uv syncRun the server with:
uv run main.pyThe server communicates via stdio for MCP protocol.
Deletes a specified file from the file system.
Parameters:
filepath(string): The full path to the file to delete. The path must start with the root directory to prevent unauthorized access.
Returns:
bool:trueif the file was successfully deleted,falseotherwise (e.g., file not found, permission denied, or path outside the allowed root).
Example:
{
"method": "tools/call",
"params": {
"name": "delete_file",
"arguments": {
"filepath": "/path/to/fs/file.txt"
}
}
}Lists all files in the root directory.
Parameters: None
Returns:
list[string]: A list of full paths to files in the root directory.
Example:
{
"method": "tools/call",
"params": {
"name": "list_files",
"arguments": {}
}
}The server restricts operations to the fs/ directory relative to the script's location to prevent unauthorized file access.
MIT