Xshell Agent Bridge logo

Xshell Agent Bridge

Bridges MCP agents to approved Xshell tabs for terminal access and guarded file transfers on Windows.

Install Xshell Agent Bridge

Run the project’s own setup commands, in order.

Setup steps from the project

xshell-agent-bridge installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Start the server
    node C:\绝对路径\src\mcp-stdio.mjs
    
  2. 2. Start the server
    npm run mcp       # 以 MCP stdio 方式启动
    

Overview

xshell-agent-bridge MCP server connects MCP clients to Xshell 8 tabs that the user has explicitly attached with its Python script. It exposes terminal inspection, confirmed input, interruption, output waiting, and guarded SFTP upload/download operations through a local stdio process. Xshell confirmation dialogs, credential isolation, idempotent requests, and destructive-command blocking keep Agent actions behind user approval. Reach for it when an AI agent needs to assist with server inspection, deployment, troubleshooting, or offline file transfer through an existing Windows Xshell session.

Use cases

  • Inspect an attached server terminal before deployment
  • Confirm and run routine troubleshooting commands
  • Monitor visible output from a long-running operation
  • Download a single server file through OpenSSH
  • Upload a local package without overwriting a remote file

Key features

  • Xshell 8 terminal screen reading
  • User-confirmed text and Ctrl+C input
  • Visible-output waiting
  • Guarded single-file SFTP transfers
  • Destructive-command and credential-pattern blocking
  • Serialized multi-agent writes per tab

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars14Stargazers on the source repository.
Last commit10d agoMost recent push to the default branch.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Xshell Agent Bridge works

What xshell-agent-bridge does

xshell-agent-bridge links MCP-compatible agents with selected Xshell 8 terminal tabs on Windows. An attached tab reports its visible text and session state through a local bridge, allowing an agent to inspect the current host and propose the next operation. The bridge can send exact text, Enter, or Ctrl+C only after the user approves the action in an Xshell dialog.

It also provides guarded single-file transfers. Downloads use Windows OpenSSH and place data in the local downloads/ directory; uploads take one file from that directory and create a new remote .part file. Transfers support confirmation steps, manual authentication, and SHA-256 verification where applicable.

How it works

The MCP entry point runs over stdio and starts a local Node.js daemon. The daemon and the Xshell Python script exchange requests and status through atomic JSON files under data/ipc/. Each Xshell tab that should be available to an agent must run xshell_agent_bridge.py separately.

Before terminal input is delivered, the script shows the target host, explanation, risk level, expected result, and complete text in a local confirmation window. Rejected requests are not sent. Write requests carry an idempotency key, while queued writes for a tab are serialized so multiple agents do not type concurrently.

For downloads, the user reviews a desktop transfer prompt, authenticates in a separate PowerShell/OpenSSH window, and reviews the completed temporary file before its final rename. Passwords and other credentials remain outside the MCP request and agent process.

Setup and configuration

Use Node.js 20 or newer, Xshell 8, and a Windows OpenSSH client. The project has no npm dependencies, so npm install is not needed. Start the bundled configuration for Codex, Claude Code, or another stdio-capable client, or launch the server directly with:

powershell
node C:\absolute\path\src\mcp-stdio.mjs

On first start, the bridge creates config/local.json with a machine-specific authentication token. Keep this file local and do not share it. Set XSHELL_AGENT_ID when audit records should distinguish one calling agent from another.

In each target Xshell tab, run xshell\xshell_agent_bridge.py from Xshell's Tools, Script, Run menu. The daemon must be running and at least one attached tab must be online before terminal operations can proceed. npm run demo:bridge can exercise the local flow without Xshell.

Tools and capabilities

  • xshell_health checks daemon state and online-session count.
  • xshell_list_sessions lists attached tabs and their session identifiers.
  • xshell_read_screen returns the currently visible terminal text.
  • xshell_send proposes confirmed text input.
  • xshell_interrupt proposes a confirmed Ctrl+C interrupt.
  • xshell_wait_for waits for specified text to appear on screen.
  • sftp_download transfers one remote regular file into downloads/ with confirmation and optional hash checking.
  • sftp_upload uploads one local download file to a new remote .part path without overwriting an existing file.
  • sftp_transfer_status reports transfer state, size, hash, and errors.

Limitations and notes

The bridge reads only the currently visible Xshell text area, not a complete scrollback history or an image. Fast or long-running commands can therefore require logs, tail, grep, process checks, port checks, or health endpoints for reliable verification.

Agent requests cannot provide passwords, tokens, passphrases, or similar credentials. The bridge blocks common credential-in-command patterns and refuses input when the terminal shows a credential prompt. Destructive operations such as deletion, database clearing, formatting, package removal, shutdown, and reboot are blocked for Agent-originated requests; the user must type such commands directly in Xshell if genuinely required. Script-interpreter execution patterns, including piping downloaded or generated content into shells, are also rejected.

Only attached tabs are controllable, and their remote permissions remain in force. The daemon listens on 127.0.0.1 rather than exposing an HTTP service. Downloads support one ordinary file at a time, require absolute remote paths, do not overwrite existing local files, and do not automatically retry or remove failed .part files. User approval means input was accepted by Xshell, not that the remote command succeeded; read the resulting screen or wait for a verifiable marker.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Xshell Agent Bridge

xshell-agent-bridge is an MCP server that connects Codex, Claude Code, Cursor, and other stdio MCP clients to user-attached Xshell 8 tabs. Its main tools read screens, send confirmed terminal input, interrupt commands, wait for output, and perform guarded single-file SFTP uploads or downloads with user-entered credentials.

Install Node.js 20+, Xshell 8, and Windows OpenSSH, then launch `src/mcp-stdio.mjs` from the project directory. No npm installation step is required. Run the included Python bridge script in each Xshell tab you want to expose, then restart or reopen the MCP client.

Yes, xshell-agent-bridge works with Cursor through MCP stdio configuration. Attach the desired Xshell tab by running `xshell_agent_bridge.py`, then configure or reopen Cursor so it starts the Node MCP entry point.

No, xshell-agent-bridge blocks credential input from Agent requests. Users must type passwords, passphrases, tokens, OTPs, and similar secrets themselves in Xshell or the separate OpenSSH authentication window.

The bridge rejects Agent-originated deletion, cleanup, formatting, database removal, package uninstall, shutdown, reboot, and related destructive requests before they reach Xshell. It also blocks several script-interpreter and embedded-credential patterns; a user must enter genuinely required destructive commands manually.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewXshell Agent Bridge AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/xshell-agent-bridge?style=directory)](https://allmcps.com/mcp/xshell-agent-bridge)
HTML Embed
<a href="https://allmcps.com/mcp/xshell-agent-bridge"><img src="https://allmcps.com/api/badge/xshell-agent-bridge?style=directory" alt="Xshell Agent Bridge on AllMCPs" /></a>