Token导航 LogoToken导航TokenDH.com
MCP ShellKeeper logo
AI代理未说明官方级别未说明来源级核验

MCP ShellKeeper

MCP Server

MCP ShellKeeper是一款为AI助手设计的终端会话管理工具,提供持久化SSH会话和文件传输功能,适用于服务器调试、部署和文件管理等场景。

工具数

0

提示词数

0

GitHub Stars

32

资源数

0
JavaScriptClaudeAI代理ClaudeCursorCline

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

tranhuucanh

提供方

tranhuucanh

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

🐚 MCP外壳管理器

AI助手的持久终端会话+文件传输

SSH到服务器、运行命令、传输文件——所有这些都是通过你的人工智能助手完成的。不再有无国籍限制。

![License: MIT](https://opensource.org/licenses/MIT) ](https://nodejs.org) ![MCP](https://modelcontextprotocol.io) ](https://www.npmjs.com/package/mcp-shellkeeper) ](https://www.npmjs.com/package/mcp-shellkeeper) ![Ask DeepWiki](https://deepwiki.com/tranhuucanh/mcp-shellkeeper)

真实世界示例安装核心功能用例工具

______________________________________________________________________

🎯 问题

像Cursor这样的AI助手执行命令 无政府 --每个命令都在新的环境中运行:

❌ ssh user@server                          # Hangs forever - no output until exit
❌ Can't run commands after SSH
❌ Each command starts from scratch
❌ No way to transfer files to/from servers
❌ Must re-authenticate for every operation

✨ 解决方案

ShellCeeper将AI助手转化为 有状态运算符 具有持久会话和文件传输功能。

______________________________________________________________________

🚀 核心功能

🔄 正式执行

传统人工智能(无状态)

You: "SSH to server"
AI: ❌ Command hangs forever

You: "List files"
AI: ❌ Runs on local, not server

贝壳守护者(有状态)

You: "Connect to my server"
AI: ✅ Establishes SSH session

You: "What files are there?"
AI: ✅ Lists files on server

You: "Go to the logs folder"
AI: ✅ Changes to /var/log

You: "Show me recent errors"
AI: ✅ Displays log content

AI在您的问题之间保持完整的上下文!

🎯 持续会话

自然对话流

You: "SSH to production server"
AI: ✅ Connected to prod-01
    Session: prod-01

You: "How much disk space left?"
AI: ✅ 45GB available
    (same session, no re-auth)

You: "Show me today's logs"
AI: ✅ Displaying logs...
    (same session continues)

You: "Restart the API service"
AI: ✅ Service restarted
    (still same session!)

AI会记住一切:

  • ✅ 您的SSH连接
  • ✅ 当前目录
  • ✅ 环境变量
  • ✅ 所有先前上下文

📁 无缝文件传输

用自然语言提问

You: "Upload my config to the server"

AI: ✅ Uploaded config.json
    /app/config/config.json

---

You: "Download the error logs"

AI: ✅ Downloaded app.log
    Saved to ./logs/app.log

---

You: "Get database backup"

AI: ✅ Downloaded backup.sql
    (even through SSH jumps!)

它只是起作用:

  • ✅ 通过任何SSH会话
  • ✅ 多个跳转主机
  • ✅ 高达10MB的文件
  • ✅ 二进制和文本文件

______________________________________________________________________

🎬 真实世界示例

观看自然对话如何变成自动化操作:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

👤 YOU ASK:
   "Debug the slow API on prod-server-01"

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🤖 AI EXECUTES:

   [Connecting...]
   → ssh user@prod-server-01
   ✅ Connected to prod-server-01

   [Investigating processes...]
   → ps aux | grep api
   📊 API process found: PID 1234, using 98% CPU

   [Checking logs...]
   → cd /var/log/api && tail -n 100 error.log
   🔍 ERROR: Memory leak in /api/v1/users endpoint

   [Downloading for analysis...]
   → Download: /var/log/api/error.log → ./local-debug/
   ✅ Downloaded 2.4MB (analyzed: 500+ memory errors)

   [Applying fix...]
   → Upload: ./fixed-config.yml → /app/config/
   ✅ Uploaded new rate-limiting config

   [Restarting service...]
   → systemctl restart api-service
   → systemctl status api-service
   ✅ Service restarted, CPU now at 12%

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🤖 AI RESPONDS:
   "Fixed! The API had a memory leak in the users endpoint.

   • Downloaded logs and found 500+ memory allocation errors
   • Applied rate-limiting configuration
   • Restarted service - CPU dropped from 98% to 12%
   • All operations completed in one persistent session"

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✨ All in ONE session, NO re-authentication needed! ✨

______________________________________________________________________

📦 安装

npm install -g mcp-shellkeeper

配置

光标

设置JSON:

{
  "mcpServers": {
    "shellkeeper": {
      "command": "npx",
      "args": ["-y", "mcp-shellkeeper"]
    }
  }
}

(Cmd+Shift+P → 首选项:打开设置)

克劳德代码

配置文件:

{
  "mcpServers": {
    "shellkeeper": {
      "command": "npx",
      "args": ["-y", "mcp-shellkeeper"]
    }
  }
}

(~/.config/claude/config.json)

VS代码(临床)

设置JSON:

{
  "cline.mcpServers": {
    "shellkeeper": {
      "command": "npx",
      "args": ["-y", "mcp-shellkeeper"]
    }
  }
}

重启你的AI助手 你准备好了! 🎉

______________________________________________________________________

💡 用例

场景你问什么人工智能做什么
🔍 调试生产*“为什么prod-api很慢?”*SSH→ 检查CPU/内存→ 下载日志→ 分析→ 上传修复→ 重新启动
🚀 部署更新*“将v2.0部署到登台”*SSH→ 备份→ 上传文件→ 迁移数据库→ 重启→ 验证
🔧 更新配置*“更新web服务器上的SSL证书”*SSH→ 下载旧证书→ 上传新→ Test → 重新加载nginx
🗄️ 备份数据库*“将prod数据库备份到本地”*SSH穿越堡垒→ 转储数据库→ 压缩→ 下载→ 验证
📊 分析日志*“今天查找所有500个错误”*SSH→ 解析日志→ 下载→ 本地分析→ 报告模式
🔄 批量操作*“更新所有服务器上的配置”*平行会议→ 上传→ 重启→ 下载结果

通过与您的AI进行自然对话! 没有脚本,没有手动SSH杂耍。

______________________________________________________________________

📖 可用工具

AI会自动使用这些工具,但您可以参考它们进行高级使用:

工具目的主要功能
terminal_execute在持久会话中运行命令超时配置,退出代码捕获,清理输出
terminal_upload_file上传本地→ remote(最大10MB)自动检测目录,处理重复项,通过SSH工作
terminal_download_file下载远程→ 本地(最大10MB)自动创建目录、保留权限、验证完整性
terminal_new_session创建隔离会话并行操作,独立环境
terminal_list_sessions查看所有活动会话状态、正常运行时间、最后一个命令
terminal_close_session清理会话完成后释放资源
terminal_get_buffer调试原始输出有助于故障排除

💡 提示: AI会根据您的自然语言请求自动处理这些请求!

______________________________________________________________________

🔒 安全最佳实践

✅ 做:

  • 使用SSH密钥身份验证(不是密码): ssh-keygen -t ed25519
  • 跳过堡垒主机进行生产: ssh -J bastion.com user@prod
  • 限制文件上传目的地(避免 /etc, /root, .ssh/)
  • 使用只读帐户进行调查
  • 任务结束后的清理会议
  • 审核所有AI操作

❌ 不要:

  • 将密码存储在命令或配置中
  • 将不受信任的文件上传到生产环境
  • 下载不加密的敏感数据
  • 运行破坏性命令而不进行验证
  • 授予不必要的权限

______________________________________________________________________

🛠️ 运作原理

持续会话:

  • 使用PTY(伪终端)进行具有状态持久性的完整TTY仿真
  • 智能标记自动检测命令完成情况
  • 捕获退出代码以进行错误检测
  • 输出解析干净(无ANSI代码)

文件传输:

  • 通过现有SSH会话进行Base64编码(无单独的SCP/SFTP)
  • 通过跳转主机工作,无需重新身份验证
  • 最大10MB,5分钟超时(如果更快,则提前完成)

______________________________________________________________________

🐛 故障排除

Commands timeout or hang

// Increase timeout for long-running commands
terminal_execute({
  command: "npm install",
  timeout: 120000  // 2 minutes
})

// Check if SSH keys are set up correctly
ssh -v user@server

SSH asks for password

# Set up passwordless authentication
ssh-keygen -t ed25519
ssh-copy-id user@server

# Verify
ssh user@server "echo Success"

File upload fails

// Check if in SSH session first
terminal_execute({ command: "pwd" })  // Verify you're on remote server

// Ensure remote directory exists
terminal_execute({ command: "mkdir -p /app/uploads" })

// Then upload
terminal_upload({ local_path: "file.txt", remote_path: "/app/uploads/file.txt" })

File download fails

// Verify remote file exists
terminal_execute({ command: "ls -lh /path/to/file" })

// Check permissions
terminal_execute({ command: "cat /path/to/file | wc -l" })

// Try download with absolute path
terminal_download({ remote_path: "/full/path/to/file", local_path: "./" })

Session becomes unresponsive

// List all sessions
terminal_list_sessions()

// Close problematic session
terminal_close_session({ session_id: "stuck-session" })

// Create fresh session
terminal_new_session({ session_id: "new-session" })

______________________________________________________________________

🧪 发展

# Clone repository
git clone https://github.com/tranhuucanh/mcp-shellkeeper.git
cd mcp-shellkeeper

# Install dependencies
npm install

# Build
npm run build

# Test locally with stdio transport
node dist/index.js

# Test with MCP Inspector
npm run inspector

______________________________________________________________________

🤝 贡献

欢迎投稿!帮助更好地进行人工智能辅助服务器管理。

  1. 分叉存储库
  2. 创建特征分支(git checkout -b feature/amazing-feature)
  3. 提交更改(git commit -m 'Add amazing feature')
  4. 推送到分支(git push origin feature/amazing-feature)
  5. 打开拉取请求

______________________________________________________________________

📄 许可证

MIT许可证-请参阅 许可证 文件以获取详细信息。

你可以:

  • ✅ 商业用途
  • ✅ 修改
  • ✅ 分发
  • ✅ 私人使用

______________________________________________________________________

🙏 致谢

______________________________________________________________________

📞 支持

______________________________________________________________________

内置于❤️ 面向AI开发者社区

*有状态执行+文件传输=无限可能*

![Star History Chart](https://star-history.com/#tranhuucanh/mcp-shellkeeper&Date&t=89)

⬆ 返回页首

目录标签

目录标签

JavaScriptClaudeAI代理SSH管理本地部署文件传输AI助手工具服务器运维持久化会话

支持客户端

ClaudeCursorCline

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

session

部署方式(deploymentType,部署类型)

local-only

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明sessionlocal-only

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP