Skip to main content
Glama
TMYTiMidlY

portal-mcp-server

by TMYTiMidlY

portal_shell

Run commands on a remote host in a persistent shell session that preserves working directory and environment across calls. Use for sequences of dependent commands.

Instructions

Run a command (or a sequence) on ONE remote host in a persistent shell session: cwd and environment (cd / export / venv activation) survive across calls. Use it only when you need that continuity — otherwise portal_exec is faster (no session setup) and can target many hosts; for a long task to background and poll, use portal_job.

Pick one:

  • command="pytest" → {host, session_id, command, exit_code, output, duration_s}.

  • commands=["cd /app","source .venv/bin/activate","pytest"] → steps run in order in the SAME session, so cwd / exports / venv carry across them (what portal_exec's multi-command path cannot do). Returns {host, session_id, results:[…]}; stop_on_error=True (default) halts at the first failure and adds stopped_at.

Behavior:

  • bash or zsh; an unknown login shell falls back to bash (if bash is missing the call is refused — use portal_exec).

  • Output is the COMBINED stdout+stderr stream (use portal_exec when you need them split). Oversize output is capped and flagged truncated=true.

  • A command that wedges on an interactive prompt (sudo password, ssh first-connect, passphrase, …) is auto-aborted, returning exit_code -1 + error:"interactive_prompt_blocked" + session_preserved:true — cwd/env survive, so the next command runs straight away.

★ No sudo or secret injection here (both are one-shot by nature): to run as root use portal_exec(use_sudo=True); for a command needing a secret use portal_exec(secrets=[…]).

timeout (per command, seconds; default 1h, operator-lowerable via PORTAL_DEFAULT_TIMEOUT): the call is held open until the command exits or timeout elapses. Keepalive pings stop the client aborting a hung call, so timeout is your real cut-off — for an exploratory / re-runnable command pass a SMALL one first (e.g. 10–30) to fail fast, raising it only for genuinely slow commands.

⚠️ By convention, write operations should target /tmp/ on the remote unless the user approved another path (not enforced here).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYes
commandNo
timeoutNo
commandsNo
stop_on_errorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully discloses behavioral traits: shell selection and fallback, combined output stream with truncation, interactive prompt auto-abort with session preservation, timeout handling with keepalive, and write convention to /tmp. It explicitly states what the tool does not do (no sudo/secret injection). This is comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is detailed but well-structured: purpose, usage examples, behavioral details, timeout guidance, convention note. Each paragraph serves a clear purpose. Could be slightly more concise, but the information density is high and well organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters, no annotations, has output schema), the description covers all necessary aspects: purpose, when to use, parameter details, behavior, output format, and conventions. It addresses use cases, edge cases (interactive prompt), and constraints (write convention). The description is fully complete for an AI agent to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It provides rich semantics for each parameter: explains the difference between command and commands with return types, timeout default and tuning guidance, stop_on_error behavior, and host as required. It adds context beyond the schema's empty property descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it runs commands on a remote host in a persistent shell session, emphasizes state continuity, and explicitly distinguishes from sibling tools (portal_exec for no-continuity/multi-host, portal_job for background tasks). The verb 'run' and resource 'persistent shell session' are specific, and examples clarify the multi-command usage.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly tells when to use this tool ('when you need continuity') and when to use alternatives (portal_exec for sudo/secrets, portal_job for background polling). It also mentions when to use portal_exec for split stdout/stderr and for operations requiring sudo or secret injection. This provides clear guidance for the agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/TMYTiMidlY/portal-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server