隔离终端
一个安全的服务器,用于在预定义路径内执行终端命令,允许大型语言模型与操作系统环境进行安全交互。
可用工具 (1 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
execute_command 3 个参数 需填 1 项
Execute a command in the local system
必填参数:command
服务介绍
MCP 终端服务器
Model Context Protocol (MCP) 的一个安全命令行接口服务器,它允许 AI 模型在保持安全性和控制的同时与您的终端进行交互。
功能
- 🔒 可配置权限的安全命令执行
- 📁 允许路径内的文件系统操作
- 🌍 环境变量管理
- 💻 跨平台支持(Windows、macOS、Linux)
- 🔌 通过命令执行支持远程系统连接
与 Claude Desktop 一起使用
将服务器配置添加到您的 Claude Desktop 配置文件中:
{
"mcpServers": {
"terminal": {
"command": "npx",
"args": [
"@dillip285/mcp-terminal",
"--allowed-paths",
"/path/to/allowed/directory"
]
}
}
}
重启 Claude Desktop 以应用更改。现在您可以通过 Claude 使用终端功能,并且具有安全的文件访问和命令执行能力。
可用工具
execute_command: 安全地运行终端命令(包括 SSH 和远程命令)
安全性
- 所有操作都限制在指定的允许路径内
- 命令在执行前会经过验证和清理
- 小心管理环境变量
- 对安全相关问题进行适当的错误处理
开发
# Clone the repository
git clone https://github.com/dillip285/mcp-terminal.git
# Install dependencies
npm install
# Configure npm authentication
cp .npmrc.example .npmrc
# Edit .npmrc and add your NPM_TOKEN
# Run tests
npm test
# Build the project
npm run build
发布
要发布包,请执行以下步骤:
- 将
.npmrc.example复制为.npmrc - 在
.npmrc中添加您的 npm 认证令牌 - 运行
npm publish --access public
注意:不要提交带有认证令牌的 .npmrc 文件。该文件已添加到 .gitignore 中。
贡献
- 分叉仓库
- 创建你的特性分支 (
git checkout -b feature/amazing-feature) - 提交你的更改 (
git commit -m 'feat: Add amazing feature') - 推送到分支 (
git push origin feature/amazing-feature) - 打开一个 Pull Request
许可证
MIT 许可证 - 详情请参阅 LICENSE 文件。
相关项目
支持
对于 bug 报告和功能请求,请打开一个 issue。