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.
npx agentmods add instructions/guanhxuan/sshcode-mcp/agents-mdgit clone --depth 1 https://github.com/guanhxuan/sshcode-mcpWhat 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.
| Model | Per session | Once 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 |
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 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
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.
- 2d ago First seen · 58 lines · 539 tokens per session scan C 0d833f7384be
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.
Other instructions, from other repositories
Log-Analyzer-with-MCP AGENTS.md
Instructions for awslabs/Log-Analyzer-with-MCP, covering agents.md, project overview, build & development commands, installation and running the server (local development).
apex-accelerator iac-bicep-best-practices.instructions.md
Bicep-specific IaC best practices for Azure templates. Security baseline, naming, AVM mandate, anti-patterns.
awsmux AGENTS.md
Instructions for 0hardik1/awsmux, covering agents.md, what awsmux is, build, test, verify, layout and the safety model — invariants you must not weaken.
terraform-provider-pipefy AGENTS.md
Instructions for pipefy/terraform-provider-pipefy, covering agents.md, project overview, setup and requirements, essential commands and project layout.
plan-forge azd.instructions.md
Azure Developer CLI (azd) patterns — azure.yaml structure, infra folder, tags, hooks, pipelines.
plan-forge terraform.instructions.md
Terraform Azure patterns — file structure, providers, state, naming, security, testing.