claude-host-mcp
Provides tools for managing Docker containers, including listing, inspecting, starting/stopping/restarting/removing containers, and executing commands inside them.
Provides package management tools (search, info, install, remove) that support Flatpak as one of the auto-detected native package managers on Linux systems.
Provides comprehensive Git repository management tools including status, log, diff, branch, commit, merge, rebase, stash, and worktree operations.
Click on "Install 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., "@claude-host-mcpwhat's the current CPU and memory usage?"
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.
claude-host-mcp
Local MCP server that gives Claude Desktop controlled access to the real host machine — not just its isolated VM/session.
Built on MCP Python SDK v2 (MCPServer), stdio transport. Runs as your normal user. Works on Linux, macOS, Windows — tools adapt per OS (Bash/PowerShell, ps/tasklist, systemd/launchd/sc, df/drive usage).
English | فارسی
Why
Claude Desktop Cowork/Code tasks run in a restricted sandbox. This server bridges out: Claude calls 88 typed tools + 8 resources (5 static + 3 templates) on the host — shell, persistent terminals, background jobs, files, search, git, system monitoring, journal, ports, Docker, packages, network, snapshots — with scoped file roots, a policy engine, audit trail, and dangerous-command guardrails.
Design goal: everything a Linux developer/admin does in a terminal, an agent can do — semantically, observably, cancellably, auditably, and reversibly.
Related MCP server: Local Dev Bridge MCP
Tools
88 tools in nine groups (verified live via stdio handshake). Only destructive tools prompt (see Approval policy).
Core
Tool | Description |
| Hostname, |
| Linux: |
| Bash ( |
| Text read inside readable roots. Args: |
| Text write inside writable roots. Refuses overwrite unless |
|
|
Terminal sessions (persistent)
One shell process per session, kept alive across calls. For dev servers, REPLs, ssh — not one-shot commands.
Tool | Description |
| Spawn shell (or run |
| Incremental output since |
| Send keystrokes/commands to stdin. |
| Store dimensions (metadata; no PTY ioctl yet). |
|
|
| Block until regex |
| Terminate session. Destructive — prompts. |
| Live sessions with pid, cwd, age, buffer size. |
Background jobs
Tool | Description |
| Launch command detached. Optional |
| State, pid, exit code, buffer sizes. |
| Incremental |
| Block until exit or timeout. Prefer over polling. |
|
|
| All jobs, or |
Files
Tool | Description |
| Type, |
| Recursive name match ( |
| Recursive content regex. |
| File/dir copy. Source readable, dest writable. |
| Move/rename. Both ends must be writable. Destructive — prompts. |
| Delete file, or dir with |
| Exact-string replace ( |
| Unified diff apply ( |
| First N lines. |
| Last N lines. |
| ASCII tree, |
| Glob find, |
| Literal (default) or |
| Subsequence filename ranking, dependency-free. |
Process and system
Tool | Description |
|
|
| Signal by PID ( |
| User service status: systemd |
|
|
| One-call cpu/memory/disk/load/temps/battery/gpu/network/uptime JSON. |
| User journal tail with |
Git
Tool | Description |
| Branch + |
| Recent commits, short date format. Arg: |
| Uncommitted diff + |
| Local + remote branches ( |
|
|
| Commit with stat, oneline. Read-only. |
| Line-range blame of a tracked file. Read-only. |
|
|
|
|
| Checkout (or |
|
|
| Inverse commit of a revision. |
| Merge branch, conflict output on failure. |
| Rebase onto upstream; |
|
|
| Isolated worktree under |
| List worktrees. Read-only. |
| Remove an agent worktree. |
Network
Tool | Description |
|
|
| TCP reachability + |
|
|
| Hostname → addresses. |
| Interfaces with state + MAC. |
| Active sockets via |
| Listening sockets + owner pid/process ( |
| TCP connect to |
| Owner of a listening port: pid, comm, cmdline, cwd. |
| Layered diagnosis: |
Docker
Requires the docker CLI. Mutations are profile-gated (developer/full) and prompt.
Tool | Description |
| Containers (running default, |
| Tail container logs. |
| State, image, ports, mounts. |
| Lifecycle (10s stop timeout). |
|
|
Packages
Native manager auto-detected (apt/dnf/pacman/zypper/apk/brew/flatpak/snap). Search/info everywhere; mutations on apt/dnf/pacman/brew, developer/full profile only.
Tool | Description |
| Search packages. |
| Package metadata. |
| Install/remove. Prompt. |
| Refresh index. Prompt. |
Snapshots and audit
Tool | Description |
| Copy file/dir into timestamped slot before risky ops. |
| Slots with source + creation time. |
| Copy slot back. Destructive — prompts; |
| One-call pre-edit file snapshot. |
| Restore newest slot for a path. Destructive — prompts. |
| Last N audit records (paths/sizes only, never contents). |
| Filter by tool substring + ok true/false. |
Resources
Live context without tool calls:
URI | Content |
| One-line identity, uptime, disk, memory. |
| Full |
| Listening-port table JSON. |
| Profile, roots, caps, destructive set JSON. |
| Last 20 audit records JSON. |
| ps row + cmdline + cwd JSON. |
| Buffer tail + alive state JSON. |
| Status + stdout/stderr tails JSON. |
Approval policy
Only destructive tools prompt: file_delete, file_move, terminal_close, terminal_signal, process_kill, job_cancel, git_commit, git_reset, git_revert, git_merge, git_rebase, git_checkout, git_clean (exec), git_tag (create/delete), git_stash (pop/drop), git_worktree_* (create/remove), snapshot_restore, file_restore, docker_* (mutations), package_* (mutations). Everything else — shell, reads, search, monitoring, journal, ports, diagnose — runs without approval friction.
Caveat: deletion via shell (
rm/Remove-Iteminsiderun_command) is NOT blocked and does NOT prompt. Usefile_deletefor guarded deletes that request approval.
Security
Runs as your normal user. Anything that user can read/modify is reachable through tools.
Hard blocks in run_command: sudo/su/pkexec, shutdown/reboot/poweroff (Restart-Computer/Stop-Computer on Windows), disk tools (mkfs, wipefs, fdisk, parted, diskpart, Format-Volume, Clear-Disk), raw dd of=/dev/*, recursive rm of / or $HOME (drive-root Remove-Item C:\ on Windows), root-wide chown/chmod, fork bombs.
Policy engine (HOST_MCP_PROFILE): safe = read-only tools pass, everything else blocked server-side; developer (default) = full workspace + git + process + network; full = developer + Docker/package/service-restart style ops. Destructive git ops (reset --hard, clean exec) additionally require confirm=true in the call. docker_exec --privileged always blocked. process_kill refuses PID 1 and self; file_delete refuses configured roots; git_commit never pushes; service_status user-scope only; download_file/http_fetch http(s) only, byte-capped.
Rate limits (HOST_MCP_RATE_LIMIT, default 60/60): per-family call budget; excess calls fail with a rate-limit error instead of executing.
Audit (~/.local/share/claude-host-mcp/audit.jsonl, override HOST_MCP_AUDIT_FILE, empty disables): every mutating tool logs timestamp/tool/args-hint/ok. File contents never logged.
Blocklist = guardrail, not sandbox. General shell access is inherently powerful. Tighten
*_ROOTSto least privilege.
Requirements
Linux, macOS, or Windows; Python 3.10+
Claude Desktop with local MCP support
uvoptional; installers fall back tovenv+ pip
Install
Linux (or WSL):
git clone https://github.com/isina-nej/claude-host-mcp.git
cd claude-host-mcp
chmod +x install.sh install-mac.sh doctor.sh uninstall.sh
./install.shmacOS:
git clone https://github.com/isina-nej/claude-host-mcp.git
cd claude-host-mcp
chmod +x install.sh install-mac.sh doctor.sh uninstall.sh
./install-mac.shWindows (PowerShell — use the .ps1 scripts, not the .sh ones):
git clone https://github.com/isina-nej/claude-host-mcp.git
cd claude-host-mcp
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\install.ps1Installer does:
Copies source to
~/.local/share/claude-host-mcp(%USERPROFILE%\.local\share\claude-host-mcpon Windows)Creates isolated venv, installs
mcp>=2,<3Detects Claude config — macOS
~/Library/Application Support/Claude/, Windows%APPDATA%\Claude\, Linux~/.config/Claude-3p/or~/.config/Claude/Registers
host-systemserver (backs up config first)Enables 3P local-dev MCP flags in active config-library profile, if present (Linux 3P only; no-op elsewhere)
Then fully restart Claude Desktop, open a new task/session.
Verify:
Use the host-system MCP tool host_identity.Real hostname + desktop user in reply = working.
Custom paths:
CLAUDE_DESKTOP_CONFIG="$HOME/path/claude_desktop_config.json" ./install.sh
HOST_MCP_INSTALL_DIR="$HOME/custom-dir" ./install.shConfiguration
Set under host-system → env in claude_desktop_config.json. Restart Claude Desktop after change.
Variable | Default | Description |
|
|
|
|
| Readable roots (OS path separator). |
|
| Writable roots (OS path separator). |
|
| Output truncation cap, chars. |
|
| Max |
|
| Download/fetch cap, bytes (20 MB). |
|
| Audit trail path; empty disables. |
|
| Snapshot slot directory. |
|
|
|
|
| Python log level. |
Example:
{
"mcpServers": {
"host-system": {
"command": "/home/alice/.local/share/claude-host-mcp/.venv/bin/claude-host-mcp",
"args": [],
"env": {
"HOST_MCP_PROFILE": "developer",
"HOST_MCP_READ_ROOTS": "/home/alice:/etc:/var/log",
"HOST_MCP_WRITE_ROOTS": "/home/alice/Documents",
"HOST_MCP_MAX_TIMEOUT": "180",
"HOST_MCP_MAX_OUTPUT": "50000"
}
}
}
}Diagnostics
./doctor.sh # Linux / macOS.\doctor.ps1 # WindowsChecks OS, Python, venv entry point, MCP SDK import, registered config. MCP logs: Claude config/log dir; 3P Linux often ~/.config/Claude-3p/logs/.
Common fixes:
Full Claude Desktop restart (not just window reload), then a new session.
If scripts won't run after
git clone, re-applychmod +x install.sh install-mac.sh doctor.sh uninstall.sh.On Windows, if PowerShell blocks scripts:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass, then.\install.ps1.If the wrong config got edited, re-run with
CLAUDE_DESKTOP_CONFIG(Unix) or-ClaudeConfig(Windows) pointing at the right file.
Uninstall
./uninstall.sh # Linux / macOS.\uninstall.ps1 # WindowsRemoves host-system entry (config backed up first) and installed runtime. Restart Claude Desktop.
Development
Layout: src/claude_host_mcp/ (server.py, sessions.py, jobs.py, policy.py, files.py, gitx.py, ops.py, snapshots.py, resources.py), pyproject.toml (hatchling), install.sh, install-mac.sh, install.ps1, doctor.sh, doctor.ps1, uninstall.sh, uninstall.ps1.
from mcp.server import MCPServer
mcp = MCPServer("Host System")Rules: no stdout logging under stdio transport (stdout = JSON-RPC; log to stderr). Smoke test:
python3 -c "import sys; sys.path.insert(0,'src'); import claude_host_mcp.server; print('OK')"Full handshake check (tools + resources count):
PYTHONPATH=src python -m claude_host_mcp.server # speak JSON-RPC on stdin; see CHANGELOG processChangelog
See CHANGELOG.md. Current: 0.4.1.
License
MIT — see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.
Develop, manage, and debug Railway projects, services, and deployments from within agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceAllows Claude to execute terminal commands on your computer and perform file system operations including surgical code editing with diff-based replacements.1938,9237MIT
- AlicenseAqualityDmaintenanceProvides Claude Desktop with direct access to your local file system for development tasks, enabling file operations (read, write, edit), directory browsing, command execution, and codebase search within a configured projects directory.6MIT
- FlicenseNot gradedqualityDmaintenanceEnables Claude to perform file operations, retrieve system information, run calculations, and generate timestamps on the local system.-
- AlicenseNot gradedqualityCmaintenanceEnables Claude to control the local desktop via screenshot, mouse, keyboard, and clipboard operations.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/isina-nej/claude-host-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server