经 AI Skill Hub 精选评估,Python SSH MCP 获评「推荐使用」。这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。
Python SSH MCP 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
Python SSH MCP 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/Nightreaver/python-ssh-mcp
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"python-ssh-mcp": {
"command": "npx",
"args": ["-y", "python-ssh-mcp"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 Python SSH MCP 执行以下任务... Claude: [自动调用 Python SSH MCP MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"python_ssh_mcp": {
"command": "npx",
"args": ["-y", "python-ssh-mcp"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
An SSH MCP server built in Python on top of FastMCP. The goal: give an LLM real SSH access to many hosts while keeping fine-grained control over what it can and can't do. The configuration surface is deliberately broad — probably overkill if you just want a single ssh_exec tool, but it pays off once you start connecting more than one host or locking the agent down to specific paths, commands, and visibility tiers. If a tool you need isn't here, open an issue.
Currently implemented: 70 tools across 10 groups, 968 passing unit tests + 6 dockerized-sshd integration tests + an opt-in tests/e2e/ suite that drives every tool against the operator's real hosts.toml. Strict known_hosts by default, path-allowlist confinement on every path-bearing tool, SHA-256-hashed audit log, operator-pluggable hooks. Most tools return typed Pydantic results so MCP clients see real schemas in tools/list (not generic object); the few that legitimately produce merged or bimodal payloads stay as dict[str, Any] with the rationale documented at the function. POSIX SSH targets supported end-to-end; Windows SSH targets supported for SFTP + file-ops + ssh_file_hash via PowerShell -EncodedCommand (see ADR-0023); Docker CLI swappable for Podman via SSH_DOCKER_CMD / per-host docker_cmd.
read / low-access / dangerous / sudo. Each tier is toggled with its own env flag and enforced via FastMCP Visibility transforms. Default: read-only.host, session, sftp-read, file-ops, exec, sudo, shell, docker, systemctl, pkg). SSH_ENABLED_GROUPS trims the catalog to what a given assistant actually needs.ssh_apt_list, ssh_apt_search, ssh_apt_show) — Debian/Ubuntu package inspection; non-Debian hosts get a clean PlatformNotSupportedknown_hosts — no auto-accept; unknown or mismatched keys fail closed.realpath (or SFTP realpath on Windows) and checks the allowlist, with restricted_paths carve-outs for sensitive zones.hosts.toml — users, keys, allowlists, sudo mode, platform, proxy chains, alert thresholds, persistent-session opt-out.PlatformNotSupported that names the missing capability.error field is exception class only (full text stays at DEBUG locally).SSH_HOOKS_MODULE for STARTUP / SHUTDOWN / PRE_TOOL_CALL / POST_TOOL_CALL events. Bounded per-hook timeout, exception isolation, backlog warning when pending tasks pile up.SKILL.md files give the LLM scoped how-to docs on demand.tools/list with search_tools + call_tool once 50+ schemas start eating context.Python SSH MCP is a standard PEP 621 Python package (hatchling build backend). Use whichever installer you prefer — uv is the recommended path:
```bash uv sync # create .venv + install runtime deps + dev extras uv run ssh-mcp # start the server on stdio
uvx --from . ssh-mcp
pip install -e ".[dev]" ssh-mcp
fastmcp dev inspector # dev UI: MCP Inspector + hot reload; auto-finds fastmcp.json fastmcp run # run the server; auto-finds fastmcp.json fastmcp run -t http -p 8000 # HTTP transport instead of stdio ```
Optional dependency groups:
.[tasks] — adds the Redis client (redis>=5.0.0) for a production task backend. The FastMCP tasks runtime itself (docket, in-memory by default) is a hard dep via fastmcp[tasks] and ships regardless — install this extra only when pointing FASTMCP_DOCKET_URL at a real Redis (task-loss on restart matters in prod with ALLOW_DANGEROUS_TOOLS=true; see _warn_task_backend)..[telemetry] — OpenTelemetry distro + OTLP exporter..[dev] — pytest, ruff, mypy.MCP clients (Claude Desktop, Claude Code, Cursor) discover the server via fastmcp.json.
Every major MCP client accepts a JSON snippet that tells it how to spawn the server. The shape is standardized around an mcpServers object — only the file path differs per client. Pick your client, paste the snippet into the right file, restart the client so the subprocess is respawned.
Heads-up:fastmcp.json'sdeployment.envblock (if you keep one in the project) overrides the client env unconditionally — keep tier flags out of that block and let them come from the client config or your.env. If the client appears to hold a stale subprocess after code changes, see Troubleshooting — most clients spawn and own the server subprocess, so a terminal-side restart is not enough.
The base snippet (used by Claude Desktop, Cursor, Windsurf, Kilocode — most clients speak this dialect):
{
"mcpServers": {
"ssh-mcp": {
"command": "uvx",
"args": ["--from", "git+https://github.com/Nightreaver/python-ssh-mcp", "ssh-mcp"],
"env": {
"LOG_LEVEL": "INFO",
"ALLOW_LOW_ACCESS_TOOLS": "false",
"ALLOW_DANGEROUS_TOOLS": "false",
"ALLOW_SUDO": "false"
}
}
}
}
uvx --from <path> ssh-mcp builds and runs the server in an ephemeral uv-managed environment; no persistent venv needed on the client side. Alternative: replace with "command": "fastmcp", `"args": ["run", "<path-to-clone>/fastmcp.json"]` if you already have a venv with fastmcp on PATH.
Flip the ALLOW_* flags as you grant capability to the assistant. Keep read-only as the default and open the exec/sudo tiers only where you need them.
hosts.toml entry (Walkthrough §3)ssh_host_ping against your target — verifies agent + known_hosts + pool end-to-endALLOW_LOW_ACCESS_TOOLS, ALLOW_DANGEROUS_TOOLS, ALLOW_SUDO) and the LLM unlocks file ops, exec, sudo — see CONFIGURATION.md → Access tiersCONFIGURATION.md — configuring more hosts, access tiers, allowlist/blocklist, tool groups, Docker/Podman, per-host SSH identity, known_hosts management, sudo. ADVANCED.md — runbooks (FastMCP Skills), hooks, observability, testing, key rotation, architecture, contributing.
Compare that `SHA256:...` against a source you trust that is not the network you just scanned over: the host's provisioner output, a console session, a terraform output, the sysadmin's Signal message. **If they don't match, stop.** A typo or MITM would pin a hostile key as trusted.
bash
```bash
SSH_HOSTS_BLOCKLIST= ```
VS Code's MCP support (1.102+) uses a slightly different key. Config file:
<workspace>/.vscode/mcp.jsonsettings.json → "mcp.servers"Workspace .vscode/mcp.json:
{
"servers": {
"ssh-mcp": {
"type": "stdio",
"command": "uvx",
"args": ["--from", "git+https://github.com/Nightreaver/python-ssh-mcp", "ssh-mcp"],
"env": {
"LOG_LEVEL": "INFO",
"ALLOW_LOW_ACCESS_TOOLS": "false",
"ALLOW_DANGEROUS_TOOLS": "false",
"ALLOW_SUDO": "false"
}
}
}
}
Note the top-level key is servers (not mcpServers) and each entry carries a "type": "stdio" discriminator. Reload the VS Code window (Developer: Reload Window) to respawn.
ssh-keygen -lf /tmp/web01.hostkey
高质量的MCP工具,易于使用
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
⚠️ GPL 3.0 — 强 Copyleft,衍生作品须开源,含专利保护条款,不可闭源使用。
AI Skill Hub 点评:Python SSH MCP 的核心功能完整,质量良好。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | python-ssh-mcp |
| 原始描述 | 开源MCP工具:A SSH MCP Server using FastMCP. Its builds on a sophisticated tools and permissi。⭐5 · Python |
| Topics | sshmcpfastmcp |
| GitHub | https://github.com/Nightreaver/python-ssh-mcp |
| License | GPL-3.0 |
| 语言 | Python |
收录时间:2026-05-28 · 更新时间:2026-05-30 · License:GPL-3.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端