Skip to main content
Glama
raghavharness

remote-shell-mcp

shell

Executes remote shell commands in persistent SSH sessions, with automatic session management, smart wait times, and interrupt controls. Enables long-running remote operations for AI assistants.

Instructions

PRIMARY TOOL - Intelligent shell command handler for remote sessions.

This tool automatically detects and handles:

  1. Remote shell commands (ssh, gcloud compute ssh, aws ssm, az ssh, etc.) - Starts a persistent session

  2. Regular commands when session is active - Executes in the remote session

  3. Session control - Use special exit sequences to close the session

Smart Wait Time: Automatically adjusts wait time based on command type (longer for builds, shorter for ls).

Working Directory Tracking: Tracks cd commands and shows current directory in prompt.

Control sequences (to avoid conflict with normal commands):

  • ~. or //end - End session and return to local shell

  • //stop or //kill or //ctrl-c - Send Ctrl+C (SIGINT) to interrupt running command

Auto-reconnect: Sessions automatically attempt to reconnect on disconnection.

Sessions auto-cleanup after 1 hour of inactivity. Output is displayed exactly as the terminal shows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
streamNoEnable streaming output for long-running commands
commandYesThe shell command to execute
waitTimeNoOverride smart wait time (ms). If not provided, automatically determined based on command type.
forceNewSessionNoForce creation of a new parallel session even if one is active
Behavior5/5

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

With no annotations provided, the description carries the full burden. It discloses multiple non-obvious behaviors: automatic detection, smart wait time, working directory tracking, control sequences, auto-reconnect, 1-hour auto-cleanup, and exact terminal output. This goes beyond mere annotations and gives the agent vital operational context.

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

Conciseness5/5

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

The description is well-structured with bold headers and bullet points, front-loading the primary purpose. Every sentence conveys a distinct, useful fact without redundancy. Given the tool's complexity, the length is justified and easily scannable.

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?

For a complex tool with no annotations and no output schema, the description is remarkably complete. It covers command types, session lifecycle, control sequences, wait-time behavior, directory tracking, reconnection, cleanup, and output format. It leaves little ambiguity for an agent selecting and invoking the tool.

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

Parameters4/5

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

Schema coverage is 100%, giving a baseline of 3. The description adds value by explaining the 'Smart Wait Time' behavior tied to waitTime and the parallel session concept for forceNewSession, plus streaming context. This is meaningful extra semantics beyond schema 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 opens with 'PRIMARY TOOL - Intelligent shell command handler for remote sessions,' which clearly states a specific verb and resource. It further differentiates from sibling tools by explaining how it automatically detects remote commands, executes regular commands, and handles session control, making its purpose unmistakable.

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

Usage Guidelines4/5

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

The description implies usage clearly: it is the primary tool for shell commands, handling remote vs local automatically. However, it does not explicitly name sibling alternatives (e.g., remote_session_start) or state when not to use them, so it lacks explicit exclusions. The behavioral breakdown gives good context for when this tool applies.

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/raghavharness/remote-shell-mcp'

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