Terminal Reader MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Terminal Reader MCP check my last terminal command for errors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
terminal-reader-mcp
An MCP server that gives Claude Desktop read-only access to your terminal output. No more copy-pasting errors — just ask Claude to check your terminal.
Quickstart
1. Clone and install
git clone https://github.com/chrisvin-jabamani/terminal-reader-mcp.git
cd terminal-reader-mcp
npm install2. Add the cap function to your shell
The MCP server can only read files — it can't see your terminal directly. The cap function wraps your commands and saves their output to a log file that Claude can read.
Open your shell config:
open ~/.zshrcPaste this at the bottom:
# Capture terminal output for Claude
cap() {
local log_file="$HOME/.terminal_history.log"
local exit_code
echo "---CMD---" >> "$log_file"
echo "$ $*" >> "$log_file"
echo "---OUTPUT---" >> "$log_file"
"$@" 2>&1 | tee -a "$log_file"
exit_code=${pipestatus[1]}
echo "" >> "$log_file"
echo "---EXIT:$exit_code---" >> "$log_file"
echo "---END---" >> "$log_file"
return $exit_code
}Save, then reload:
source ~/.zshrc3. Configure Claude Desktop
Open the config:
open ~/Library/Application\ Support/Claude/claude_desktop_config.jsonAdd the terminal-reader server:
{
"mcpServers": {
"terminal-reader": {
"command": "node",
"args": ["/FULL/PATH/TO/terminal-reader-mcp/index.js"]
}
}
}Replace /FULL/PATH/TO/ with where you cloned the repo.
4. Restart Claude Desktop
Quit completely (Cmd+Q) and reopen.
5. Test it
cap echo "hello from terminal"Ask Claude: "what was my last terminal command?"
Related MCP server: Tmux MCP Server
Usage
Prefix commands with cap when you want Claude to see them:
cap npm run dev
cap python script.py
cap cargo buildCommands without cap are not captured.
Available Tools
5 toolsclear_historyClear Terminal HistoryB
Clear the captured terminal history log file.
Inputs: no named parameters.
get_last_commandGet Last CommandA
Get the most recent terminal command and its output. Use this to see what the user just ran in their terminal.
Inputs: no named parameters.
get_last_errorGet Last ErrorA
Get the last terminal command only if it failed (non-zero exit code). Returns nothing if the last command succeeded.
Inputs: no named parameters.
get_recent_commandsGet Recent CommandsC
Get the last N terminal commands and their outputs.
Inputs: count.
search_outputSearch Terminal OutputB
Search through recent terminal output for a specific pattern or error message.
Inputs: pattern (required), count.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose with no overlap: clear_history manages the log file, get_last_command retrieves the most recent command and output, get_last_error specifically targets failed commands, get_recent_commands provides a configurable history view, and search_output enables pattern matching. The descriptions make it easy to differentiate between them.
All tool names follow a consistent verb_noun pattern using snake_case: clear_history, get_last_command, get_last_error, get_recent_commands, and search_output. This uniformity makes the tool set predictable and easy to understand at a glance.
With 5 tools, this server is well-scoped for its purpose of reading terminal history. Each tool serves a specific function in the workflow, from basic retrieval to advanced search, without being overly sparse or bloated. The count aligns perfectly with the domain's needs.
The tool set covers core operations for terminal history reading: clearing, retrieving recent and specific commands, handling errors, and searching. A minor gap is the lack of a tool to capture or stream live terminal output, but the existing tools provide a complete surface for historical analysis that agents can work with effectively.
Maintenance
Related MCP Connectors
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Related MCP Servers
- AlicenseAqualityBmaintenanceAllows Claude desktop app to execute terminal commands and edit files on your computer through MCP, with features including command execution, process management, and diff-based file editing.25943,514 npm10,279MIT
- AlicenseAqualityDmaintenanceEnables Claude Desktop to interact with and view tmux session content, allowing AI assistants to read from, control, and observe terminal sessions.13589 npm306MIT
- AlicenseNot gradedqualityDmaintenanceMonitors development commands and exposes terminal output to Claude in real-time, allowing AI assistants to see errors, logs, and stack traces without copy-pasting.10 npm3MIT
- AlicenseNot gradedqualityDmaintenanceA VSCode and Cursor extension that captures real-time terminal output and exposes it to AI assistants via the Model Context Protocol. It enables agents to proactively monitor logs, command execution, and errors without requiring manual copy-pasting from the user.3MIT