Back to MCP directory
publicPublicdnsLocal runtime

MCP Terminal Server

MCP终端服务器是一个安全的命令行接口服务,为AI模型提供终端交互能力,同时保障系统安全。

article

README

🚀 MCP 终端服务器

MCP 终端服务器是一款安全的命令行接口服务器,专为模型上下文协议(MCP)打造。它能让 AI 模型与您的终端进行交互,同时保障操作的安全性与可控性。

🚀 快速开始

将服务器配置添加到您的Claude Desktop配置文件中:

{
  "mcpServers": {
    "terminal": {
      "command": "npx",
      "args": [
        "@dillip285/mcp-terminal",
        "--allowed-paths",
        "/path/to/allowed/directory"
      ]
    }
  }
}

重新启动Claude Desktop以应用更改。您现在可以通过Claude使用终端功能,享受安全的文件访问和命令执行。

✨ 主要特性

  • 🔒 安全的命令执行,带有可配置权限
  • 📁 允许路径内的文件系统操作
  • 🌍 环境变量管理
  • 💻 跨平台支持(Windows、macOS、Linux)
  • 🔌 通过命令执行连接远程系统

💻 使用示例

基础用法

可使用以下工具:

  • execute_command:安全地运行终端命令(包括SSH和远程命令)

🔧 技术细节

安全性

  • 所有操作均限制在指定的允许路径内
  • 命令经过验证和清理后执行
  • 环境变量严格管理
  • 安全相关的错误能得到妥善处理

开发

# 克隆仓库
git clone https://github.com/dillip285/mcp-terminal.git

# 安装依赖项
npm install

# 配置 npm 身份验证
cp .npmrc.example .npmrc
# 编辑.npmrc并添加您的NPM_TOKEN

# 运行测试
npm test

# 构建项目
npm run build

发布

要发布包:

  1. 复制.npmrc.example.npmrc
  2. 将您的 npm 身份验证令牌添加到 .npmrc
  3. 运行 npm publish --access public

⚠️ 重要提示

永远不要提交 .npmrc 文件内的认证令牌。它已被添加到.gitignore 中。

贡献

  1. 叉克隆仓库
  2. 创建功能分支(例如 git checkout -b feature/amazing-feature
  3. 提交更改(例如 git commit -m 'feat: 添加神奇功能'
  4. 推送到分支(例如 git push origin feature/amazing-feature
  5. 打开 Pull Request

📄 许可证

MIT License - 详细内容请查看 LICENSE 文件。

📚 详细文档

相关项目

支持

若要进行 bug 报告或提出功能需求,请打开 Issues

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client