list_directoryLABSCO SUMMARY
Shell access with the fence built in — the policy decides what the agent can reach.
Handing an agent a terminal is the risk this is built around, and the answer is the policy: the secure default confines paths to your home and temp dirs, allows a short command whitelist, and turns off sudo and raw shell. The dev policy loosens that for development. Every operation is audit-logged, so you can see afterwards exactly what ran.
What it is
A hardened server for Ubuntu operations — file reads and writes, command execution and system info — with path allowlisting, command filtering and audit logging.
What you get
- read_file, write_file and list_directory with permission validation
- execute_command with a command whitelist and shell-injection-safe argument parsing
- get_system_info for OS details, memory and disk usage; search_packages for APT search and listing
- Path traversal protection with symlink resolution against allow and deny lists
- Resource limits on file size, execution time and output; all operations audit-logged
- Selectable policies — a secure default and a more permissive dev policy
Requirements
Ubuntu 18.04+ and Python 3.9 or higher. Clone, create a venv, install requirements, then launch main.py with a policy — the client passes --policy secure or --policy dev. The secure policy allows ~/, /tmp and /var/tmp, whitelists commands like ls, cat and grep, caps files at 1MB with 15s timeouts, and disables sudo and shell execution.
Setup effort
Build from source — git clone https://github.com/pazuzu1w/ubuntu_mcp_server
USE CASES
Letting an agent inspect a system safely
Read files, list directories and pull system info under the secure policy's path fence.
Running a whitelisted command
Execute an allowed command with arguments parsed safely against shell injection.
Checking what packages are available
Search APT and list packages without allowing installation.
Writing a file within the allowed paths
Write to ~/, /tmp or /var/tmp under the size and permission limits.
Loosening the fence for development
Switch to the dev policy for wider paths, larger limits and more commands.
7 tools
Listed in project docs. Your client may show a different list.
read_filewrite_fileexecute_commandget_system_infosearch_packagesinstall_packageBEFORE YOU INSTALL
What to know first
Tools you get
7 tools named in the project's documentation. install_package only checks package availability; it does not install. --policy secure allows nine commands, so execute_command refuses far more than under --policy dev.
Requires
- Python 3.9 or higher
- Standard Unix utilities (ls, cat, echo, etc.)
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
You clone this one yourself.
Server setup
# Clone the repository
git clone https://github.com/pazuzu1w/ubuntu_mcp_server
cd ubuntu_mcp_server
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Verify installation with built-in tests
python main.py --testMCP Clients
Claude Desktop
{
"mcpServers": {
"secure-ubuntu": {
"command": "<YOUR_PATH_TO_SECURE_UBUNTU_MCP>/.venv/bin/python3",
"args": [
"<YOUR_PATH_TO_SECURE_UBUNTU_MCP>/main.py",
"--policy",
"secure"
],
"env": {
"MCP_LOG_LEVEL": "INFO"
}
}
}
}