Connect your server to ChatGPT chats.
Hostgate runs an OAuth-protected MCP server on your machine. After adding it as a ChatGPT developer-mode app, you can select Hostgate in a chat and ask it to inspect the host, read or write files, and run shell commands.
Warning
Hostgate provides host-level access. Treat it like exposing SSH through ChatGPT: use strong credentials, HTTPS, and only run it on machines you intend to operate this way.
| Tool | What it does |
|---|---|
status |
Returns hostname, OS, uptime, load, CPU, and memory details. |
read |
Reads a UTF-8 text file by absolute path, or relative to the service user's home directory. |
write |
Writes a UTF-8 text file by absolute path, or relative to the service user's home directory. |
shell |
Runs a Bash command with /bin/bash -lc. |
Important
File paths are not sandboxed after OAuth authorization.
- Node.js
22or newer - Linux with
systemd --user - Public HTTPS access for ChatGPT
- Tailscale CLI, optional, for automatic Funnel setup during onboarding
npm install -g hostgate
hostgate onboardhostgate onboard is the main setup flow. It:
- writes configuration to
~/.config/hostgate/.env - installs or updates
~/.config/systemd/user/hostgate.service - enables and restarts the service
- optionally exposes Hostgate through Tailscale Funnel at
/hostgate - prints the ChatGPT app setup guide
When Tailscale Funnel is enabled, Hostgate is exposed as:
https://your-host.example/hostgate/mcp
Internally, this maps to:
/hostgate -> http://127.0.0.1:8787/hostgate
After onboarding:
- Open the ChatGPT website.
- Go to
Settings->Apps->Advanced settings. - Enable
Developer Mode. - Create an app.
- Enter the app details:
Name:HostgateDescription:Remote host operationsMCP Server URL: the/hostgate/mcpURL printed by onboardingAuthentication:OAuth
- Open
Advanced OAuth settingsonly if you need to choose scopes. - Check
I understand and want to continue. - Click
Create. - Complete the OAuth flow with the username and password from onboarding.
- Start a new chat, press
+, selectHostgate, and ask it to run a task.
Note
ChatGPT memory is not available to developer-mode apps. Do not rely on saved memories being provided to Hostgate during testing.
hostgate onboard # configure, install, start, and optionally expose Hostgate
hostgate status # show systemd service status
hostgate logs -f # follow service logs
hostgate help # show helpHostgate requires OAuth before MCP tools can be listed or called.
OAuth client registrations and access tokens are stored locally:
~/.local/share/hostgate/oauth-state.json
Supported scopes:
all status read write shell
Each tool requires its matching scope. all grants every tool.
Onboarding manages ~/.config/hostgate/.env:
PORT=8787
HOST=127.0.0.1
HOSTGATE_OAUTH_USERNAME=
HOSTGATE_OAUTH_PASSWORD=The systemd service loads this file through EnvironmentFile. Direct npm start does not load .env automatically.
Ideas, bugs, and setup issues are welcome. Open a GitHub issue with what you tried, what happened, and any relevant hostgate logs -f output.
MIT