PU

pazuzu1w/ubuntu_mcp_server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

47 stars 20 forks 质量 68 趋势 0MIT

pazuzu1w/ubuntu_mcp_server 是从 https://github.com/pazuzu1w/ubuntu_mcp_server. 导入的 MCP 服务器候选

概览

pazuzu1w/ubuntu_mcp_server 是从 https://github.com/pazuzu1w/ubuntu_mcp_server. 导入的 MCP 服务器候选

概述(AI 翻译)

🔒 安全优先 用于安全运行的模型上下文协议服务器

一台强化、就生产准备的模型上下文协议(MCP)服务器,为 AI 助手提供 安全、受控的 Ubuntu 系统操作访问。构建时采用全面的安全控制、审计日志和防御深度原则。

✨ 主要特色

🛡️ 安全优先架构

  • 路径穿越保护 - 通过允许列表/拒绝列表控制的符号链接解析
  • 命令净化 - 带有安全参数解析的壳注入预防
  • 资源限制 - 文件大小、执行超时和输出大小控制
  • 全面的审计日志 - 所有操作均以用户归属记录
  • 纵深防御 - 多层安全层,设有保险默认

🎯 核心能力

  • 文件操作 - 读取、写入和列出目录并进行权限验证
  • 命令执行 - 安全壳命令执行,支持白名单/黑名单过滤
  • 系统信息 - 操作系统详情、内存和磁盘使用监控
  • 包管理 - APT 包搜索和列表(安装需显式配置)

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

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.

✨ 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!

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "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" } } } }