Universal Host Manager Mcp

io.github.Abktya由 GitHub 帳號 Abktya 發布v0.1.15更新於 Oct 25, 2026

Cross-platform FastMCP server for authenticated remote Linux/macOS host administration

發布方自己的服務:Host.al: .al domains and servers in Albania

概覽

AI 產生的概覽

一個 FastMCP 伺服器,讓 AI 助理管理 Linux 或 macOS 主機:執行 shell 指令、讀寫工作區檔案並查看系統指標。

可以做什麼
在主機上執行任意 shell 指令,可設定逾時,以工作區為工作目錄,並對輸出做截斷與大小限制。在設定的工作區目錄內讀取、寫入和列出檔案。回報磁碟、記憶體與占用最高的行程等系統指標。透過 Streamable HTTP 端點搭配 Auth0 OAuth 登入提供服務,多個 MCP 用戶端可連線同一個執行中的伺服器。
適用情境
當你希望 ChatGPT 或 Claude 等助理遠端檢視與操作一台 Linux 或 macOS 機器——執行指令、在受限工作區內編輯檔案或查看資源使用情況——而且能把伺服器放在 HTTPS 與 Auth0 驗證之後時使用。
執行需求
Linux 或 macOS 上的 Python 3.10+,從 PyPI 安裝或以 uvx 執行;安裝精靈會產生 .env 檔,伺服器必須從該目錄啟動。必要環境變數:AUTH0_DOMAIN、AUTH0_CLIENT_ID、AUTH0_CLIENT_SECRET、AUTH0_AUDIENCE 與 MCP_WORKSPACE_DIR。遠端使用需要 Auth0 帳號和穩定的 HTTPS 端點(Cloudflare Tunnel、ngrok 靜態網域或負載平衡器)。
安裝前請注意
此伺服器暴露任意 shell 執行能力;驗證只決定誰能使用,並不會讓指令變得無害,工作區邊界也不會對 run_command 做沙箱隔離,指令保留服務系統使用者的全部權限。它需要 Auth0 用戶端密鑰(AUTH0_CLIENT_SECRET),切勿提交 .env 檔。ALLOW_INSECURE_NO_AUTH=true 會關閉驗證,只能用於本機測試,絕不可用於可公開存取的端點。LOG_COMMANDS 可能記錄含密鑰的指令文字。檔案工具與指令會修改或刪除主機上的資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Universal Host Manager Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Universal Host Manager MCP

A cross-platform Model Context Protocol server for administering a Linux or macOS host through MCP clients such as ChatGPT and Claude.

[Abktya/universal-host-manager-mcp MCP server] [tests]

It uses FastMCP Streamable HTTP transport, Auth0 OAuth, bounded file tools, output limits and command timeouts.

[!CAUTION] This project exposes arbitrary shell execution. Authentication decides who may use it; it does not make commands harmless. Read SECURITY.md before deploying it.

Features

  • Linux and macOS support
  • Streamable HTTP endpoint
  • Auth0 OAuth integration
  • File reads, writes and directory listings constrained to MCP_WORKSPACE_DIR
  • Configurable command timeouts and output truncation
  • File-size limits and decoding fallback
  • Fail-closed startup when authentication is not configured
  • Example systemd and launchd services

Tools

ToolParametersPurpose
run_commandcommand: str, timeout: intRuns an arbitrary shell command with the workspace as its working directory
read_filepath: strReads a text file inside the workspace
write_filepath: str, content: strWrites UTF-8 text inside the workspace
list_dirpath: str = "."Lists a directory inside the workspace
system_metricsnoneReports disk, memory and top-process information

The workspace boundary applies to the file tools. It does not sandbox run_command; commands retain all permissions of the service's OS user.

Requirements

  • Python 3.10+
  • Linux or macOS
  • Auth0 account for remote use
  • HTTPS endpoint for remote MCP clients

Install

PyPI (recommended)

bash
pip install universal-host-manager-mcp

Next: run uhm-setup to generate your .env — see Configure below.

uv / pipx

Without polluting a project environment:

bash
uvx --from universal-host-manager-mcp uhm-setup

This installs into a throwaway environment, runs the setup wizard, and writes .env in the current directory. From then on, run the server itself the same way: uvx universal-host-manager-mcp.

From source (for development)

bash
git clone https://github.com/Abktya/universal-host-manager-mcp.gitcd universal-host-manager-mcppython3 -m venv .venvsource .venv/bin/activatepip install -e .

Next: run uhm-setup to generate your .env — see Configure below.

Configure

The easiest way is the interactive setup wizard, installed alongside the server:

bash
uhm-setup

Run it from the directory where you want to keep the configuration. The server must later be started from that same directory so it can find .env.

For a first test, choose 1 — Local-only test. Press Enter to accept the port 8765; the port prompt expects a number, not y or n. This mode:

  • creates a separate workspace directory by default;
  • listens only on 127.0.0.1, so other computers cannot connect;
  • requires no domain, tunnel, or Auth0 account;
  • enables unauthenticated access only for that local test.

The wizard also offers Cloudflare Tunnel, an ngrok static domain, and an existing HTTPS URL for remote use. Remote modes require Auth0 and will not write a misleading, unusable configuration if Auth0 is skipped. It validates domains and URLs, then writes .env with 600 permissions—backing up an existing file to .env.bak first.

If a virtual environment is active, install and run both commands through that environment:

bash
python -m pip install universal-host-manager-mcpuhm-setupuniversal-host-manager-mcp

To verify that the command belongs to the active environment on macOS/Linux:

bash
command -v uhm-setupcommand -v universal-host-manager-mcppython -m pip show universal-host-manager-mcp

The first two paths should normally point inside .venv/bin. If they point to /opt/homebrew/bin while a virtual environment is active, reinstall with python -m pip install universal-host-manager-mcp.

Prefer to do it by hand? Create a .env file (copy .env.example if you installed from source) with an explicitly restricted workspace:

dotenv
HOST=127.0.0.1PORT=8765MCP_BASE_URL=https://mcp.example.comMCP_WORKSPACE_DIR=/home/youruser/workspace
AUTH0_DOMAIN=your-tenant.eu.auth0.comAUTH0_CLIENT_ID=replace_meAUTH0_CLIENT_SECRET=replace_meAUTH0_AUDIENCE=https://mcp.example.com/

Never commit .env.

Auth0 setup

This project uses FastMCP's Auth0Provider fixed-client OAuth integration.

  1. Open auth0.com, create an account, and open the Auth0 Dashboard.

  2. Go to Applications → APIs → Create API.

  3. Use your public MCP URL as its Identifier (audience), for example https://mcp.example.com/. Keep RS256 as the signing algorithm.

  4. Go to Applications → Applications → Create Application, enter a name, select Regular Web Application, and create it.

  5. Set Application Ownership to First-party. Open Application > API Access, select the API you created, and enable User-delegated Access.

  6. On Auth0's Integrate into your application page, click Copy above the .env block. The wizard can import AUTH0_DOMAIN, AUTH0_CLIENT_ID, and AUTH0_CLIENT_SECRET from your clipboard or from a pasted block. If Auth0 displays MASKED, reveal and copy the real Client Secret from the application's Settings tab; masked secrets are rejected.

  7. Copy the API's Identifier into AUTH0_AUDIENCE when the wizard asks for it. It is intentionally separate because Auth0's application .env block does not contain the API audience.

  8. In the Auth0 application's Settings, use the MCP server's public origin (without /mcp) as follows:

    Auth0 fieldValue
    Application OwnershipFirst-party
    Application TypeRegular Web Application
    Application Login URILeave blank
    Allowed Callback URLshttps://mcp.example.com/auth/callback
    Allowed Logout URLshttps://mcp.example.com
    Allowed Web Originshttps://mcp.example.com
    Allowed Origins (CORS)https://mcp.example.com
    Allow Cross-Origin AuthenticationOff / disabled
    Cross-Origin Verification Fallback URLLeave blank
    API Identifier / Audiencehttps://mcp.example.com/
    Signing AlgorithmRS256
    Application > API AccessUser-delegated Access enabled for the created API
    MCP endpoint (entered in the AI client, not Auth0)https://mcp.example.com/mcp
  9. Save the Auth0 application settings, then run the wizard. Never share the Client Secret or commit .env to Git.

The callback above is FastMCP's fixed upstream callback. Do not put Claude, ChatGPT, or Grok callback URLs into Auth0: those products are downstream MCP clients and FastMCP validates their redirect URIs separately during MCP client registration. Connect each product to https://mcp.example.com/mcp.

Auth0's Python quickstart also shows AUTH0_SECRET, APP_BASE_URL, PORT, and sample Flask code. They belong to Auth0's standalone sample web application and are not used by this MCP server; the wizard safely ignores them when importing the copied block.

Client notes:

  • ChatGPT supports MCP OAuth client registration with CIMD and DCR. The server allows https://chatgpt.com/connector_platform_oauth_redirect; add the public /mcp endpoint in ChatGPT developer mode.
  • Claude custom connectors accept the public /mcp endpoint and start OAuth when you connect.
  • Grok custom connectors accept a publicly reachable MCP server URL and complete any required authentication. Grok availability may depend on the current Grok plan and workspace controls.

FastMCP also supports an Auth0 MCP-native/DCR path through Auth0MCPProvider. This repository currently uses the manually managed, fixed-client Auth0Provider path.

Run

bash
universal-host-manager-mcp

(Running from a source checkout with the .venv activated works the same way — the console script is installed by pip install -e ..)

With the default port, the Streamable HTTP endpoint is:

text
http://127.0.0.1:8765/mcp

For an intentional local-only test without Auth0:

bash
ALLOW_INSECURE_NO_AUTH=true universal-host-manager-mcp

Do not use insecure mode on a publicly reachable endpoint.

After starting the server (and the tunnel for remote mode), verify it:

bash
curl -i https://mcp.example.com/mcp# Expected without a token: HTTP 401
curl -i https://mcp.example.com/.well-known/oauth-authorization-server# Expected: HTTP 200

The server and tunnel must remain running; closing either makes a tunneled endpoint unavailable.

Cloudflare Tunnel

Install cloudflared, authenticate it and create a named tunnel:

bash
cloudflared tunnel logincloudflared tunnel create universal-host-manager-mcpcloudflared tunnel route dns universal-host-manager-mcp mcp.example.com

Create ~/.cloudflared/config.yml:

yaml
tunnel: YOUR_TUNNEL_IDcredentials-file: /home/youruser/.cloudflared/YOUR_TUNNEL_ID.json
ingress:  - hostname: mcp.example.com    service: http://127.0.0.1:8765  - service: http_status:404

Validate and run it:

bash
cloudflared tunnel ingress validatecloudflared tunnel run universal-host-manager-mcp

Keep both universal-host-manager-mcp and cloudflared running. Closing either process takes the public endpoint offline. The setup wizard can create an executable uhm-enable-autostart.sh installer. It writes Linux systemd-user services or macOS LaunchAgents for both processes and shows one command to run.

Your remote MCP URL will be:

text
https://mcp.example.com/mcp

Set MCP_BASE_URL=https://mcp.example.com; do not include /mcp in MCP_BASE_URL.

No domain? Use ngrok's free static domain

Auth0 OAuth needs a stable HTTPS URL, but you don't need to own a domain to get one. Unlike ngrok's old random URLs (which changed every restart) or Cloudflare's login-free quick tunnels (same problem), ngrok's free tier includes one static subdomain per account that never changes, at no cost.

  1. Create a free account at ngrok.com. On macOS install it with brew install ngrok/ngrok/ngrok; on Ubuntu use sudo snap install ngrok. Other Linux distributions can use ngrok's official download instructions.

  2. Open the ngrok authtoken page, copy your token, and run:

    bash
    ngrok config add-authtoken YOUR_NGROK_TOKEN

    Use the authtoken, not the domain ID. Never share it; reset it in the dashboard if it is exposed.

  3. Claim your free static domain from the ngrok dashboard (Domains → New Domain). You'll get something like your-name.ngrok-free.dev.

  4. Start universal-host-manager-mcp from the directory containing .env.

  5. In a second terminal, start the tunnel:

    bash
    ngrok http --url=your-name.ngrok-free.dev 8765

    Both processes must remain running. Closing either one takes the public endpoint offline. The wizard can create uhm-enable-autostart.sh, which installs Linux systemd-user services or macOS LaunchAgents for both processes.

  6. Set MCP_BASE_URL=https://your-name.ngrok-free.dev in .env (keep HOST=127.0.0.1; ngrok forwards to the local port while the server listens only on loopback).

  7. In Auth0, set the application's callback URL to https://your-name.ngrok-free.dev/auth/callback; set web origins and logout URLs to https://your-name.ngrok-free.dev (see Auth0 setup).

Your remote MCP URL is:

text
https://your-name.ngrok-free.dev/mcp

This is a good fit for personal use or a small number of clients. For production traffic at scale, ngrok's free tier applies connection/bandwidth limits — check their pricing page if you outgrow it, or switch to the domain-based Cloudflare Tunnel setup above.

AWS EC2 Deployment

These steps deploy the server on an EC2 instance and expose it safely to remote MCP clients.

1. Launch the instance

  • AMI: Ubuntu 24.04 LTS (the commands below are for Ubuntu/apt; on Amazon Linux 2023 use sudo dnf install -y python3-pip instead)
  • Instance type: t3.micro/t3.small is enough for typical management workloads
  • Security group: allow inbound SSH (22) from your own IP only. No other inbound port is required if you use the Cloudflare Tunnel option below.

2. Install the server

SSH into the instance, then install from PyPI:

bash
sudo apt update && sudo apt install -y python3-pip python3-venvpython3 -m venv ~/uhm-venvsource ~/uhm-venv/bin/activatepip install universal-host-manager-mcp

3. Configure

bash
mkdir -p ~/workspacecat > ~/.env << 'EOF'HOST=127.0.0.1PORT=8765MCP_BASE_URL=https://mcp.example.comMCP_WORKSPACE_DIR=/home/ubuntu/workspace
AUTH0_DOMAIN=your-tenant.eu.auth0.comAUTH0_CLIENT_ID=replace_meAUTH0_CLIENT_SECRET=replace_meAUTH0_AUDIENCE=https://mcp.example.com/EOFchmod 600 ~/.env

Keep HOST=127.0.0.1. The server should never listen directly on the instance's public interface — internet exposure is handled entirely by the tunnel or load balancer described below, not by opening the instance's own port.

4. Networking: get an HTTPS URL to the instance

Auth0 OAuth requires HTTPS. Pick one option:

Option A — Cloudflare Tunnel (recommended, no inbound port needed)

Run the steps from the Cloudflare Tunnel section above, from the EC2 instance. Because the tunnel is an outbound-only connection, you don't need to open any inbound port beyond SSH, don't need an Elastic IP, and the instance can even sit in a private subnet behind a NAT gateway.

Don't own a domain? Run the steps from No domain? Use ngrok's free static domain above instead — same outbound-only, no-inbound-port setup, just from the EC2 instance.

Option B — Application Load Balancer with an ACM certificate

  • Request an ACM certificate for your domain and attach it to an ALB
  • Create an HTTPS (443) listener on the ALB forwarding to the instance's PORT
  • Security group on the instance: allow inbound PORT only from the ALB's security group, never from 0.0.0.0/0
  • Point your DNS at the ALB and set MCP_BASE_URL to that hostname

5. Run as a systemd service

Reuse the included unit (see Background service below):

bash
sudo cp examples/mcp-manager.service /etc/systemd/system/# edit User=, WorkingDirectory=, EnvironmentFile= and ExecStart= to point at# ~/uhm-venv/bin/universal-host-manager-mcp and ~/.envsudo systemctl daemon-reloadsudo systemctl enable --now mcp-managersudo systemctl status mcp-manager --no-pager

6. Elastic IP

Not required for either networking option. The Cloudflare Tunnel connects outbound regardless of the instance's address, and an ALB registers targets by instance ID or private IP, so it doesn't need one either. Only add an Elastic IP if something else in your setup depends on a fixed public IP for this instance.

ChatGPT and Claude

Add the public Streamable HTTP URL to the client's MCP/connector configuration:

text
https://mcp.example.com/mcp

Complete the Auth0 sign-in when the client opens the authorization flow. The exact settings screens and supported connector options can change, so follow the current client documentation rather than using legacy SSE instructions.

Multiple clients can connect to the same running HTTP server. Each client authenticates independently; no separate server process or port is required.

Background service

Linux systemd

Copy and edit the included unit:

bash
sudo cp examples/mcp-manager.service /etc/systemd/system/sudo systemctl daemon-reloadsudo systemctl enable --now mcp-managersudo systemctl status mcp-manager --no-pager

The example uses systemd hardening directives. Adjust ReadWritePaths, ProtectHome, the user, paths and permissions to match the resources the MCP server genuinely needs.

macOS launchd

Edit paths in examples/com.user.mcpmanager.plist, then:

bash
cp examples/com.user.mcpmanager.plist ~/Library/LaunchAgents/launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.user.mcpmanager.plistlaunchctl kickstart -k gui/$(id -u)/com.user.mcpmanager

macOS Remote Access Readiness Test

For a remote macOS installation, uhm-setup ends by asking:

text
Run macOS Remote Access Readiness Test now? [Y/n]

Run this while you are physically beside the Mac. Select only the capabilities you expect to use remotely. The wizard can test workspace read/write access, trigger a read-only Google Chrome Automation request, and open the exact macOS Privacy & Security panes for protected files, Accessibility, and Screen Recording. Opening an application or an ordinary URL does not itself require an extra privacy permission.

macOS deliberately requires the user to approve TCC privacy prompts. The wizard does not bypass or click them. It shows the exact server executable path, asks you to approve each selected permission, and prints a readiness report. If a permission is not prepared before unattended use, a later remote task can stop at a dialog that requires somebody at the Mac.

Full Disk Access, Automation, Accessibility, and similar grants may be tied to the executable or installation path involved. Recreating a virtual environment, switching Python versions, or reinstalling elsewhere can require approval again. After changing a privacy permission, restart the MCP LaunchAgent before relying on it remotely.

Configuration

VariableDefaultDescription
HOST127.0.0.1Listen address
PORT8765Listen port
MCP_BASE_URLlocal URLPublic OAuth base URL, without /mcp
MCP_WORKSPACE_DIRuser homeBoundary for file tools and command working directory
MAX_OUTPUT_CHARS64000Maximum returned tool-output characters
DEFAULT_CMD_TIMEOUT300Default command timeout in seconds
MAX_CMD_TIMEOUT1800Maximum accepted command timeout
MAX_READ_BYTES5000000Maximum file size read by read_file
MAX_WRITE_BYTES5000000Maximum content size written by write_file
LOG_LEVELINFOPython log level
LOG_COMMANDSfalseLog run_command's command text (may contain secrets) instead of just its timeout
FASTMCP_CHECK_FOR_UPDATESoff (forced unless you set it)FastMCP's own PyPI update-check on startup
ALLOW_INSECURE_NO_AUTHfalseExplicit local-development authentication bypass

Testing

bash
pip install -e ".[dev]"pytest tests/

CI runs the suite against fastmcp 2.13, 3.x and 4.x on every push (see the badge above), since @mcp.tool()'s return type changed between major versions and tests call tools through a small version-agnostic helper (tests/conftest.py::call_tool) to cover all three.

Download

Clone with Git:

bash
git clone https://github.com/Abktya/universal-host-manager-mcp.git

Or use Code → Download ZIP on GitHub.

License

MIT

來源:README.md,提交 b66f766

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

7
  1. v0.1.15最新Sep 29, 2026
  2. v0.1.12Sep 23, 2026
  3. v0.1.11Sep 22, 2026
  4. v0.1.10Sep 22, 2026
  5. v0.1.7Sep 21, 2026
  6. v0.1.4Sep 21, 2026
  7. v0.1.2Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Host 整合