linux-ssh-mcp CLAUDE.md

linux-ssh-mcp CLAUDE.md is an instructions file for coding agents from JINDEZHIDIYE/linux-ssh-mcp. It costs 2,305 tokens per session, scanned A, original, MIT.

Repository instructions for linux-ssh-mcp, a Python package that lets an AI assistant manage SSH connections, which are remote terminal sessions, through MCP, a standard way for AI tools to call external services. They document two separate terminal implementations and which one the MCP server actually uses.

In plain words
What is it for?
Use them when developing, running, testing, or debugging the project's SSH sessions, terminal managers, MCP server, and command-line tools.
Why use it?
They warn developers that the documented full terminal behavior is not the same as the behavior exposed through MCP, helping them change the correct code path.

Instructions file

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/jindezhidiye/linux-ssh-mcp/claude-md
Clone the repo
git clone --depth 1 https://github.com/JINDEZHIDIYE/linux-ssh-mcp

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 linux-ssh-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/jindezhidiye/linux-ssh-mcp/claude-md.svg)](https://agentmods.dev/instructions/jindezhidiye/linux-ssh-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/jindezhidiye/linux-ssh-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/jindezhidiye/linux-ssh-mcp/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,305 This file is loaded in full into every session.
When invoked 2,305 The same file — it is already loaded in full.
Security scan A 0 findings. 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.02305 $0.02305
Opus 5 $0.01153 $0.01153
Sonnet 5 $0.00461 $0.00461
Haiku 4.5 $0.00231 $0.00231

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

Security

Grade A, and why

linux-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 4d 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 · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 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.

项目概述

WindTerm 风格的终端模拟器,通过 Model Context Protocol (MCP) 与 AI 助手集成。提供多标签页 SSH 会话管理、交互式终端、会话持久化和脚本自动化。打包为 PyPI 包 linux-ssh-mcp(v2.0.0),入口在 src/linux_ssh_mcp/

⚠️ 架构关键:两套并行的会话栈(必读)

代码库里有两套并行的终端实现,改代码前必须先确认你要动的是哪一条链路:

  1. "Simple" 直连栈(MCP 服务器实际运行的路径) cli_v2.pymcp_server_v2.py:WindTermMCPServersimple_terminal_manager.py:SimpleTerminalSessionManager → 直接调用 asyncssh.run() 执行命令并收集输出。 不走真正的 PTY、不做 ANSI 协议解析。 "终端"行为是把每条命令的 stdin/输出拼进一个字符串缓冲区。生产中 AI 助手调用的就是这条链路。

  2. "Full" PTY 栈(功能更完整,但只被 test 命令使用,未接入 MCP 服务器) terminal_session_manager.py:TerminalSessionManagerterminal_emulator.pyPTYManager / TerminalProtocolHandler,真正的 PTY + ANSI/VT100/xterm-256color 协议处理)+ ssh_manager_v2.py:EnhancedSSHManager(连接池 + connection.create_process() 终端进程)。 cli_v2.pytest 子命令用的就是这条链路。

实际影响:MCP 工具暴露的能力 ≠ 文档里描述的"PTY 模拟/实时流"能力。 修 MCP 行为要改 simple_terminal_manager.py + mcp_server_v2.py;要让 MCP 用上真 PTY,需要在 WindTermMCPServer 里把 session_manager 从 SimpleTerminalSessionManager 换成 TerminalSessionManager(两者 API 不完全一致,需要适配)。

另有 simple_mcp_server.py:SimpleWindTermMCPServer(与 WindTermMCPServer 平行的另一套简化服务器,未注册为入口)和项目根的 start_mcp_server.py(启动包装脚本,固定 SSH_MCP_CONFIG_PATH 后调用 mcp_server_v2.main)——属于历史/备用代码。

常用命令

开发运行

# 启动 MCP 服务器(stdio,供 Claude Code 连接)
linux-ssh-mcp server
# 或:python -m linux_ssh_mcp.cli_v2 server
# 或:python -m linux_ssh_mcp.mcp_server_v2   (直接跑服务器,不经 CLI 包装)

# 启用调试日志
linux-ssh-mcp server --debug

# 检查配置文件并列出已配置服务器
linux-ssh-mcp check

# 创建示例配置到 ~/.ssh-mcp/servers.json
linux-ssh-mcp init

# 测试终端连接(注意:这条走的是 Full PTY 栈,不是 MCP 的 Simple 栈)
linux-ssh-mcp test localhost username
linux-ssh-mcp test 192.168.1.100 admin --password your_password --port 22

接入 Claude Code

claude mcp add linux-ssh-mcp python -m linux_ssh_mcp.cli_v2

测试与代码质量

# 全量测试(pyproject 已配置 asyncio_mode=auto、strict markers、testpaths=tests)
python -m pytest tests/

# 跑单个测试类 / 单个用例(命名见 tests/test_*.py,类名 Test*,方法 test_*)
python -m pytest tests/test_session_manager.py -v
python -m pytest tests/test_session_manager.py::TestTerminalSessionManager::test_xxx -v
python -m pytest tests/test_terminal_emulator.py -v

# 覆盖率(pyproject [tool.coverage] 已配置 source=src)
python -m pytest tests/ --cov=src/linux_ssh_mcp

black src/ tests/        # 行宽 88,pyproject 已配
mypy src/                # 严格模式,python_version=3.9
flake8 src/

Read the full file on GitHub · 132 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. 4d ago First seen · 132 lines · 2,305 tokens per session scan A 940e10ae6119

Subscribe to this mod's changes

linux-ssh-mcp CLAUDE.md is an instructions file published in the GitHub repository JINDEZHIDIYE/linux-ssh-mcp (0 stars, last pushed 21d ago), licensed MIT. It adds 2,305 tokens to every session, about $0.0115 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

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens