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/jindezhidiye/linux-ssh-mcp/claude-mdgit clone --depth 1 https://github.com/JINDEZHIDIYE/linux-ssh-mcpWrote 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.
[](https://agentmods.dev/instructions/jindezhidiye/linux-ssh-mcp/claude-md)<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>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.
| Model | Per session | Once 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 |
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.
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/。
⚠️ 架构关键:两套并行的会话栈(必读)
代码库里有两套并行的终端实现,改代码前必须先确认你要动的是哪一条链路:
-
"Simple" 直连栈(MCP 服务器实际运行的路径)
cli_v2.py→mcp_server_v2.py:WindTermMCPServer→simple_terminal_manager.py:SimpleTerminalSessionManager→ 直接调用asyncssh.run()执行命令并收集输出。 不走真正的 PTY、不做 ANSI 协议解析。 "终端"行为是把每条命令的 stdin/输出拼进一个字符串缓冲区。生产中 AI 助手调用的就是这条链路。 -
"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/
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.
- 4d ago First seen · 132 lines · 2,305 tokens per session scan A 940e10ae6119
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.
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.
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.
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).
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.
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.
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).