# AI Terminal Log Debugger

> Inspect saved terminal logs, retrieve recent output, and filter error lines using read-only MCP tools. Requires Node.js 20+ and an MCP-compatible client. Automatic log capture is not included.

AI Terminal Log Debugger is a free AI agent skill on Agensi by Arman Rai, in Testing & Debugging. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Arman Rai](https://www.agensi.io/creators/arman-rai)
- Category: [Testing & Debugging](https://www.agensi.io/skills/testing-debugging)
- Rating: 5.0 out of 5 from 2 reviews
- Version: 1.0
- Last updated: 2026-11-25
- Security: scan passed (2026-11-25); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/ai-terminal-log-debugger
- Tags: testing, ai-agents, devops, debugging, mcp-server, node-js, logging

## About this skill

Debugging build failures and runtime crashes often requires manually hunting through obscure log files. This skill provides an MCP server interface to programmatically inspect, filter, and analyze centralized terminal logs.

### What it does
- **Isolate errors** by scanning logs for specific failure keywords like `EADDRINUSE`, `exception`, or `fatal`.
- **Fetch latest output** to retrieve the trailing N lines of any project log for immediate context.
- **Full log retrieval** to read the complete terminal history for deep-dive analysis.
- **Filename validation** to prevent path traversal and ensure safe access to log data.

### How it works
1. Register the MCP server in your client configuration pointing to `src/server.js`.
2. Ensure external processes or redirections write UTF-8 logs to the `logs/` directory.
3. Call `get_errors` to identify the specific failure line in a known project.
4. Use `get_latest_logs` to see the stack trace or events surrounding the error.

### Frameworks & tools
This skill is built with Node.js 20+ and uses the `@modelcontextprotocol/sdk`. It communicates via `stdio` transport.

### Why this beats prompting it yourself
Writing prompts to find errors in raw text is slow and error-prone. This skill uses a structured MCP interface to programmatically slice log files, saving token context by only retrieving the most relevant lines.

### Use cases
- Debugging server startup crashes like port conflicts or missing environment files.
- Analyzing CI/CD or local build failures without manually opening large log files.
- Monitoring long-running processes by checking the trailing 100 lines of output.

### Known limitations
Does not capture logs automatically. Requires logs to be pre-written to the `logs/` directory. Only matches specific hardcoded error keywords for the `get_errors` tool.

## Requires

- Node.js 20+
- npm
- MCP-compatible client (stdio)

Run npm install first, then register src/server.js in your MCP client. Create a logs/ directory at the package root and save projectName .log files there (automatic log capture is not included).

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the AI Terminal Log Debugger skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill improve my debugging workflow compared to just uploading a log file?

This skill acts as a bridge between your AI agent and your local log files, allowing the AI to programmatically scan for keywords like 'fatal' or 'exception' and retrieve specific line ranges without you having to copy-paste massive files manually.

### Which AI agents and environments is this skill compatible with?

The skill is an MCP (Model Context Protocol) server designed for any AI client that supports MCP, such as Claude Desktop or various IDE-based AI extensions, and requires Node.js 20+ to run.

### Does this skill automatically record my terminal history as I type?

No, the skill does not automatically intercept your terminal output; you must ensure your processes are configured to write their logs as UTF-8 files into the designated 'logs/' directory for the server to read them.

### What exactly is included in the download package?

Your purchase includes the full source code for the MCP server (built with @modelcontextprotocol/sdk), a README for setup instructions, and the necessary configurations to register the server with your AI client.

### Is it safe to give an AI agent access to my log directory using this skill?

To protect your system, the skill includes filename validation to prevent path traversal, ensuring the AI agent can only access files explicitly located within your specified logs directory.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
