ssh-mcp: Instructions file for Codex

AGENTS.md

ssh-mcp AGENTS.md is an instructions file for Codex, OpenCode from gelse/ssh-mcp. It costs 3,377 tokens per session, scanned B, original, MIT.

A development guide for mcp-ssh, a server that lets approved tools run SSH commands and transfer files over SFTP. It documents the project structure, security model, testing, deployment, and conventions for adding tools.

In plain words
What is it for?
Use it when developing mcp-ssh, including adding SSH or SFTP tools, changing its Python server, testing it, or preparing deployments.
Why use it?
It gives coding agents a shared set of rules for changing and testing the SSH server without overlooking authorization, deployment, or file-touch requirements.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is gelse/ssh-mcp's own configuration. It tells Codex and OpenCode how to work on ssh-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ssh-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to gelse/ssh-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/gelse/ssh-mcp/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/gelse/ssh-mcp

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ssh-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/gelse/ssh-mcp/agents-md/github.svg)](https://agentmods.dev/instructions/gelse/ssh-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/gelse/ssh-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/gelse/ssh-mcp/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ssh-mcp AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/gelse/ssh-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/gelse/ssh-mcp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,377 This file is loaded in full into every session.
When invoked 3,377 The same file — it is already loaded in full.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.03377 $0.03377
Opus 5.5 $0.01351 $0.01351
Sonnet 5.5 $0.00675 $0.00675
Haiku 4.5 $0.00338 $0.00338

Measured 1mo ago against content hash d903efaf019b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

ssh-mcp AGENTS.md scanned grade B with 2 findings 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 1mo 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

│ ├── sudo.py # SudoHandler — validate, wrap sudo command, password injection

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Health: `wget --spider http://localhost:8080/health`
AGENTS.md · 222 lines

How it starts

The opening of the file, as written. The whole thing — 222 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md — AI Development Guide for mcp-ssh

Contents:

Project Overview

mcp-ssh is a Model Context Protocol server exposing SSH command execution and SFTP file transfer as MCP tools. Runs as Docker behind Traefik, speaking streamable HTTP on port 8080 at /mcp.

Stack: Python 3.13, FastMCP 3.4.x, paramiko 5.0, Starlette 1.4, Prometheus client, watchdog

Six tools: ssh_list_servers, ssh_list_allowed_commands, ssh_execute_command, ssh_check_connection, ssh_download_file, ssh_upload_file — see README.md.

Key patterns: App-factory (create_app(), zero I/O at import), closure DI for tools, thread-pool for SSH I/O, per-target connection pooling, layered auth chain, config hot-reload (15 s poll / 2 s debounce), circuit breaker + exponential-backoff, sliding-window rate limiter, JSONL logging with rotation/gzip.

Project Layout

mcp-ssh/
├── server.py                  # FastMCP app factory + CLI entry point
├── lib/                       # 25 modules (plus __init__.py re-exports)
│   ├── auth.py                # AuthorizationManager, layered allow-list chain
│   ├── circuit_breaker.py     # Per-target failure threshold + recovery timeout
│   ├── command_security.py    # Command segmentation, dangerous-pattern detection, redirector stripping
│   ├── config.py              # ConfigManager — JSON load/validate/hot-reload
│   ├── config_migration.py    # Config schema migration (v1→v2)
│   ├── config_watcher.py      # Filesystem watcher (polling or watchdog)
│   ├── connection_pool.py     # Per-target SSH connection pooling
│   ├── constants.py           # ALL magic numbers, strings, defaults (single source of truth)
│   ├── crypto.py              # PBKDF2-HMAC-SHA256 API-key hashing + constant-time verify
│   ├── exceptions.py          # MCPSSHError hierarchy
│   ├── file_transfer.py       # SFTP download/upload with 7-layer path validation
│   ├── health.py              # GET /health endpoint
│   ├── log_handler.py         # JSONLHandler — stdlib logging → FileLogger bridge
│   ├── loggers.py             # FileLogger (JSONL rotation/truncation/gzip)
│   ├── metrics.py             # Prometheus metrics + GET /metrics endpoint
│   ├── rate_limiter.py        # Sliding-window per-IP rate limiter
│   ├── redos_protection.py    # Safe regex compilation and ReDoS-resistant matching
│   ├── request_context.py     # Starlette middleware: request_id, client IP, API key
│   ├── sanitize.py            # Input sanitization helpers
│   ├── secrets.py             # SecretsManager for secrets.json + env var merging
│   ├── size_utils.py          # parse_size_bytes() for size-string settings
│   ├── ssh_client.py          # SSHClientManager — connect, retry, circuit-break, pool
│   ├── ssh_operations.py      # Standalone SSH functions (check, connect, execute)
│   ├── sudo.py                # SudoHandler — validate, wrap sudo command, password injection
│   └── types.py               # TypedDict models for tool results
├── config-api/                 # Config API + Web Dashboard (GUI)
│   ├── config_api/app.py, auth.py, config_service.py, models.py, routes.py
│   └── config_api/ui/index.html  # SPA dashboard (Tailwind CSS)
├── tests/
│   ├── test_*.py              # 29 unit-test files
│   └── integration/test_mcp_ssh_integration.py  # Real Docker containers
├── docs/SECURITY.md           # Full security model
├── Dockerfile, compose.yaml, Makefile
├── requirements{,-build,-dev}.{in,txt}
├── default-config.json, config.schema.json
└── README.md

Read the full file on GitHub · 222 lines

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. 1mo ago Changed · +4 lines · +83 tokens per session d903efaf019b
  2. 2mo ago Changed · +1 lines · +29 tokens per session 22fbf642d13d
  3. 2mo ago First seen · 217 lines · 3,265 tokens per session scan B 00cb4ba5f07e

Subscribe to this mod's changes

ssh-mcp AGENTS.md is an instructions file published in the GitHub repository gelse/ssh-mcp (8 stars, last pushed 1mo ago), licensed MIT. It adds 3,377 tokens to every session, about $0.0135 per session on Opus 5.5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

ssh-mcp AGENTS.md compared with instructions from other repositories

ssh-mcp AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ssh-mcp AGENTS.mdgelse/ssh-mcpInstructions file81mo agoMITB3,377Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode