Remote Shell MCP
Enables secure remote workspace management over SSH, supporting file operations, shell commands, and profile configuration for agent-safe remote code environments.
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_listprofile_getprofile_createprofile_updateprofile_deleteprofile_set_defaultworkspace_infolist_dirread_filewrite_fileedit_fileapply_patchsearchshell
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
expectedHashto avoid overwriting changed files. - Shell
cwdmust 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.maxFileBytesare cached. - Cache entries expire after
fileCache.ttlMs. write_file,edit_file, andapply_patchupdate or invalidate affected entries.shellclears 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_createfails withERR_PROFILE_EXISTSwhen the name already exists.profile_updatefails withERR_PROFILE_NOT_FOUNDwhen the name does not exist.profile_deletefails withERR_PROFILE_NOT_FOUNDwhen the name does not exist.profile_deletefails withERR_DEFAULT_PROFILE_DELETEwhen deleting the default profile withoutnewDefaultProfile.profile_deletefails withERR_PROFILE_LAST_DELETEwhen 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 Filehunks must match exactly once.Add Filefails if the target already exists.Delete Filefails if the target does not exist.expectedHashescan be provided for update/delete conflict checks.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。