Oraforge Linux MCP
Executes unrestricted Bash commands and provides host information for the Linux host it runs on, including OS, kernel, uptime, service user/root status, and disk usage.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Oraforge Linux MCP
Remote Linux administration over the Model Context Protocol (MCP).
This service runs on the Linux host it controls and exposes a remote MCP endpoint over Streamable HTTP. It does not SSH back into the same machine and does not need an SSH private key. The run_command tool executes Bash commands as the operating-system account running the service.
Root means root. When the systemd unit runs as
root, every connected and authorized AI client can execute unrestricted root commands: read/write files, install packages, inspect processes, restart services, change firewall rules, and modify or delete the operating system. Connect only clients and accounts you trust.
Features
Full Bash command execution with stdout, stderr, exit code and elapsed time
Configurable working directory and per-command timeout
Process-group termination when a command times out
Bounded command length and returned output size
Host overview (OS, kernel, hostname, uptime, current service user, root status and disk space)
Remote MCP over Streamable HTTP at
/mcpOAuth 2.1 authorization with PKCE and Dynamic Client Registration (DCR)
Owner-passphrase approval page; no static API key is required
Access/refresh tokens stored as SHA-256 hashes in SQLite; refresh-token rotation and revocation
Audit log records timestamp, OS user, working directory, exit code, duration and command hash — not the command text or output
Local MCP stdio mode for development
Related MCP server: Homelab MCP
Important architecture detail
If you install this MCP directly on your target Linux server, the process already runs on that host. Calling run_command executes a local shell there. Your SSH private key is not needed by this application and must never be copied into this repository or its .env file.
If you later host this MCP on a different machine, that becomes a different architecture and should use a dedicated SSH identity with limited privileges. Do not reuse an exposed private key.
Requirements
Ubuntu or another Linux distribution with Bash
Python 3.11+
A public DNS hostname pointing to the server
HTTPS reverse proxy (Nginx + Certbot is documented below)
A persistent writable directory for OAuth state and audit logs
Local setup
git clone https://github.com/SK108045/Linux_MCP.git
cd Linux_MCP
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -e ".[dev]"
cp .env.example .env
chmod 600 .envEdit .env. Generate a dedicated OAuth owner passphrase:
openssl rand -base64 32Set the public URL and allowed host to the DNS name you configure. Do not use the bare IP address for OAuth.
Deploy on your server
Recommended hostname: linux-mcp.oraforgetech.com (create an A record pointing to your server's public IP). You can use another domain, but MCP_PUBLIC_URL, MCP_ALLOWED_HOSTS, Nginx and the OAuth redirect allowlist must agree.
1. Install the application
The deployment below uses a native systemd service, not Docker. This is intentional: the MCP must run in the host namespace to administer the host itself.
sudo git clone https://github.com/SK108045/Linux_MCP.git /opt/linux-mcp
cd /opt/linux-mcp
sudo python3 -m venv .venv
sudo .venv/bin/python -m pip install --upgrade pip
sudo .venv/bin/pip install .Copy and protect the environment file:
sudo cp .env.example .env
sudo chmod 600 .env
sudo nano .envSet at least:
MCP_TRANSPORT=streamable-http
MCP_HOST=127.0.0.1
MCP_PORT=5000
MCP_PUBLIC_URL=https://linux-mcp.oraforgetech.com
MCP_ALLOWED_HOSTS=linux-mcp.oraforgetech.com
OAUTH_OWNER_PASSWORD=<output from openssl rand -base64 32>
OAUTH_ALLOWED_REDIRECT_HOSTS=chatgpt.com,chat.openai.com,platform.openai.com,claude.ai,localhost,127.0.0.1,gemini.google.com,aistudio.google.com
OAUTH_DB_PATH=/opt/linux-mcp/data/oauth.sqlite3
COMMAND_AUDIT_LOG=/opt/linux-mcp/data/command_audit.jsonlThe owner passphrase is separate from Linux, SSH and GitHub credentials. Never commit .env.
2. Install systemd service
sudo cp deploy/linux-mcp.service /etc/systemd/system/linux-mcp.service
sudo systemctl daemon-reload
sudo systemctl enable --now linux-mcp
sudo systemctl status linux-mcp
sudo journalctl -u linux-mcp -fThe included unit runs as root so the shell tool has root permissions. The service binds to 127.0.0.1:5000; it is not directly exposed to the internet.
3. Configure Nginx and TLS
sudo cp deploy/nginx-linux-mcp.conf /etc/nginx/sites-available/linux-mcp
sudo ln -s /etc/nginx/sites-available/linux-mcp /etc/nginx/sites-enabled/linux-mcp
sudo nginx -t
sudo systemctl reload nginx
sudo certbot --nginx -d linux-mcp.oraforgetech.comAllow inbound ports 80 and 443. Do not open port 5000 publicly. Nginx forwards HTTPS requests to the local application port and preserves streaming responses.
Check:
curl -fsS https://linux-mcp.oraforgetech.com/health
curl -fsS https://linux-mcp.oraforgetech.com/.well-known/oauth-authorization-serverExpected health response:
{"status":"ok","service":"ora-forge-linux-mcp"}MCP endpoint:
https://linux-mcp.oraforgetech.com/mcp
Connect AI clients
All clients connect to the same remote MCP endpoint and receive the same two tools. Each client completes OAuth independently. Approving a client grants it the ability to run unrestricted commands with the service's Linux permissions.
ChatGPT
Open ChatGPT's custom MCP server / connector settings.
Add the server URL shown above, including
/mcp.Choose OAuth authentication.
Complete the owner-passphrase approval page.
Confirm the tools
get_host_infoandrun_commandappear.
Claude
Open Customize → Connectors → Add custom connector (the menu can vary by plan).
Enter the remote MCP URL ending in
/mcp.Select OAuth.
Choose Register automatically (DCR) / automatic registration.
Complete the owner-passphrase approval page.
For a manually registered Claude OAuth client, add https://claude.ai/api/mcp/auth_callback as its redirect URI and ensure claude.ai is in OAUTH_ALLOWED_REDIRECT_HOSTS.
Gemini CLI
Gemini CLI supports OAuth discovery for remote MCP servers over HTTP. Add this server to ~/.gemini/settings.json under mcpServers:
{
"mcpServers": {
"linux-server": {
"url": "https://linux-mcp.oraforgetech.com/mcp"
}
}
}Restart Gemini CLI, inspect /mcp, and complete the browser OAuth flow when prompted. OAuth browser callbacks need a browser-capable local environment; a headless shell without a browser callback may not complete the interactive flow.
Gemini CLI is the confirmed Google client path documented here. Do not assume that every Gemini web/app surface currently exposes arbitrary custom remote MCP connectors.
Tool reference
get_host_info()
Returns hostname, OS, kernel, Python version, uptime, current OS user, whether the process is root, and filesystem usage for /.
run_command(command, working_directory="", timeout_seconds=120)
Runs the supplied command through Bash login-shell mode.
Parameters:
command(required): complete Bash command or scriptworking_directory(optional): absolute or relative directory on the server; defaults to the process working directorytimeout_seconds(optional): defaults to 120; maximum controlled byCOMMAND_MAX_TIMEOUT_SECONDS
The response includes exit_code, stdout, stderr, timed_out, duration_seconds and output_truncated. A non-zero exit code is a command failure; the tool returns the result rather than hiding it.
Examples:
whoami && iddf -h && free -hsystemctl status nginx --no-pagerjournalctl -u linux-mcp -n 100 --no-pagerfind /var/log -maxdepth 2 -type fapt update
Commands execute non-interactively; commands that require a password prompt or TTY need a non-interactive equivalent.
Operational notes
The OAuth login is intentionally single-owner. Anyone who knows the owner passphrase can approve a client. All approved clients receive equivalent shell permissions.
OAuth access tokens expire; refresh tokens rotate. The OAuth database must persist across restarts.
Revoke a client by disconnecting it in the AI client and/or using OAuth token revocation. Deleting
data/oauth.sqlite3revokes all registered clients and sessions.COMMAND_AUDIT_LOGrecords command hashes and metadata, not raw command contents, to avoid recording embedded secrets. Protect this file because it reveals administrative activity.Keep the application port private behind HTTPS. Never expose unauthenticated shell execution.
The command timeout is a limit on the foreground process group, not a security sandbox. A command can intentionally launch detached processes.
This is a superuser administration interface, not a multi-tenant product. Do not expose it to customers or share the owner passphrase.
Review every command and its output. An AI can be manipulated by malicious content it reads from the server; prompt injection can cause it to suggest or execute dangerous commands.
Development and tests
python -m pip install -e ".[dev]"
ruff check src tests
pytestCI runs Ruff and Pytest on Python 3.11 and 3.12.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Linux server administration over OAuth MCP: shell, Docker, systemd, files and monitoring.
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Remote MCP access to user-authorized Linux, Windows and Intel Mac devices for AI assistants.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables ChatGPT to securely inspect and administer a Linux VPS over Streamable HTTP, with OAuth protection, workspace file tools, and optional root command execution.MIT
- AlicenseNot gradedqualityCmaintenanceEnables an OAuth-capable AI assistant to manage a self-hosted Linux server, starting with host-health and probe snapshots and optionally expanding to shell commands, bounded text-file reads/writes/moves, and asynchronous jobs through an owner-authenticated local broker. Configuration and credentials stay private on your own machine, with no hosted service or model API keys required.MIT
- AlicenseNot gradedqualityCmaintenanceEnables ChatGPT and MCP clients to safely inspect and operate a Linux host through OAuth-protected, workspace-bounded file, Git, process, systemd, and Docker diagnostics, plus human-approved edits and operations.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to securely control Linux and WSL2 systems over Streamable HTTP with Bearer token authentication, supporting command execution, background jobs, file operations, Docker management, system inspection, and audit log access with safety confirmations and path protections.MIT