remote-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@remote-mcprun 'df -h' on the active remote host"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
📖 English version → README.en.md
⚠️ 免责声明:AI 生成
本项目(含
agent.py、server.py、测试与全部文档)由 DeepSeek 生成,属 AI 辅助编写,尚未经过独立的人工安全审查。 使用前请自行审查代码、测试与安全相关逻辑;作者不对其正确性、安全性或适用性作任何保证。
remote-mcp
一个 MCP(Model Context Protocol)服务器,用于在远程机器上执行操作。远程机器上只需跑一个零依赖(仅标准库)的 HTTP 守护进程 agent.py。支持 Linux 和 Windows,特别适合没有 SSH / WinRM / SMB 可用的场景——比如一台密码空白的 Windows 机器,账户和注册表都不能动,只能靠用户态 HTTP 守护进程 + 自带 token 来访问。
Claude Code (MCP 客户端)
│ stdio
▼
server.py (本地) ── HTTP(JSON / NDJSON / 原始字节流,Bearer token 鉴权)──▶ agent.py (远端)agent.py 是单个自包含 Python 文件,拷到目标机器上直接 python agent.py 就能跑,除标准库外无需任何依赖。它通过一个很小的 REST API 把所有能力暴露给 MCP 服务器:文件读/写/改、一次性命令、持久 PTY shell 会话、带 sha256 端到端校验的大文件流式传输、后台进程管理。
工具清单(14 个)
全部以 remote_ 开头:
工具 | 作用 |
| 列出已配置主机 + 当前 active 主机 |
| 读写远端文本文件( |
| 在远端文件上做精确字符串替换 |
| 一次性命令(Windows 默认 cmd.exe) |
| 持久 PTY 会话; |
| 会话管理:list/peek/close/input/interrupt/resize/relabel |
| 大文件流式传输,sha256 端到端校验 |
| 远端平台 / shell / 工具快照——开始干活前先跑这个 |
| 后台进程管理( |
| 关掉远端 agent 自身(仅热重载用,慎用) |
Related MCP server: AgentsID Guard
安装与使用
1. 安装 server(在你跑 Claude Code 的那台机器上):
pip install -r requirements.txt # 需要 Python 3.10+;mcp 锁在 <2.0(2.0 删了 FastMCP)2. 在目标机器上跑 agent(只需 Python 3.10+,标准库,不用装任何依赖):
python agent.py # 默认绑定 0.0.0.0:7777;可用 --host/--port 改它会把自己的 token 写到脚本旁边的 agent.token 文件(或设环境变量 REMOTE_AGENT_TOKEN)。这个 token 要填进下面的配置里。
3. 配置主机(在跑 server 的机器上):
默认路径:~/.config/remote-agent-mcp/hosts.json
{
"hosts": {
"win188": { "url": "http://192.168.88.188:7777", "token": "…", "cwd": "C:\\Users\\me", "platform": "win32" },
"linux": { "url": "http://10.0.0.5:7777", "token": "…", "cwd": "/home/me", "platform": "linux" }
},
"active": "win188"
}4. 注册到 Claude Code:
claude mcp add --scope user remote-mcp -- python /path/to/server.py
claude mcp list可选参数 / 环境变量
--config <路径>— 配置文件(默认~/.config/remote-agent-mcp/hosts.json)。此格式与 pi 编码代理的~/.pi/remote-hosts.json兼容,所以--config ~/.pi/remote-hosts.json可以让两个工具共享同一份配置。--host <别名>— 默认主机,覆盖配置里的active。REMOTE_AGENT_CONFIG— 环境变量覆盖配置路径。REMOTE_AGENT_HOST— 环境变量覆盖默认主机(优先级:显式host=参数 > 环境变量 > 配置active)。REMOTE_AGENT_TOKEN— 覆盖 agent 的 token(旧名PI_REMOTE_AGENT_TOKEN仍兼容)。
设计约束
显式优先于隐式(explicit over implicit)。 工具都以
remote_*命名,让模型明确知道这次调用是打到远端去的;本地工具永远不会被偷偷重定向。路径原样直发,不做本地↔远端的路径映射。先用
remote_env了解远端的 cwd / 平台 / shell。Windows 远端默认 cmd.exe,不是 bash。
会话缓存在内存里(server 重启即丢)。agent.py 重启后,
remote_shell_exec靠 404/410 重试自动恢复。大文件走 upload/download。
remote_write上限 8 MiB(JSON 里 base64 膨胀所致);upload 流式传输并端到端校验 sha256。
测试
tests/ 下有一个本地 mock agent(完整镜像 agent.py 的协议),无需真实远端即可跑全套测试:
python tests/test_server.py # 37 条断言,打本地 mock
python tests/test_mcp_protocol.py # 真实 MCP stdio 客户端 → server → mock agent 的端到端mock 复刻了 agent.py 的真实坑,包括 /exec 响应体里手工拼的 HTTP 式 chunk 帧,确保解析器在忠实的输出下也被验证到。
安全
token 以明文存在 hosts 文件里(与 pi agent 同设计)。server 跑在本机、同信任域;agent 默认绑定
0.0.0.0,如果远端暴露在外网请用防火墙或隧道包起来。remote_shutdown会真的停掉远端 agent,只在热重载时用。除
/ping外,agent.py对所有端点强制 Bearer token。
许可证
MIT。agent.py 是 pi 编码代理项目里 remote-execution agent 的去 pi 化衍生品——来源见 NOTICE。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables secure execution of shell commands across Windows, macOS, and Linux with built-in whitelisting and approval mechanisms for enhanced security.96319MIT

AgentsID Guardofficial
AlicenseAqualityDmaintenanceMCP server that protects shell, file, database, git, and HTTP operations with per-agent permission rules5010MIT- Flicense-qualityCmaintenanceMCP server for infrastructure discovery and remote management, enabling SSH command execution, file transfer, log tailing, and machine/service inventory with a companion web dashboard.1
- Flicense-qualityCmaintenanceAn MCP server that provides tools for filesystem, database, web, system, and shell operations, along with resources and prompts via SSE transport.
Related MCP Connectors
The MCP server for Azure DevOps, bringing the power of Azure DevOps directly to your agents.
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
A paid remote MCP for hosted MCP server, built to return verdicts, receipts, usage logs, and audit-r
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sch246/remote-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server