linux-ssh-mcp: Instructions file for Claude Code

CLAUDE.md

linux-ssh-mcp CLAUDE.md is an instructions file for Claude Code 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 for Claude Code

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

This is JINDEZHIDIYE/linux-ssh-mcp's own configuration. It tells Claude Code how to work on linux-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 linux-ssh-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to JINDEZHIDIYE/linux-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/JINDEZHIDIYE/linux-ssh-mcp/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/JINDEZHIDIYE/linux-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 linux-ssh-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/jindezhidiye/linux-ssh-mcp/claude-md/github.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/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 linux-ssh-mcp CLAUDE.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. 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.02305 $0.02305
Opus 5.5 $0.00922 $0.00922
Sonnet 5.5 $0.00461 $0.00461
Haiku 4.5 $0.00231 $0.00231

Measured 2mo ago against content hash 940e10ae6119, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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.py → mcp_server_v2.py:WindTermMCPServer → simple_terminal_manager.py:SimpleTerminalSessionManager → 直接调用 asyncssh.run() 执行命令并收集输出。 不走真正的 PTY、不做 ANSI 协议解析。 "终端"行为是把每条命令的 stdin/输出拼进一个字符串缓冲区。生产中 AI 助手调用的就是这条链路。

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

实际影响: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. 2mo 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 3mo ago), licensed MIT. It adds 2,305 tokens to every session, about $0.0092 per session on Opus 5.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

linux-ssh-mcp CLAUDE.md compared with instructions from other repositories

linux-ssh-mcp CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
linux-ssh-mcp CLAUDE.mdJINDEZHIDIYE/linux-ssh-mcpInstructions file03mo agoMITA2,305Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA8,130Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150ktodayMITA4,680Codex, OpenCode
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file283kyesterdayMITA4,342Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA3,153GitHub Copilot