GhostInTheShell MCP

GhostInTheShell MCP

A sandboxed, read-only MCP server that safely exposes system metrics, container diagnostics, and logs to AI agents with intelligent context compression and strict security measures.

Category
Visit Server

README

🚀 GhostInTheShell MCP

A Sandboxed, Read-Only System Oracle for AI Agents

Because it sees everything… but touches nothing.

Python version MCP framework Security


GhostInTheShell is an advanced Model Context Protocol (MCP) server for local DevOps, Container Diagnostics, and System Monitoring. It safely exposes metrics, container states, and logs to AI agents while minimizing token usage and preventing malicious directory traversal.

Unlike raw wrapper servers, it provides Diagnostics Intelligence and Strict Sandboxing. Instead of dumping raw command outputs that exhaust LLM tokens, it employs contextual compression to return highly targeted diagnostic intelligence.

🌟 Key Features

Security First Model

Built to be strictly read-only:

  • Symlink Traversal Blocker: Protects against malicious directory escapes (/../).
  • Whitelist Paths: Hard-blocks system sensitive directories like /etc and /root.
  • Virtual Log Registry: Log reading is done via aliases (e.g., app_error -> /tmp/app.log) so the LLM doesn't even know the real disk paths.

Diagnostics Intelligence Layer

Computes states locally before hitting the LLM:

  • analyze_containers: Parses Docker states for Crash Loops, OOMKilled flags, and healthcheck failures.
  • check_cpu_anomalies: Uses exact process uptimes to find runaway loops holding threads.
  • check_port_conflicts: Finds exactly what process is stealing port 3000 during your web dev.
  • check_log_errors: Scans the tail of safe logs for spikes of exceptions/fatals.

Context Compression Engine

A custom logging parser that helps prevent LLM context exhaustion:

  • Strips variable noise (timestamps, IDs)
  • Deduplicates identical screaming loops
  • Truncates giant lines (like massive JSON stack traces) to a tight 500-character cap.

🛠 Installation & Usage

Requires uv and Python 3.10+.

# Clone the repository
git clone https://github.com/pronzzz/GhostInTheShell-mcp.git
cd GhostInTheShell-mcp

# Install as a uv tool globally
uv tool install ./

Or run directly from source:

GHOST_ALLOWED_DIRS="/var/log,/tmp" uv run ghostinshell

Adding to Claude Desktop

To grant Claude Desktop access to your machine's diagnostics securely, edit your claude_desktop_config.json:

{
  "mcpServers": {
    "ghostinshell": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/ghostinshell",
        "run",
        "ghostinshell"
      ]
    }
  }
}

🧰 Tools Provided to the LLM

  • get_system_health: High-level multi-platform CPU, Disk, and RAM status.
  • list_processes(sort_by="cpu|memory"): Details on top running processes.
  • docker_status: Raw Docker daemon read-only status.
  • analyze_containers: Intelligent diagnosis of crash loops, OOM flags, and resource limits.
  • check_cpu_anomalies: Detects runaway processes based on load and uptime.
  • check_memory_pressure: Identifies system memory hogs.
  • check_disk_pressure: Warnings for saturated root disks.
  • list_available_virtual_logs: Look up registered safe-to-read log files.
  • tail_log(alias, lines): Returns token-compressed tail of a file.
  • check_log_errors(alias): Rapid regex anomaly detection for error spikes.
  • check_port_conflicts: Detect processes attempting to bind identical local ports.

👩‍💻 Development

Want to add new safe capabilities? Check out the GUIDE.md and CONTRIBUTING.md.

# Install development dependencies
uv pip install -e ".[dev]"

# Run tests
uv run pytest tests/

We test heavily against:

  • Sandbox symlink jailbreaks
  • Log compression deduplication logic
  • OS cross-platform wrappers (Darwin vs Linux)
  • Port conflict topological structures.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured