Skip to main content
Glama
almahdi
by almahdi

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
completions
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
pty_spawn

Spawns a new PTY (pseudo-terminal) session that runs in the background.

Unlike synchronous bash commands, PTY sessions persist and allow you to:

  • Run long-running processes (dev servers, watch modes, etc.)

  • Send interactive input (including Ctrl+C, arrow keys, etc.)

  • Read output at any time

  • Manage multiple concurrent terminal sessions

Returns the session ID, which you can use with other pty_* tools.

pty_read

Reads output from a PTY session's buffer.

The PTY maintains a rolling buffer of output lines. Use offset and limit to paginate through the output.

Two modes:

  1. Standard mode (no pattern): Returns consecutive lines

  2. Search mode (with pattern): Filters lines by regex, returns matches with line numbers

The buffer stores up to PTY_MAX_BUFFER_LINES (default: 50000) lines. Older lines are discarded when the limit is reached.

pty_write

Sends input data to an active PTY session.

Use this tool to:

  • Type commands or text into an interactive terminal

  • Send special key sequences (Ctrl+C, Enter, arrow keys, etc.)

  • Respond to prompts in interactive programs

Common escape sequences:

  • Enter/newline: "\n" or "\r"

  • Ctrl+C (interrupt): "\x03"

  • Ctrl+D (EOF): "\x04"

  • Ctrl+Z (suspend): "\x1a"

  • Tab: "\t"

  • Arrow Up: "\x1b[A"

  • Arrow Down: "\x1b[B"

  • Arrow Right: "\x1b[C"

  • Arrow Left: "\x1b[D"

pty_list

Lists all PTY sessions (active and exited).

Use this tool to:

  • See all running and exited PTY sessions

  • Get session IDs for use with other pty_* tools

  • Check the status and output line count of each session

  • Monitor which processes are still running

Sessions remain in the list after exit until explicitly cleaned up with pty_kill, allowing you to read their output logs.

pty_kill

Terminates a PTY session and optionally cleans up its buffer.

Behavior:

  • If the session is running, it will be killed (status becomes "killed")

  • If cleanup=false (default), the session remains in the list with its output buffer intact

  • If cleanup=true, the session is removed entirely and the buffer is freed

  • Keeping sessions without cleanup allows you to compare logs between runs

Use cleanup=false if you might want to read the output later. Use cleanup=true when you're done with the session entirely.

To send Ctrl+C instead of killing, use pty_write with data="\x03"

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/almahdi/mcp-terminal'

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