使用说明
系统精简版
Linux系统的AI原生操作系统核心
LLM自动监视、控制、优化系统MCP服务器
🎯 概要
systerd-lite 单击功能区上LLM(大规模语言模型)Linux使系统能够作为“自己的身体”进行操作MCP服务器。
主要特征
- 🔧 200+系统控制工具:流程管理、网络、存储、安全性等
- 🤖 LLM自己编集机能: LLM可以读写和修改自己的代码和环境
- 📡 泛用MCP对应: HTTP/SSE/stdio 支持3个传输
- 🎛️ Gradio用户界面:基于浏览器的管理界面
- 🔐 灵活的权限管理:每个工具的权限设置和模板
📦 快速启动
起动
# リポジトリをクローン
git clone https://github.com/your/sisterd_lite.git
cd sisterd_lite
# 起動(依存関係は自動インストール)
chmod +x start-mcp.sh
./start-mcp.sh
端点
服务URL | 说明 |---------|-----|------| | HTTP API | http://localhost:8089 | MCP JSON-RPC 端点| | Gradio UI | http://localhost:7861 | Web管理接口 | Health | http://localhost:8089/health|健康检查|
动作确认
# ヘルスチェック
curl http://localhost:8089/health
# システム情報取得
curl -X POST http://localhost:8089 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_system_info","arguments":{}}}'
🛠️ 工具类别
📊 Monitoring(监视)
工具|说明|
|-------|------|
| get_system_info 系统整体信息
| get_cpu_info | CPU详细情报|
| get_memory_info 内存使用量
| get_disk_usage 磁盘使用量
| get_temperature 温度传感器
| list_processes 进程列表
| get_top_processes 资源消耗排名靠前
🔐 Security(安全性)
工具|说明|
|-------|------|
| get_selinux_status | SELinux状態 |
| get_apparmor_status | AppArmor状態 |
| list_firewall_rules |防火墙规则|
| scan_suid_files | SUID/SGID文件搜索
| get_failed_logins |失败登录尝试|
| audit_permissions |权限审计|
🖥️ System(系统)
工具|说明|
|-------|------|
| manage_service | systemd服务控制
| list_units | systemd设备列表
| get_kernel_modules 内核模块
| get_hardware_info |硬件信息|
| get_usb_devices | USB设备列表
�� Container(容器)
工具|说明|
|-------|------|
| list_containers 容器列表
| start_container 容器启动
| stop_container |集装箱停止|
| run_container 执行新容器
| get_container_logs 获取日志
🤖 Self(LLM自己编集)
LLM用于操作自己环境的工具群
工具|说明|
|-------|------|
| read_workspace_file 工作区内文件读取
| write_workspace_file 文件写入/创建
| append_to_file 文件追记
| list_workspace_directory 目录列表
| search_workspace 文件/内容搜索
| execute_shell_command 执行壳命令
| install_python_package | Python软件包安装
| get_python_environment | Python环境情报|
| set_environment_variable |环境变数设定|
| restart_self 服务器自重启
| get_self_status 获取服务器状态
| backup_workspace 工作区备份
🧮 Calculator(计算)
工具|说明|
|-------|------|
| calculate |数式评似|
| convert_units |単位变换|
| matrix_operation | 行列演算 |
| statistics |统计计算|
| solve_equation | 方程式求解 |
⚙️ MCP Config(设定管理)
工具|说明|
|-------|------|
| get_mcp_config 获取当前设置
| list_mcp_tools 工具列表
| set_mcp_tool_permission |个别権限设定|
| apply_mcp_template 应用模板
| get_mcp_templates |可用模板|
📋 模板
可根据用途统一设置工具集:
模板:工具数:用途
|-------------|---------|------|
| minimal |~18|仅安全监视|
| monitoring 系统监视
| development 用于开发(包括容器、自我编辑)
| security |~31|安全审计|
| full |~200|所有工具有效|
# テンプレート適用
curl -X POST http://localhost:8089 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"apply_mcp_template","arguments":{"template":"development"}}}'
🔌 客户端设置
VS Code
.vscode/mcp.json:
{
"servers": {
"systerd": {
"type": "http",
"url": "http://localhost:8089"
}
}
}
克劳德桌面版
~/.config/claude/claude_desktop_config.json:
{
"mcpServers": {
"systerd": {
"command": "python3",
"args": ["/path/to/mcp_server_unified.py"]
}
}
}
Ollama / HTTP 客户机
# ツール一覧取得
curl -X POST http://localhost:8089 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
# ツール呼び出し
curl -X POST http://localhost:8089 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_uptime","arguments":{}}}'
🏗️ 体系结构
┌─────────────────────────────────────────────────────────────────┐
│ Clients │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ VS Code │ │ Claude │ │ Ollama │ │ Gradio UI│ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ │ │ │ │ │
│ └─────────────┴──────┬──────┴─────────────┘ │
│ │ │
│ ┌──────▼──────┐ │
│ │ MCP HTTP │ Port 8089 │
│ │ Endpoint │ │
│ └──────┬──────┘ │
│ │ │
└────────────────────────────┼─────────────────────────────────────┘
│
┌────────────────────────────▼─────────────────────────────────────┐
│ systerd-lite │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ MCPHandler │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │Monitoring│ │ Security │ │ Container│ │ Self │ │ │
│ │ │ Tools │ │ Tools │ │ Tools │ │ Tools │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────────▼───────────────────────────────────┐ │
│ │ Permission Manager │ │
│ │ DISABLED │ READ_ONLY │ AI_ASK │ AI_AUTO │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │ │
└────────────────────────────┼─────────────────────────────────────┘
│
┌────────────────────────────▼─────────────────────────────────────┐
│ Linux System │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ systemd │ │ psutil │ │ Docker │ │ File I/O │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└──────────────────────────────────────────────────────────────────┘
📁 文件配置
sisterd_lite/
├── start-mcp.sh # 推奨起動スクリプト
├── start-lite.sh # 代替起動スクリプト
├── systerd-lite.py # メインアプリケーション
├── mcp_server_unified.py # stdio/HTTP/SSE統合サーバー
├── README.md # このファイル
├── .vscode/
│ └── mcp.json # VS Code MCP設定
├── .state/
│ └── permissions.json # ツール権限設定(自動生成)
└── systerd_lite/ # Pythonモジュール
├── mcp.py # MCPハンドラー(200+ツール)
├── permissions.py # 権限管理
├── sensors.py # システムセンサー
├── tuner.py # システムチューニング
├── container.py # コンテナ管理
├── scheduler.py # タスクスケジューラ
└── ui/ # Gradio UIモジュール
🔧 启动选项
# 基本起動
./start-mcp.sh
# カスタムポート
./systerd-lite.py --port 9000 --gradio 9001
# ヘッドレスモード(UIなし)
./systerd-lite.py --no-ui
# デバッグモード
./systerd-lite.py --debug
🔐 安全性
权限级别
|级别|说明|
|-------|------|
| DISABLED 工具无效
| READ_ONLY 只读取
| AI_ASK 执行前确认
| AI_AUTO |自动実行许可|
推奨事项
- 在生产环境中
minimal或monitoring使用模板 self类别工具仅在可信环境中启用- HTTP API需要时防火墙保护
systerd-lite(英语)
Linux系统的AI原生操作系统核心
一个MCP服务器,允许LLM作为自己的主体自主监视、控制和优化Linux系统。
🎯 概述
systerd-lite 是一个MCP服务器,它使LLM(大型语言模型)能够将Linux系统作为自己的主体进行操作。
主要特点
- 🔧 200+系统控制工具:流程管理、网络、存储、安全等
- 🤖 LLM自我编辑:LLM可以读取、写入和修改自己的代码和环境
- 📡 通用MCP支持:支持HTTP/SSE/stdio传输
- 🎛️ Gradio用户界面:基于浏览器的管理界面
- 🔐 灵活的权限管理:按工具权限设置和模板
📦 快速开始
发射
# Clone repository
git clone https://github.com/your/sisterd_lite.git
cd sisterd_lite
# Start (dependencies auto-installed)
chmod +x start-mcp.sh
./start-mcp.sh
端点
| 服务 | URL | 描述 |
|---|---|---|
| HTTP API | http://localhost:8089 | MCP JSON-RPC端点 |
| Gradio用户界面 | http://localhost:7861 | Web管理界面 |
| 健康 | http://localhost:8089/health | 健康检查 |
验证
# Health check
curl http://localhost:8089/health
# Get system info
curl -X POST http://localhost:8089 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_system_info","arguments":{}}}'
🛠️ 工具类别
📊 监控
| 工具 | 说明 |
|---|---|
get_system_info |
系统概述 |
get_cpu_info |
CPU详细信息 |
get_memory_info |
内存使用情况 |
get_disk_usage |
磁盘使用情况 |
get_temperature |
温度传感器 |
list_processes |
工艺清单 |
get_top_processes |
最高资源使用率 |
🔐 安全
| 工具 | 说明 |
|---|---|
get_selinux_status |
SELinux状态 |
get_apparmor_status |
AppArmor状态 |
list_firewall_rules |
防火墙规则 |
scan_suid_files |
SUID/SGID文件扫描 |
get_failed_logins |
登录尝试失败 |
audit_permissions |
权限审核 |
🖥️ 系统
| 工具 | 说明 |
|---|---|
manage_service |
systemd服务控制 |
list_units |
systemd单元列表 |
get_kernel_modules |
内核模块 |
get_hardware_info |
硬件信息 |
get_usb_devices |
USB设备列表 |
🐳 容器
| 工具 | 说明 |
|---|---|
list_containers |
集装箱清单 |
start_container |
启动容器 |
stop_container |
停止集装箱 |
run_container |
运行新容器 |
get_container_logs |
获取日志 |
🤖 自我(LLM自我编辑)
LLM操作自己环境的工具
| 工具 | 说明 |
|---|---|
read_workspace_file |
读取工作区文件 |
write_workspace_file |
写入/创建文件 |
append_to_file |
附加到文件 |
list_workspace_directory |
列表目录 |
search_workspace |
搜索文件/内容 |
execute_shell_command |
运行shell命令 |
install_python_package |
安装Python包 |
get_python_environment |
Python环境信息 |
set_environment_variable |
设置环境变量 |
restart_self |
重新启动服务器 |
get_self_status |
获取服务器状态 |
backup_workspace |
备份工作区 |
🧮 计算器
| 工具 | 说明 |
|---|---|
calculate |
计算表达式 |
convert_units |
单位转换 |
matrix_operation |
矩阵运算 |
statistics |
统计数据 |
solve_equation |
方程求解 |
⚙️ MCP配置
| 工具 | 说明 |
|---|---|
get_mcp_config |
获取当前配置 |
list_mcp_tools |
列出工具 |
set_mcp_tool_permission |
设置个人权限 |
apply_mcp_template |
应用模板 |
get_mcp_templates |
可用模板 |
📋 模板
为不同用例设置工具集:
| 模板 | 工具计数 | 用例 |
|---|---|---|
minimal |
~18 | 仅安全监控 |
monitoring |
~18 | 系统监控 |
development |
~47 | 开发(包括容器、自编辑) |
security |
~31 | 安全审计 |
full |
~200 | 已启用所有工具 |
# Apply template
curl -X POST http://localhost:8089 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"apply_mcp_template","arguments":{"template":"development"}}}'
🔌 客户端配置
VS Code
.vscode/mcp.json:
{
"servers": {
"systerd": {
"type": "http",
"url": "http://localhost:8089"
}
}
}
克劳德桌面版
~/.config/claude/claude_desktop_config.json:
{
"mcpServers": {
"systerd": {
"command": "python3",
"args": ["/path/to/mcp_server_unified.py"]
}
}
}
Ollama/HTTP客户端
# List tools
curl -X POST http://localhost:8089 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
# Call tool
curl -X POST http://localhost:8089 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_uptime","arguments":{}}}'
🏗️ 建筑
┌─────────────────────────────────────────────────────────────────┐
│ Clients │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ VS Code │ │ Claude │ │ Ollama │ │ Gradio UI│ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ │ │ │ │ │
│ └─────────────┴──────┬──────┴─────────────┘ │
│ │ │
│ ┌──────▼──────┐ │
│ │ MCP HTTP │ Port 8089 │
│ │ Endpoint │ │
│ └──────┬──────┘ │
│ │ │
└────────────────────────────┼─────────────────────────────────────┘
│
┌────────────────────────────▼─────────────────────────────────────┐
│ systerd-lite │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ MCPHandler │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │Monitoring│ │ Security │ │ Container│ │ Self │ │ │
│ │ │ Tools │ │ Tools │ │ Tools │ │ Tools │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────────▼───────────────────────────────────┐ │
│ │ Permission Manager │ │
│ │ DISABLED │ READ_ONLY │ AI_ASK │ AI_AUTO │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │ │
└────────────────────────────┼─────────────────────────────────────┘
│
┌────────────────────────────▼─────────────────────────────────────┐
│ Linux System │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ systemd │ │ psutil │ │ Docker │ │ File I/O │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└──────────────────────────────────────────────────────────────────┘
📁 文件结构
sisterd_lite/
├── start-mcp.sh # Recommended startup script
├── start-lite.sh # Alternative startup script
├── systerd-lite.py # Main application
├── mcp_server_unified.py # Unified stdio/HTTP/SSE server
├── README.md # This file
├── .vscode/
│ └── mcp.json # VS Code MCP config
├── .state/
│ └── permissions.json # Tool permission config (auto-generated)
└── systerd_lite/ # Python modules
├── mcp.py # MCP handler (200+ tools)
├── permissions.py # Permission management
├── sensors.py # System sensors
├── tuner.py # System tuning
├── container.py # Container management
├── scheduler.py # Task scheduler
└── ui/ # Gradio UI module
🔧 启动选项
# Basic startup
./start-mcp.sh
# Custom ports
./systerd-lite.py --port 9000 --gradio 9001
# Headless mode (no UI)
./systerd-lite.py --no-ui
# Debug mode
./systerd-lite.py --debug
🔐 安全
权限级别
| 级别 | 描述 |
|---|---|
DISABLED |
工具已禁用 |
READ_ONLY |
只读 |
AI_ASK |
执行前确认 |
AI_AUTO |
允许自动执行 |
建议
- 使用
minimal或monitoring生产中的模板 - 启用
self仅在受信任的环境中使用类别工具 - 根据需要使用防火墙保护HTTP API