PolarHub
  • Agents
  • MCP Servers
  • Skills
  • PolarBear
PolarHub © 2026
MCP Serversshell-accessubuntu_mcp_server
返回「shell-access」

ubuntu_mcp_server

modelscope·@pazuzu1w/ubuntu_mcp_server

shell-access0下载LocalModelScope

简介

暂无描述。

MCP Server 详情

来自 ModelScope 索引

Secure Ubuntu MCP Server

Security-First Model Context Protocol server for safe Ubuntu system operations

A hardened, production-ready Model Context Protocol (MCP) server that provides AI assistants with secure, controlled access to Ubuntu system operations. Built with comprehensive security controls, audit logging, and defense-in-depth principles.

License: MIT Python 3.9+ Security Focused MCP Compatible

Key Features

Security-First Architecture

  • Path traversal protection - Symlink resolution with allowlist/denylist controls
  • Command sanitization - Shell injection prevention with safe argument parsing
  • Resource limits - File size, execution timeouts, and output size controls
  • Comprehensive audit logging - All operations logged with user attribution
  • Defense in depth - Multiple security layers with fail-safe defaults

Core Capabilities

  • File Operations - Read, write, and list directories with permission validation
  • Command Execution - Safe shell command execution with whitelist/blacklist filtering
  • System Information - OS details, memory, and disk usage monitoring
  • Package Management - APT package search and listing (installation requires explicit config)

Production Ready

  • Modular design with clear separation of concerns
  • Comprehensive error handling with meaningful error messages
  • Extensive test suite including security validation tests
  • Configurable policies for different use cases and environments
  • Zero-dependency security - Core security doesn't rely on external packages

Quick Start

Prerequisites

  • Ubuntu 18.04+ (tested on 20.04, 22.04, 24.04)
  • Python 3.9 or higher
  • Standard Unix utilities (ls, cat, echo, etc.)

Installation

# Clone the repository
git clone https://github.com/yourusername/secure-ubuntu-mcp.git
cd secure-ubuntu-mcp

# 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 --test

Basic Usage

# Start with secure policy (recommended)
python main.py --policy secure

# Start with development policy (more permissive)
python main.py --policy dev

# Test security measures
python main.py --security-test

Integration

Claude Desktop

Getting Claude Desktop on Linux

Official Support: Claude Desktop doesn't officially support Linux, but the community has created solutions!

Recommended Method: Use the community Debian package by @aaddrick:

# Download and install Claude Desktop for Linux
wget https://github.com/aaddrick/claude-desktop-debian/releases/latest/download/claude-desktop_latest_amd64.deb
sudo dpkg -i claude-desktop_latest_amd64.deb
sudo apt-get install -f  # Fix any dependency issues

For other methods and troubleshooting, see: https://github.com/aaddrick/claude-desktop-debian

Configuration

Once Claude Desktop is installed, add to your configuration (~/.config/claude-desktop/claude_desktop_config.json):

{
  "mcpServers": {
    "secure-ubuntu": {
      "command": "/path/to/secure-ubuntu-mcp/.venv/bin/python3",
      "args": ["/path/to/secure-ubuntu-mcp/main.py", "--policy", "secure"],
      "env": {
        "MCP_LOG_LEVEL": "INFO"
      }
    }
  }
}

Important: Use absolute paths and the virtual environment Python interpreter

Verification: After restarting Claude Desktop, you should see "secure-ubuntu" listed as a connected server, and Claude will have access to system control tools.

Other MCP Clients

The server implements the standard MCP protocol and works with any MCP-compatible client:

# Example with mcp Python client
import asyncio
from mcp.client import ClientSession

async def example():
    # Connect to the server
    # Implementation depends on your MCP client
    pass

Security Policies

Secure Policy (Default)

Recommended for production and untrusted environments:

  • Allowed Paths: ~/, /tmp, /var/tmp
  • Forbidden Paths: /etc, /root, /boot, /sys, /proc, /dev, /usr, /bin, /sbin
  • Command Whitelist: ls, cat, echo, pwd, whoami, date, find, grep, apt (search only)
  • Resource Limits: 1MB files, 15s timeouts, 256KB output
  • Sudo: Disabled
  • Shell Execution: Disabled (uses safe direct execution)

Development Policy

More permissive for development environments:

  • Additional Allowed Paths: /opt, /usr/local
  • Fewer Restrictions: Access to more system areas
  • Larger Limits: 10MB files, 60s timeouts, 1MB output
  • More Commands: Most development tools allowed
  • Sudo: Still disabled by default (can be enabled)

Custom Policies

Create your own security policy:

from main import SecurityPolicy

custom_policy = SecurityPolicy(
    allowed_paths=["/your/custom/paths"],
    forbidden_paths=["/sensitive/areas"],
    allowed_commands=["safe", "commands"],
    forbidden_commands=["dangerous", "commands"],
    max_command_timeout=30,
    allow_sudo=False,  # Use with extreme caution
    audit_actions=True
)

Available Tools

File Operations

  • list_directory(path) - List directory contents with metadata
  • read_file(file_path) - Read file contents with size validation
  • write_file(file_path, content, create_dirs=False) - Write with atomic operations

System Operations

  • execute_command(command, working_dir=None) - Execute shell commands safely
  • get_system_info() - Get OS, m…

相关 MCP Servers(来自「shell-access」)

NoveltyEngine

暂无描述。

@NoveltyEngine/python-hello-warp-mcp

mcp-server-terminal

暂无描述。

@aybelatchane/mcp-server-terminal

20250923MCPtest

暂无描述。

@WeiWeicode/20250923MCPtest

docker-mcp-server

暂无描述。

@kenforthewin/docker-mcp-server

drapon

暂无描述。

@drapon/claude-mcp-servers

first_mcp

暂无描述。

@koopatroopa787/first_mcp

自动安装

点击按钮会唤起 PolarBear 客户端,并把当前 MCP Server 的 Markdown 详情文档地址传给客户端。

/api/mcps/pazuzu1w-ubuntu_mcp_server/markdown
打开 PolarBear 安装查看 Markdown 文档

手动安装

在 PolarBear 或其他支持 MCP 的客户端中,新建 MCP Server,并参考下方来源或安装提示配置。

# Clone the repository git clone https://github.com/yourusername/secure-ubuntu-mcp.git cd secure-ubuntu-mcp # 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 --test

基本信息

分类
shell-access / file-systems / command-line
运行方式
No
许可证
MIT License
详情文件
pazuzu1w-ubuntu_mcp_server.md