
skgate
io.github.helv-iov0.10.0更新於 Oct 4, 2026
MCP gateway: OAuth-protected endpoints for remote and hosted MCP servers, plus a Grok API.
概覽
自架的 OAuth 保護閘道,可代理遠端與本機託管的 MCP 伺服器,並提供以 Grok 為後端的 OpenAI 相容 API。
- 功能
- skgate 以單一容器執行,在 OAuth 2.1 之後託管 MCP 伺服器,可為每個上游提供獨立路徑,也可把多個上游彙整到單一端點。它能管理來自 npm、PyPI 或 git 儲存庫的 stdio 伺服器,依需求啟動並在閒置時停止,還能將 Grok 訂閱代理成帶虛擬金鑰與模型別名的 OpenAI 相容 API。管理員登入與設定透過網頁介面完成。
- 適用情境
- 當你想為多個 MCP 伺服器提供單一認證端點,或想透過 OpenAI 相容 API 使用 Grok 訂閱時,可以採用它。它適合家庭實驗室與小型部署,尤其是希望閒置的 MCP 程序不佔用記憶體的情境。
- 執行需求
- 需要本機容器執行環境(例如 Docker),以及一個帶機密用戶端的 OIDC 提供者。必要的環境變數:PUBLIC_URL、OIDC_ISSUER、OIDC_CLIENT_ID 與 OIDC_CLIENT_SECRET。完整映像還需要 Node.js、Python、uv、.NET、Go 與 git 來執行託管伺服器;slim 映像僅做代理。建議但不強制需要 Grok 訂閱。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 skgate,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
skgate
Use your Grok subscription as an OpenAI-compatible API, and serve your MCP servers from one OAuth-protected gateway.
Yes, all MCP servers: everyone's welcome. skgate can run them for you too, so no more stacks. It just works.
Name Origin
skgate /ɛsˈkɑːɡeɪt/ (ess-KAH-gate)
"sk" is what most AI API keys start with, or so I perceive it, and "gate" is for gateway. Bit rubbish as names go, but it's ours.
The plane in the logo is an inside joke. The public wouldn't understand it, and I'm not about to explain it. Sorry.
Quick start
Before you start: an OIDC provider with a confidential client for skgate (admin login is OIDC only). Just trying it on one machine? docs/quickstart.md runs skgate with a bundled provider and no accounts.
A Grok subscription is recommended but not required.
docker compose up -d- Open
https://skgate.example.com/adminand sign in through your OIDC provider. - status > Grok > Sign in: open the shown address, enter the code, approve.
- keys > enter a name > Create key. Copy the
sk-...key; it is shown once. - Use it: base URL
https://skgate.example.com/v1, API keysk-...(see Examples).- The base URL is forgiving:
/v1,/api,/api/v1and the bare host all reach the same API, so use whichever form your client expects.
- The base URL is forgiving:
Image tags:
latest: proxy + managed MCP servers (Node.js, Python, uv, .NET, Go, git)slim: proxy only
Upgrade: back up ./data, then docker compose pull && docker compose up -d.
Examples
curl: models and a chat completion
OpenAI client
Model alias: one name that always points at the newest model
Map grok-latest to the latest available model. Change the target in this one place and every app using grok-latest is upgraded at once, with no client config changes.
Grok > Details > Model aliases: alias grok-latest, target the newest model in the list (for example grok-4.7), Save.
Aliases are listed first in /v1/models.
Add an MCP server with Suggest configuration
Needs the latest image and Grok signed in. The first time, Pick MCP helper model next to the button opens the model picker right on the page.
mcp upstreams > Add upstream > Type managed (package or repository):
-
MCP source URL / package, one of:
-
Suggest configuration. skgate fetches the README and manifests (
package.json,pyproject.toml,server.json), the MCP helper model proposes command, args, install step and env names (marked secret or not, required or optional), and the Manual configuration fields are filled in with a confidence and any warnings. Nothing is saved yet. Point it at the repo, fill in the variables it needs, and it just works. -
Set an alias, fill in the variables you need (empty ones are not passed to the server), Save. The server is at
https://skgate.example.com/mcp/<alias>.
If the button is greyed out, hover it: sign in to Grok on status, or use Pick MCP helper model beside it.
MCP client: one upstream or all of them
Hosted connectors use OAuth (leave client ID and secret empty). Scripts and CLIs send a key:
On-demand MCP servers: no RAM while idle
On a RAM-constrained homelab, idle MCP servers should cost nothing. Managed servers (npx, uvx, git) are child processes of skgate. By default (Lifecycle on-demand) one starts on its first request and stops after 10 minutes without requests; the next request starts it again.
- Default is on-demand; Lifecycle
always-onstarts the server at boot instead. - The first request after a stop waits until the server answers
initialize(up to 60 s). - A server with a request in flight is never stopped. Stopping is SIGTERM, then SIGKILL after 5 s.
- Idle time is
idleTimeoutSecondsin import JSON (default 600; not in the form):
- The aggregated
/mcpincludes remote and always-on upstreams marked In /mcp. On-demand servers are left out, so/mcpnever starts them. Point a client at/mcp/<alias>to use one. - Remote upstreams have no process; there is nothing to idle.
- An admin Stop keeps a server stopped until Start or Restart.
Managed MCP server: npx (stdio)
mcp upstreams > import JSON > paste > Import. Needs the latest image.
Served at https://skgate.example.com/mcp/everything. For Python servers use "command": "uvx", "args": ["<package>"].
Managed MCP server: git repository
mcp upstreams > import JSON > paste > Import. skgate clones the repo, runs install, then the command.
Remote MCP server
mcp upstreams > Add upstream > Type remote (URL), or import:
Features
Comparison
As of 2026-10-02; check each provider's terms.
Sources
- xAI, Use Grok in OpenCode
- OpenAI, Sign in with ChatGPT
- Anthropic, Legal and compliance
- Google, Gemini CLI terms
- GitHub, Copilot now supports OpenCode
Configuration
Set under environment: (or env_file); placeholders in .env.example.
Grok needs no variables; its base URL and aliases are in its Details dialog.
Everything lives in /data (skgate.db, secrets.key): back up both.
Reverse proxy
Set PUBLIC_URL to the public https origin. No forward-auth on /v1, /mcp, /authorize, /token, /register, /.well-known. Only Traefik is tested by the author; open an issue with feedback.
Traefik
nginx
Caddy
HAProxy
Apache
OIDC setup
Without OIDC_* the admin answers 503. Every user your provider lets in is an admin: restrict the provider, or set OIDC_ALLOWED_EMAILS / OIDC_ALLOWED_GROUPS. Hints for Authelia, Authentik, Keycloak, Zitadel and Pocket ID: docs/oidc.md.
Security notes
- Virtual keys are stored as SHA-256 hashes; upstream credentials are AES-256-GCM encrypted.
/authorizeneeds an admin session.- Managed upstreams run admin-supplied commands; use the
slimimage to disable them. - A key can be allowed in the URL (
?key=) for clients that cannot send headers. It is off per key by default, because URLs leak into logs, history and referrers.
More: operations.
Built with AI assistance
skgate is built with AI assistance: coding agents write much of the code, tests and docs. The author reviews the changes and runs skgate.
Development
docs/development.md. Contributors and agents: AGENT.md.
License
MIT, see LICENSE.
來源:README.md,提交 9fcab95
工具
0版本歷史
1- v0.10.0最新Oct 4, 2026

