
Lilith Shell

2025.03.21
0
Python终端命令执行AI 辅助开发开发效率
Lilith Shell 是一个增强的 MCP 服务器,允许 AI 助手在系统上执行终端命令,具有改进的安全控制和测试功能。由于提供了无限制的访问权限,因此必须在受控环境中使用,如虚拟机或可重建的开发系统。
View on GitHub
Overview
基本能力
产品定位
Lilith Shell 是一个用于增强 AI 助手执行终端命令能力的 MCP 服务器,特别适用于开发环境和受控测试环境。
核心功能
- 执行带有安全验证的 shell 命令
- 捕获命令输出(stdout/stderr)
- 设置工作目录
- 处理命令超时
- 改进的测试覆盖率
- 增强的安全控制
- FastMCP 集成
适用场景
- 开发环境中的自动化任务
- 受控测试环境中的命令执行
- AI 辅助的系统管理任务
工具列表
- execute_command
- 执行 shell 命令并返回其输出
- 输入:
command
(字符串): 要执行的命令directory
(字符串, 可选): 工作目录
- 返回:
- 命令退出代码
- 标准输出
- 标准错误
- 特性:
- 5分钟超时
- 工作目录支持
- 错误处理
- 安全验证
常见问题解答
- 检查日志:
- Windows:
%APPDATA%\Claude\Logs\mcp*.log
或%LOCALAPPDATA%\AnthropicClaude\Logs\mcp*.log
- macOS:
~/Library/Logs/Claude/mcp*.log
- 验证安装:
- 确保
uv
已正确安装并在 PATH 中 - 检查
mcp
包是否安装:pip show mcp
- 验证 Python 版本是否为 3.10 或更高
- 配置问题:
- 检查
claude_desktop_config.json
中的所有路径 - 验证 JSON 语法是否正确
- 确保路径分隔符适用于您的操作系统
- 确认配置文件位于正确的位置
使用教程
使用依赖
- Claude Desktop 并具有有效的 Claude Pro/Enterprise 订阅
- 下载地址: Claude AI
- Python 3.10 或更高版本
- Git
- uv (用于包管理)
安装教程
Windows 安装
- 安装依赖项:
- 选项 A - 使用 winget (如果系统支持):
powershell winget install python git
- 选项 B - 手动安装 (推荐):
- 从 python.org 下载并安装 Python
- 从 git-scm.com 下载并安装 Git
- 安装 uv:
powershell powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
- 克隆并设置项目:
cmd git clone https://github.com/charles-adedotun/Lilith-Shell.git cd Lilith-Shell python -m venv venv venv\Scripts\activate uv pip install -e ".[dev]"
macOS 安装
- 安装依赖项:
bash brew install python git uv
- 克隆并设置项目:
bash git clone https://github.com/charles-adedotun/Lilith-Shell.git cd Lilith-Shell python3 -m venv venv source venv/bin/activate uv pip install -e ".[dev]"
调试方式
- 手动测试服务器:
bash cd /path/to/cloned/Lilith-Shell ./venv/bin/python src/lilith_shell/executor.py
- 在 Claude Desktop 中测试命令:
text Can you run 'pwd' and tell me what directory we're in?
text Can you list the files in my home directory? Which of them are larger than 200 MB?