putty-mcp

putty-mcp

Exposes the full PuTTY suite (SSH, SCP, SFTP, serial, key management) as 30 MCP tools for AI assistants, enabling persistent interactive sessions, file transfers, and Windows registry integration.

Category
Visit Server

README

PuTTY MCP Server

The full PuTTY toolchain exposed as a Model Context Protocol (MCP) server. Gives AI assistants like Claude complete access to SSH, SCP, SFTP, serial, key management, and more — all through PuTTY's battle-tested Windows tools.

30 tools across 8 categories. Windows-native. Covers every PuTTY executable.

What Makes This Different

Most SSH MCP servers give you basic ssh and scp wrappers. This one wraps the entire PuTTY suite with features you won't find elsewhere:

  • Persistent interactive sessions — Open a shell, send commands, read output over multiple turns. Background reader threads keep output flowing.
  • Native PPK v3 key conversion — Converts OpenSSH keys to PuTTY's PPK format in pure Python. No GUI puttygen needed.
  • Windows Registry integration — Full CRUD for PuTTY saved sessions. Create, read, update, delete sessions programmatically.
  • Multi-hop SSH — Chain through jump hosts with automatically constructed proxy commands.
  • Serial port support — Open PuTTY on COM ports with configurable baud, parity, stop bits.
  • Pageant integration — Load keys into PuTTY's SSH agent.

Covered Executables

Executable Purpose
putty.exe GUI terminal sessions (SSH, Telnet, serial, raw)
plink Command-line SSH/Telnet/serial execution
pscp SCP/SFTP file transfer
psftp Interactive SFTP sessions
pageant SSH key agent
puttygen Key generation (via ssh-keygen + native PPK converter)

Quick Start

Prerequisites

  • Python 3.10+
  • PuTTY installed (all tools)
  • Windows (PuTTY is Windows-native; registry tools require Windows)

Install

git clone https://github.com/wgthomas/putty-mcp.git
cd putty-mcp
pip install -r requirements.txt

Configure Claude Code / Claude Desktop

Add to your MCP config (~/.claude.json or Claude Desktop settings):

{
  "mcpServers": {
    "putty": {
      "command": "python",
      "args": ["/path/to/putty-mcp/putty_mcp.py"],
      "env": {}
    }
  }
}

PuTTY executables are auto-detected from C:\Program Files\PuTTY, PATH, or PUTTY_PATH env var.

Tools (30)

GUI Launch (3)

Tool Description
putty_open Launch PuTTY with full connection parameters
putty_open_session Launch PuTTY from a saved session name
putty_serial Launch PuTTY on a serial port

Command Execution (3)

Tool Description
plink_exec Run a single command on a remote host via plink
plink_script Run commands from a local script file via plink
plink_tunnel Create SSH tunnel (port forward) or -nc connection

Persistent Sessions (5)

Tool Description
session_open Open persistent interactive session (SSH/Telnet/serial/raw)
session_send Send command to a session and return new output
session_read Read output buffer from a session
session_list List all active sessions
session_close Close a session and clean up

File Transfer (5)

Tool Description
pscp_upload Upload file(s) to remote host via pscp
pscp_download Download file(s) from remote host via pscp
pscp_list List remote directory via pscp
psftp_batch Execute SFTP commands as a batch via psftp
psftp_interactive Open persistent PSFTP session for multi-step workflows

Key Management (6)

Tool Description
keygen_create Generate SSH key pair (OpenSSH + PPK format)
keygen_fingerprint Get fingerprint of an existing key
keygen_convert Convert key to different format (RFC4716, PKCS8, PEM, PPK)
keygen_public_key Extract public key in authorized_keys format
pageant_add Load key(s) into Pageant
pageant_list List keys loaded in Pageant

Saved Sessions — Registry (4)

Tool Description
saved_sessions_list List all PuTTY saved sessions
saved_session_get Get full config of a saved session
saved_session_create Create or update a saved session
saved_session_delete Delete a saved session

Utility (2)

Tool Description
test_connection Test SSH/Telnet connectivity, returns host key
get_host_key Get SSH host key fingerprint from a server

Multi-Hop (2)

Tool Description
proxy_session Open interactive session through a proxy command
chain_exec Execute command on target through one or more jump hosts

Configuration

Copy config.template.toml to config.toml and adjust as needed:

Setting Default Description
putty.executable_path Auto-detected Path to PuTTY install directory
putty.enable_registry true Enable Windows Registry session tools
defaults.protocol ssh Default connection protocol
defaults.port 22 Default port
sessions.max_concurrent 10 Max simultaneous interactive sessions
sessions.timeout_seconds 3600 Session idle timeout
sessions.buffer_lines 1000 Output buffer size per session
serial.* Standard Default serial parameters (9600/8/N/1)

Architecture

putty_mcp.py              # FastMCP server, all 30 tool definitions
putty_lib/
  config.py               # Path resolution, TOML config loading
  executor.py             # Subprocess wrapper (run, spawn, launch_gui)
  session_manager.py      # Persistent sessions with background readers
  registry.py             # Windows Registry CRUD for saved sessions
  utils.py                # Arg building, host parsing, proxy chains
  ppk.py                  # Native Python PPK v3 writer

Key Design Decisions

  • No shell=True — All subprocess calls use argument lists
  • ssh-keygen over puttygen — Windows puttygen.exe is GUI-only with no batch CLI. All key generation uses Windows OpenSSH's ssh-keygen, then auto-converts to PPK.
  • Native PPK conversionputty_lib/ppk.py writes PPK v3 format from scratch in Python. Supports Ed25519, RSA, ECDSA. No GUI dependency.
  • Thread-safe sessions — Background reader threads with bounded deque buffers and automatic cleanup of timed-out sessions.

Known Limitations

  • Pageant key listing: Pageant has no reliable CLI flag to list loaded keys as text. The tool tries ssh-add -L first (requires Pageant started with --openssh-config), falls back to opening the GUI key list window.
  • PPK converter: Handles unencrypted keys only. Passphrase-protected keys need manual puttygen GUI conversion.
  • Persistent sessions: Return raw ANSI escape codes from remote shells. Functional but noisy.
  • Windows only: PuTTY is Windows-native. The registry tools require Windows. Core SSH functionality works anywhere plink is available.

Security

  • No shell=True — All commands use subprocess with argument lists
  • No credential storage — Keys and passwords are passed per-call, never persisted by the server
  • Registry scoped — Only reads/writes PuTTY's own registry keys under HKCU\Software\SimonTatham\PuTTY

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured