ssh-mcp: Instructions file for Claude Code

CLAUDE.md

ssh-mcp CLAUDE.md is an instructions file for Claude Code from ifindv/ssh-mcp. It costs 711 tokens per session, scanned A, original, MIT.

Instructions for developing and running an MCP server that provides SSH access. SSH is a way to securely run commands and transfer files on another computer.

In plain words
What is it for?
Use it to run remote commands, transfer files, and list directories through an MCP server. It also covers formatting, type checking, and testing with MCP Inspector, a tool for examining MCP servers.
Why use it?
It puts installation, configuration, testing, and code-style guidance in one place. This reduces guesswork when connecting Claude Code to the server or checking changes.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is ifindv/ssh-mcp's own configuration. It tells Claude Code 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 ifindv/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/ifindv/ssh-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/ifindv/ssh-mcp

Made for: Claude Code.

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 CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ifindv/ssh-mcp/claude-md.svg)](https://agentmods.dev/instructions/ifindv/ssh-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/ifindv/ssh-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/ifindv/ssh-mcp/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 711 This file is loaded in full into every session.
When invoked 711 The same file — it is already loaded in full.
Security scan A 0 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.00711 $0.00711
Opus 5 $0.00356 $0.00356
Sonnet 5 $0.00142 $0.00142
Haiku 4.5 $0.00071 $0.00071

Measured 6d ago against content hash 3aa3406bd74c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

ssh-mcp CLAUDE.md scanned grade A with 0 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 6d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 99 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Common Commands

Installation

pip install ssh-mcp-new

Running the server

ssh-mcp

Config in claude code

tips: you can also add python scripts to your path env, it's all up to you.

  "mcpServers": {
    "ssh-mcp": {
      "command": "C:\\Users\\DELL\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python311\\Scripts\\ssh-mcp.exe",
      "args": [],
      "env": {}
    }
  },

Testing with MCP Inspector

npx @modelcontextprotocol/inspector python -m ssh_mcp

Code style

black ssh_mcp/  # Format code
mypy ssh_mcp/   # Type checking

Architecture

This is a single-file MCP server that provides SSH functionality (command execution, file transfer, directory listing) via the FastMCP framework.

Core Patterns

FastMCP Tool Registration: All SSH operations are exposed as MCP tools using @mcp.tool() decorator. Each tool:

  • Defines a Pydantic input model for validation
  • Returns string-formatted responses (JSON or markdown)
  • Uses async functions (though paramiko calls are blocking)

Session Management: SSH connections are stored in a module-level dictionary _ssh_connections keyed by session_id. Sessions persist as long as the server runs.

Input Validation: Each tool has a dedicated Pydantic model (e.g., ConnectInput, ExecuteInput) with:

  • Field validators (e.g., _validate_command prevents injection)
  • Config with extra='forbid' to reject unknown parameters
  • Type annotations for all fields

Response Formatting: Two output formats are supported:

  • markdown - human-readable with formatting
  • json - machine-readable structured data

Error Handling: _handle_ssh_error() normalizes paramiko exceptions into user-friendly messages covering auth failures, connection issues, timeouts, etc.

Read the full file on GitHub · 99 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. 6d ago First seen · 99 lines · 711 tokens per session scan A 3aa3406bd74c

Subscribe to this mod's changes

ssh-mcp CLAUDE.md is an instructions file published in the GitHub repository ifindv/ssh-mcp (0 stars, last pushed 4mo ago), licensed MIT. It adds 711 tokens to every session, about $0.0036 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories