STeLA MCP 是一个服务器,它提供对本地系统进行命令执行和文件操作的功能。该项目旨在为用户打造一个安全且可配置的接口,以实现对文件及目录的管理与操作。用户能通过配置允许访问的目录和受支持的命令,来灵活控制服务器功能。
STeLA MCP 提供了便捷的安装方式,你可以从源码安装,也能直接从 PyPI 安装。
git clone git@github.com:username/repo.git
cd repo
pip install -r requirements.txt
python server.py
pip install stela-mcp
STeLA MCP 具备丰富的功能模块,涵盖命令执行和文件系统操作等多个方面。
提供了一系列命令执行工具,可让用户在受控环境中运行系统命令。
拥有丰富的文件和目录操作工具,助力用户高效管理文件系统。
git clone git@github.com:username/repo.git
cd repo
pip install -r requirements.txt
python server.py
pip install stela-mcp
curl -X POST http://localhost:8000/api/v1/commands \
-H "Content-Type: application/json" \
-d '{"command": "ls -a", "args": []}'
curl -X POST http://localhost:8000/api/v1/files \
-H "Content-Type: application/json" \
-d '{"operation": "create_directory", "path": "/var/www/new_dir"}'
在启动服务器前,需进行基本配置。主要配置文件为 server_config.yaml,其中包含以下关键设置:
# server_config.yaml
logging:
level: INFO
file: mcp.log
allowed_directories:
- /home/user/data
- /var/www
enabled_commands:
- ls
- cp
- mv
- rm
security_rules:
allow_root: false
log_access: true
STeLA MCP 提供对本地系统执行命令和文件操作的功能,使用时需谨慎。以下是一些安全建议:
chmod 限制可执行权限。STeLA MCP 的源码结构如下:
stela-mcp/
├── server.py # 主服务器文件
├── commands/ # 支持的命令模块
│ ├── __init__.py
│ └── file_ops.py # 文件操作相关命令
├── config/ # 配置管理模块
│ ├── __init__.py
│ └── server_config.yaml.example # 示例配置文件
└── utils/ # 工具函数
├── logger.py # 日志记录工具
└── validators.py # 数据验证工具
git clone git@github.com:username/stela-mcp.git
cd stela-mcp
pip install -r requirements.txt
python server.py --dev
如需更多信息,请参考 STeLA MCP 官方文档。