HostGate MCP
Enables an MCP client to safely access selected local files and trusted executables with policy control, audit, and rollback via a Windows control center.
README
HostGate MCP
A Windows-first local capability control plane for MCP clients.
HostGate MCP gives an MCP client explicitly authorized access to selected local files and trusted command-line programs, with a desktop Control Center for policy, audit, rollback, diagnostics, and service lifecycle management.
The execution model is intentionally narrower than a general-purpose terminal: top-level cmd.exe, Windows PowerShell, and pwsh are not exposed as trusted execution tools. Allowed executables are resolved to fixed paths and launched directly.
Why HostGate exists
Reading local files through MCP is straightforward. Safely exposing write and process execution capabilities to a remote AI client is harder.
HostGate focuses on that control plane:
- explicit read / write / deny roots;
- transactional policy edits with diff review and rollback;
- permissions hot reload without restarting the MCP service;
- trusted executable allowlist with exact-path resolution;
- audited direct-process execution without a general-purpose shell;
- Windows Job Object process-tree containment;
- local audit history, configuration revisions, policy simulation, and diagnostics;
- a bilingual Windows Control Center (
zh-CN/en-US); - Scheduled Task lifecycle management;
- local stdio and OAuth-protected Streamable HTTP modes;
- PyInstaller
onedirand portableonefileControl Center builds.
Security model
MCP client
|
| OAuth / stdio
v
HostGate MCP
|
+-- Filesystem policy
| read roots
| write roots
| deny paths
|
+-- Direct execution policy
| trusted executable allowlist
| exact path resolution
| no general-purpose shell
| stdin disabled / bounded output
| Windows Job Object lifetime
|
+-- Control plane
GUI / audit / revisions
diagnostics / rollback
Important boundary
HostGate MCP is not an operating-system filesystem sandbox.
The filesystem policy controls HostGate's own file tools and the working directory accepted by exec_command. Once an authorized executable starts, that program and its descendants run with the OS privileges of the MCP service account and may access resources that account can access.
The executable allowlist constrains the top-level process. It does not sandbox descendants spawned by an authorized program.
Read SECURITY.md and docs/THREAT_MODEL.md before exposing the service beyond localhost.
Control Center
The Windows Control Center provides six pages:
- Service — status, PID, Scheduled Task start/stop/restart.
- Permissions — browse and manage read/write/deny roots.
- Execution — manage trusted CLI programs.
- Policy — simulate effective permissions and restore configuration revisions.
- Diagnostics — validate service/config/audit/revision state and export a redacted report.
- Audit — review recent file mutation and process execution events.
Policy changes use a transaction flow rather than editing TOML directly:
candidate
-> validate
-> review diff
-> stale SHA256 check
-> save previous revision
-> atomic replace
-> hot reload or controlled restart
-> health check / rollback
Safe public defaults
The repository starts fail-closed:
- no read roots;
- no write roots;
- no user-defined deny paths (control-plane paths are denied automatically);
- only the Windows
where.exeutility is trusted initially; - OAuth URLs point to
127.0.0.1:8000; - no real password hash, token database, audit data, or user policy is included.
Grant only the directories and executables you actually need from the Control Center.
Installation
Requirements:
- Windows 10/11;
- Python 3.10+;
uvrecommended.
Core server + GUI installation:
cd C:\path\to\hostgate-mcp
uv sync --no-dev
Copy-Item config\secrets.example.toml config\secrets.toml
The default installation includes filesystem/text/CSV/mutation/exec tools, OAuth HTTP support, and the Control Center. Format-specific readers are optional:
uv sync --extra excel # Excel tools
uv sync --extra pdf # PDF tools
uv sync --extra image # image tools
uv sync --extra pytorch # PyTorch checkpoint tools
uv sync --extra all # all optional tool families
For development and the complete test suite:
uv sync --all-extras
.venv\Scripts\python.exe -m pytest -q
Set a real Argon2id owner password hash in config\secrets.toml, then configure roots and trusted executables before exposing the HTTP service.
Run the Control Center:
scripts\start_control_center.ps1
Install the Windows Scheduled Task when you are ready to run HostGate at logon:
scripts\install_server_task.ps1
Windows Control Center builds
Recommended onedir build:
scripts\build_control_center.ps1
Portable onefile build:
scripts\build_control_center.ps1 -OneFile
Build artifacts are intentionally excluded from source control.
Optional tool families
With every optional extra installed, HostGate exposes the full reader set developed for the private 1.4 line, including Excel, PDF, image, and PyTorch inspection tools. Without an extra, that tool family is simply not registered; the rest of the MCP server remains usable.
This keeps the default install focused on the RWX/control-plane use case instead of forcing every user to install large scientific dependencies such as PyTorch.
Project status
Current public-preparation version: 1.4.0rc1.
The public repository is created from a clean, history-free export of the tested private development line. Private Git history, production policy, OAuth state, logs, secrets, and build output are intentionally excluded.
Non-goals
HostGate is not trying to become:
- a full terminal emulator;
- a shell orchestration framework;
- an MCP marketplace or router;
- a cross-platform coding-agent replacement;
- a complete OS sandbox.
New capabilities should be added only when they solve a demonstrated operational or security problem.
Documentation
SECURITY.md— security boundaries and vulnerability reporting.docs/THREAT_MODEL.md— assumptions, protected assets, and out-of-scope guarantees.docs/control_center.md— Control Center architecture and policy transactions.docs/architecture.md— server architecture.docs/tools.md— MCP tool reference.CHANGELOG.md— release history.
License
Licensed under the Apache License 2.0. See NOTICE for attribution information.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。