Remote Shell MCP

Remote Shell MCP

Enables secure remote workspace management over SSH, supporting file operations, shell commands, and profile configuration for agent-safe remote code environments.

Category
Visit Server

README

Remote Shell MCP

Remote Shell MCP is a local MCP server that exposes agent-safe remote workspace tools over SSH.

The MVP focuses on a small remote code workspace surface:

  • profile_list
  • profile_get
  • profile_create
  • profile_update
  • profile_delete
  • profile_set_default
  • workspace_info
  • list_dir
  • read_file
  • write_file
  • edit_file
  • apply_patch
  • search
  • shell

The server is intended to run locally. It connects to remote hosts over SSH/SFTP and restricts all file operations and command working directories to configured remote roots.

Configuration

Create a config file from remote-shell.config.example.json, then point the server at it:

$env:REMOTE_SHELL_CONFIG = "C:\path\to\remote-shell.config.json"
npm run dev

MCP Client Command

After building:

{
  "mcpServers": {
    "remote-shell": {
      "command": "node",
      "args": ["C:\\path\\to\\remote-shell-mcp\\dist\\index.js"],
      "env": {
        "REMOTE_SHELL_CONFIG": "C:\\path\\to\\remote-shell.config.json"
      }
    }
  }
}

Codex Integration

Run the local MCP smoke test first:

npm run build
npm run test:mcp

Then install the server into Codex's global config:

powershell -ExecutionPolicy Bypass -File .\scripts\install-codex-config.ps1

The script backs up %USERPROFILE%\.codex\config.toml and writes:

[mcp_servers.remote_shell]
command = 'C:\Program Files\nodejs\node.exe'
args = ['C:\Users\jeefy\Documents\RemoteShell\dist\index.js']
startup_timeout_sec = 30

[mcp_servers.remote_shell.env]
REMOTE_SHELL_CONFIG = 'C:\Users\jeefy\Documents\RemoteShell\remote-shell.config.json'

Restart Codex, or start a new Codex thread, after changing MCP config.

Safety Model

  • Remote paths are normalized as POSIX paths.
  • Relative paths are resolved under the profile's defaultRoot.
  • Absolute paths must stay under one of the profile's allowed roots.
  • Writes and edits support expectedHash to avoid overwriting changed files.
  • Shell cwd must stay under an allowed root.
  • Command output is truncated by configurable byte limits.

Connection And Cache Behavior

Within one running MCP server process, SSH connections are reused per profile. Each shell call opens a new exec channel over the existing SSH connection instead of creating a new SSH connection.

read_file uses a small in-memory cache when fileCache.enabled is true:

  • Only files at or below fileCache.maxFileBytes are cached.
  • Cache entries expire after fileCache.ttlMs.
  • write_file, edit_file, and apply_patch update or invalidate affected entries.
  • shell clears the profile file cache because shell commands may modify arbitrary files.
  • External server-side changes made outside this MCP server can remain invisible until the TTL expires.

See docs/mvp-design.md for the MVP boundaries and extension points.

Profile Management

Profiles are stored in the JSON config file pointed to by REMOTE_SHELL_CONFIG.

Profile tools persist changes atomically:

  • profile_create fails with ERR_PROFILE_EXISTS when the name already exists.
  • profile_update fails with ERR_PROFILE_NOT_FOUND when the name does not exist.
  • profile_delete fails with ERR_PROFILE_NOT_FOUND when the name does not exist.
  • profile_delete fails with ERR_DEFAULT_PROFILE_DELETE when deleting the default profile without newDefaultProfile.
  • profile_delete fails with ERR_PROFILE_LAST_DELETE when deleting the only remaining profile.

Secret fields such as password and passphrase are not returned by profile_list or profile_get.

Patch Format

apply_patch accepts Codex-style patches:

*** Begin Patch
*** Add File: hello.txt
+hello
+world
*** Update File: app.txt
@@
 context
-old
+new
*** Delete File: old.txt
*** End Patch

The MVP supports Add File, Update File, and Delete File.

  • Paths are resolved under the selected profile's allowed roots.
  • Update File hunks must match exactly once.
  • Add File fails if the target already exists.
  • Delete File fails if the target does not exist.
  • expectedHashes can be provided for update/delete conflict checks.

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
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
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
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