sshcode-mcp AGENTS.md

A project instruction file for sshcode-mcp, a tool that lets an AI work on a remote computer over SSH, the secure protocol commonly used to access servers.

In plain words
What is it for?
Use it to start sshcode-mcp, configure connection settings, run commands, read or edit remote files, search directories, and manage remote paths.
Why use it?
It documents how to connect with a password or SSH key and what remote file, directory, command, and system operations are available.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/guanhxuan/sshcode-mcp/agents-md
Clone the repo
git clone --depth 1 https://github.com/guanhxuan/sshcode-mcp

Made for: Codex, OpenCode.

Per session 539 This file is loaded in full into every session.
When invoked 539 The same file — it is already loaded in full.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00539 $0.00539
Opus 5 $0.00269 $0.00269
Sonnet 5 $0.00108 $0.00108
Haiku 4.5 $0.00054 $0.00054

Measured 2d ago against content hash 0d833f7384be, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

sshcode-mcp AGENTS.md scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

node bin/sshcode.js [email protected] -i ~/.ssh/id_rsa
AGENTS.md · 58 lines

What it actually says

sshcode-mcp

SSH Remote AI Development Tool - 通过 SSH 让 AI 在远程计算机上进行开发操作。

快速启动

# 密码认证
node bin/sshcode.js [email protected] -P 123

# 密钥认证
node bin/sshcode.js [email protected] -i ~/.ssh/id_rsa

# 自定义端口
node bin/sshcode.js [email protected] -p 2222 -P 123

MCP 工具列表

工具名 说明
execute_command 在远程服务器执行 shell 命令
read_file 读取远程文件内容
write_file 写入/覆盖远程文件
edit_file 编辑远程文件指定行(按行号)
list_directory 列出远程目录内容
create_directory 创建远程目录
delete_path 删除远程文件/目录
rename_path 重命名/移动远程文件/目录
file_stat 获取远程文件元数据
search_files 在远程服务器搜索文件(glob 模式)
get_system_info 获取远程系统信息
get_pool_stats 获取连接池/缓存统计

性能优化

  • 连接池: 复用 SSH 连接 (最多 5 个),避免重复握手
  • 文件缓存: LRU 缓存 (最多 50 个文件,TTL 60s)
  • 命令超时: 默认 30s,防止长时间卡住
  • 并发控制: 最多 10 个并发命令
  • 输出截断: 超过 10MB 自动截断
  • SFTP 复用: 在同一连接内复用 SFTP 通道
  • ssh 压缩: 强制开启压缩减少带宽

配置

node bin/sshcode.js config
node bin/sshcode.js config set pool.maxSize 10
node bin/sshcode.js config set command.defaultTimeout 60000

架构

AI (MCP Client) <-> stdio JSON-RPC <-> sshcode-mcp <-> SSH <-> Remote Server
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 58 lines · 539 tokens per session scan C 0d833f7384be

Subscribe to this mod's changes

sshcode-mcp AGENTS.md is an instructions file published in the GitHub repository guanhxuan/sshcode-mcp (1 stars, last pushed 1mo ago), licensed MIT. It adds 539 tokens to every session, about $0.0027 per session on Opus 5. A static security scan graded it C with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.