Exec
БесплатноНе проверенEnables executing a single bounded remote shell command on a configured host, returning truncated stdout/stderr tails and an authoritative exec summary.
Описание
Enables executing a single bounded remote shell command on a configured host, returning truncated stdout/stderr tails and an authoritative exec summary.
README
A dependency-free Node.js implementation for a bounded SSH remote execution MCP gateway.
It exposes bounded remote command execution plus base64 file upload/download over SSH. It is not a GitOps API and not a Kubernetes API. Higher-level tools such as kubectl, git, docker, helm, argocd, and flux are left to the remote shell.
Current interface
GET /healthzGET /metricsPOST /execwithAccept: text/event-streamfor SSE event streamingPOST /mcpfor MCP Streamable HTTP / JSON-RPC tool calls
The MCP server exposes these tools:
exec
download_file
upload_file
All tools operate on the configured remote execution host. In the current dev deployment, the ssh-mcp connector runs commands and file transfers on dev-debian through SSH.
MCP tool contract
Request arguments:
{
"command": "kubectl get pods -A",
"cwd": "/root/config-git",
"timeout_seconds": 120,
"max_output_bytes": 5242880,
"env": {
"NO_COLOR": "1"
}
}
Field semantics:
command: command string run through/bin/sh -con the configured remote execution host. Use explicit quoting for pipelines, redirection,&&, and variable expansion. Avoid interactive or unbounded long-running commands.cwd: working directory on the remote execution host. It must be under the configured allowlist. If omitted,DEFAULT_CWDis used.timeout_seconds: maximum runtime. Values aboveMAX_TIMEOUT_SECONDSare rejected. On timeout, the server aborts the exec and sendsSIGTERM, thenSIGKILLafter the configured kill grace period.max_output_bytes: maximum combined stdout/stderr bytes forwarded before truncation. The process is still drained until exit. Final byte counts and bounded tails are included in the summary.env: additional environment variables. Invalid variable names are ignored.ENVandBASH_ENVare removed before spawning.
File download arguments:
{
"path": "assets/logo.png",
"max_bytes": 10485760
}
File download result:
{
"path": "/root/exec-mcp/assets/logo.png",
"bytes": 12345,
"mime_type": "image/png",
"data_base64": "..."
}
File upload arguments:
{
"path": "uploads/report.xlsx",
"data_base64": "...",
"mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"append": false
}
File upload result:
{
"path": "/root/exec-mcp/uploads/report.xlsx",
"bytes": 12345,
"action": "write",
"mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
File tool semantics:
download_filereturns remote raw file bytes asdata_base64after path allowlist validation.download_file.max_bytesis the maximum allowed file size. If omitted,FILE_MAX_DOWNLOAD_BYTESis used. Files over the limit are rejected, not truncated.upload_filewrites remote raw file bytes fromdata_base64after path allowlist validation and decoded-size checks.upload_file.data_base64must decode to at mostFILE_MAX_UPLOAD_BYTES.upload_file.append=trueappends decoded bytes; otherwise it replaces the file.MCP_MAX_REQUEST_BYTESmust be large enough for upload JSON bodies. Base64 expands raw bytes by roughly 33%.- Parent directories must already exist.
Output semantics:
- MCP
tools/callreturns final text, not live SSE events. - The final text contains bounded stdout/stderr tail content followed by
[exec summary]. [exec summary]is authoritative forexit,signal,duration_ms, byte counts,truncated, andtimed_out.- stderr output alone is not failure. Non-zero exit code, signal, or
timed_out=trueis failure. - Output may be truncated. Do not assume the returned text is the full command output.
Concurrency semantics:
- Active execs are bounded by
MAX_CONCURRENT_EXECS. - v12 adds operator-wide
list_active_execs,get_exec_status, and idempotentcancel_execcontrol-plane tools. They do not consume execution slots and assume a trusted single-tenant MCP connection. - Commands are fingerprinted with SHA-256. Full commands and environments are never stored in status/history; optional labels are sanitized and must not contain secrets. Redacted command previews remain disabled unless
EXPOSE_REDACTED_COMMAND_PREVIEW=true. - An unconfirmed emergency reap opens the execution circuit and rejects new execs until a late local SSH transport close is observed or the service is restarted. Control-plane tools remain available.
- When full, the tool returns
too_many_active_execswithactive,max,oldest_age_seconds, andstates. too_many_active_execsusually means real concurrency pressure, not necessarily a service fault.- v11 tracks active execs through
ExecRegistryand releases slots throughfinally, timeout abort, client-close abort, and a reaper fallback. - v12 keeps legacy metrics for one compatibility cycle and also exposes
exec_mcp_*lifecycle, cancellation, history, and circuit-breaker metrics.
Cancellation boundary:
- The current connected request can be aborted by client close/disconnect.
- There is no cancel-by-exec-id API in v11.
- v11 protects local active-slot bookkeeping; it does not provide full remote process lifecycle governance.
Commands
npm test
npm run build
npm run validate
npm start
Validation status
Current local validation:
node --test: 33 tests, 33 pass
npm run build: pass
npm run validate: pass
Memory smoke writes 5 MB from a child process while forwarding only 1 KiB plus summary/tail metadata. The gateway drains child output and keeps only bounded tails in memory.
Установка Exec
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/3011/exec-mcpFAQ
Exec MCP бесплатный?
Да, Exec MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Exec?
Нет, Exec работает без API-ключей и переменных окружения.
Exec — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить Exec в Claude Desktop, Claude Code или Cursor?
Открой Exec на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Exec with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
