Skip to main content
Glama

terminal-mcp

MCP server that executes shell commands and captures terminal output as styled PNG screenshots — perfect for pentest reports, documentation, and any workflow where you need professional-looking terminal captures.

Works with any MCP-compatible client: Claude Code, OpenAI Codex, Antigravity, Cursor, Windsurf, Cline, Continue, and more.

Features

  • Execute & capture: Run commands with full ANSI color preservation

  • Terminal-styled screenshots: Renders output as PNG with macOS window chrome, proper colors, and metadata

  • 20 built-in themes: Tokyo Night, Dracula, Nord, Gruvbox, GitHub Dark, Kali, Ubuntu, and more

  • Report-ready: Watermarks, timestamps, exit codes, custom titles

  • Full ANSI support: 16 colors, 256-color palette, and 24-bit truecolor

  • Cross-platform: macOS and Linux support

  • Session capture management: List, re-render, and manage captures

Related MCP server: Code Screenshot Generator

Screenshot Examples

Tokyo Night theme

Installation

git clone https://github.com/JoasASantos/terminal-mcp.git
cd terminal-mcp
chmod +x setup.sh
./setup.sh

The setup script handles everything: dependency installation, build, and MCP client registration.

Manual Setup

git clone https://github.com/JoasASantos/terminal-mcp.git
cd terminal-mcp
npm install
npm run build

Linux Prerequisites

On Linux, Puppeteer requires some system libraries for Chromium:

Debian/Ubuntu:

sudo apt-get install -y \
  libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 \
  libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 \
  libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2

Fedora/RHEL:

sudo dnf install -y \
  nss atk at-spi2-atk cups-libs libdrm libxkbcommon \
  libXcomposite libXdamage libXrandr mesa-libgbm pango cairo alsa-lib

Arch Linux:

sudo pacman -S nss atk at-spi2-atk cups libdrm libxkbcommon \
  libxcomposite libxdamage libxrandr mesa pango cairo alsa-lib

Client Configuration

Claude Code

Automatic (via setup.sh):

./setup.sh
# Restart Claude Code after setup

Manual (via CLI):

claude mcp add terminal-mcp --scope user -e TERMINAL_MCP_DIR="$HOME/terminal-screenshots" -- node /path/to/terminal-mcp/dist/index.js

OpenAI Codex

Add to your Codex MCP configuration:

{
  "mcpServers": {
    "terminal-mcp": {
      "command": "node",
      "args": ["/path/to/terminal-mcp/dist/index.js"],
      "env": {
        "TERMINAL_MCP_DIR": "/path/to/screenshots"
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project or ~/.cursor/mcp.json globally:

{
  "mcpServers": {
    "terminal-mcp": {
      "command": "node",
      "args": ["/path/to/terminal-mcp/dist/index.js"],
      "env": {
        "TERMINAL_MCP_DIR": "/path/to/screenshots"
      }
    }
  }
}

Windsurf

Add to your Windsurf MCP settings (~/.windsurf/mcp.json):

{
  "mcpServers": {
    "terminal-mcp": {
      "command": "node",
      "args": ["/path/to/terminal-mcp/dist/index.js"],
      "env": {
        "TERMINAL_MCP_DIR": "/path/to/screenshots"
      }
    }
  }
}

Cline (VS Code)

Add to Cline's MCP server settings in VS Code:

{
  "mcpServers": {
    "terminal-mcp": {
      "command": "node",
      "args": ["/path/to/terminal-mcp/dist/index.js"],
      "env": {
        "TERMINAL_MCP_DIR": "/path/to/screenshots"
      }
    }
  }
}

Continue

Add to ~/.continue/config.json:

{
  "experimental": {
    "mcpServers": {
      "terminal-mcp": {
        "command": "node",
        "args": ["/path/to/terminal-mcp/dist/index.js"],
        "env": {
          "TERMINAL_MCP_DIR": "/path/to/screenshots"
        }
      }
    }
  }
}

Antigravity

Add to your Antigravity MCP configuration:

{
  "mcpServers": {
    "terminal-mcp": {
      "command": "node",
      "args": ["/path/to/terminal-mcp/dist/index.js"],
      "env": {
        "TERMINAL_MCP_DIR": "/path/to/screenshots"
      }
    }
  }
}

Generic MCP Client

Any client supporting the Model Context Protocol can use terminal-mcp. The server communicates over stdio using JSON-RPC. Configure it with:

  • Command: node

  • Args: ["/path/to/terminal-mcp/dist/index.js"]

  • Env (optional): TERMINAL_MCP_DIR — directory for saved screenshots

Tools

Tool

Description

terminal_exec_screenshot

Primary tool. One command = one PNG. Execute any shell command and get a screenshot

terminal_exec

Execute a command and capture output for later screenshot

terminal_screenshot

Render a previously captured output as PNG

terminal_screenshot_text

Render arbitrary text as a terminal PNG

terminal_list_captures

List all captures in the current session

terminal_list_screenshots

List saved PNG files

terminal_themes

List available themes

Works with any command: nmap, curl, gobuster, nikto, sqlmap, ls, docker, kubectl, git, python, gcc — anything that runs in a shell.

Themes (20)

Theme

Description

tokyonight

Dark blue, clean and modern (default)

dracula

Classic purple-accented dark

monokai

Warm dark with vibrant colors

catppuccin

Soft pastel dark (Mocha)

nord

Arctic blue-gray palette

gruvbox

Retro warm dark with earthy tones

solarized

Solarized Dark, precision colors

onedark

Atom One Dark

material

Material Design dark

ayu

Ayu Dark, minimal contrast

github

GitHub Dark

cobalt

Deep blue with bright accents

hacker

Green-on-black matrix style

macos

Native macOS Terminal.app dark

kali

Kali Linux terminal

parrot

Parrot OS terminal

ubuntu

Ubuntu terminal (aubergine)

powershell

Windows PowerShell blue

retro

Retro amber phosphor CRT

light

Light theme for print-friendly reports

Screenshot Options

Option

Type

Default

Description

theme

string

tokyonight

Color theme (see list above)

show_chrome

boolean

true

macOS window chrome with traffic lights

font_size

number

14

Font size in pixels

title

string

command name

Window title bar text

prompt

string

$

Shell prompt prefix

show_timestamp

boolean

true

Show timestamp in footer

watermark

string

—

Watermark text (bottom-right)

save_path

string

auto

Full path for the output PNG

width

number

auto

Fixed terminal width in pixels

max_width

number

980

Maximum terminal width

max_lines

number

all

Truncate output after N lines

line_height

number

1.4

Line spacing multiplier

scale

number

2

Resolution: 1 = 1x, 2 = retina, 3 = 3x

compact

boolean

false

Reduced padding for smaller screenshots

Usage Examples

Basic command screenshot

terminal_exec_screenshot({ command: "nmap -sV target.com", theme: "hacker" })

Pentest report with watermark

terminal_exec_screenshot({
  command: "nikto -h https://target.com",
  theme: "tokyonight",
  watermark: "CONFIDENTIAL - Pentest Report 2024",
  title: "Nikto Web Scanner"
})

Screenshot arbitrary text

terminal_screenshot_text({
  text: "Finding: SQL Injection in /api/users\nSeverity: Critical\nCVSS: 9.8",
  title: "Vulnerability Report",
  theme: "dracula"
})

Environment Variables

Variable

Default

Description

TERMINAL_MCP_DIR

~/terminal-screenshots

Directory for saved screenshots

Requirements

  • Node.js 18+

  • Puppeteer (bundled — downloads Chromium on first run)

  • On Linux: system libraries for headless Chromium (see Linux Prerequisites)

License

MIT

Available Tools

7 tools
terminal_execA

Execute any shell command and capture its full output with ANSI colors. Returns output text and a capture ID for later screenshot. Use terminal_exec_screenshot instead if you want the image immediately.

Inputs: command (required), cwd, timeout.

terminal_exec_screenshotA

Execute a command and capture a single PNG screenshot of its full output. One command = one image. This is the primary tool — use it for any shell command (pentest, sysadmin, dev, networking, etc).

Inputs: command (required), cwd, scale, theme, +13 more.

terminal_list_capturesB

List all captured command outputs in the current session.

Inputs: no named parameters.

terminal_list_screenshotsC

List all saved screenshot files from the screenshots directory.

Inputs: directory.

terminal_screenshotB

Render a captured command output as a terminal-styled PNG screenshot. Uses the last capture if no ID given.

Inputs: scale, theme, title, width, +11 more.

terminal_screenshot_textB

Render arbitrary text as a terminal-styled PNG screenshot. Useful for manually composed output.

Inputs: text (required), scale, theme, title, +10 more.

terminal_themesA

List all available terminal themes with preview colors.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 7 tools

    Disambiguation4/5

    Most tools have distinct roles, but terminal_exec and terminal_exec_screenshot overlap in that both run a command and return output plus a capture artifact, forcing the agent to choose based on whether it wants an image now or later. The three screenshot-producing tools (screenshot, screenshot_text, exec_screenshot) are differentiated by input source (capture ID, arbitrary text, command), which the descriptions make clear.

    Naming Consistency4/5

    All names share the terminal_ prefix and snake_case is used throughout, with a recognizable exec/screenshot/list pattern. Minor deviations: terminal_themes lacks a verb (unlike list_captures/list_screenshots), and the noun/verb ordering flips between terminal_screenshot and terminal_exec_screenshot.

    Tool Count5/5

    Seven tools is well-scoped for a command-execution-plus-screenshot server; each tool maps to a concrete step (run, render, list captures, list files, list themes). Nothing feels redundant or bloated.

    Completeness4/5

    The surface covers the full core loop: execute commands, capture output, render screenshots from captures or arbitrary text, and enumerate captures/screenshots/themes. Minor gaps exist around cleanup (deleting captures or screenshot files) and there is no tool to inspect or read back an existing screenshot or capture other than its ID.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers