mcp-oauth-remote-gateway
Что он делает
Скилл проводит вход OAuth вручную для MCP-сервера, подключённого к удалённому шлюзу Hermes, и затем сохраняет токены туда, где их ожидает Hermes. Он нужен тем, кто запускает Hermes в контейнере, на VPS или на другой удалённой машине.
Когда использовать
- ✓Когда вы хотите добавить удалённый MCP-сервер, которому нужен вход OAuth, на удалённой установке Hermes.
- ✓Когда обычный браузерный вход OAuth не работает, потому что Hermes запущен на сервере.
- ✓Когда вы хотите не повторять вход через браузер после перезагрузки.
Ссылка на скилл
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mcp/mcp-oauth-remote-gateway/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Подключи наш MCP-сервер Linear к моему шлюзу Hermes на VPS, которому нужен вход OAuth.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Агент проводит вас через вход в браузере, принимает код авторизации и записывает токены в файлы, которые использует Hermes. При последующих перезапусках он находит сохранённые токены и пропускает вход через браузер.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
MCP OAuth on a Remote Hermes Gateway
Overview
Hermes' built-in MCP OAuth client runs a one-shot HTTP listener on 127.0.0.1:<port>
inside the Hermes process and registers that loopback address as the OAuth
redirect_uri. That works perfectly for a local CLI on the user's own machine.
It breaks completely when Hermes runs as a remote gateway (container, VPS,
messaging bot), because the user's browser resolves 127.0.0.1 to the user's own
laptop, not the remote container — so the authorization code never reaches Hermes.
This skill does the OAuth dance by hand and writes the resulting tokens into the
exact files Hermes' token storage expects, so a subsequent /reload-mcp finds
cached tokens and skips the browser flow entirely.
When to Use
Use this skill when all of the following are true:
- The user wants to add a remote HTTP MCP server that requires OAuth (not a static Bearer token).
- Hermes is running as a remote gateway (container, VPS, Docker, managed service) — NOT a local CLI on the user's laptop.
- The server supports OAuth 2.1 with PKCE and RFC 7591 Dynamic Client Registration (most modern MCP servers do — Better Stack, Linear, Cloudflare, Datadog, etc.). If it doesn't support DCR (GitHub is the notable exception), this skill does not apply — use a pre-registered OAuth App or a Personal Access Token instead.
Do NOT use this for:
- Local CLI Hermes — just set
auth: oauthinmcp_servers.<name>and/reload-mcp. The built-in flow opens a browser and captures the callback on localhost. Works perfectly. - Servers that accept a static Bearer token (API key) — always prefer
headers.Authorization: "Bearer <token>"when the user is willing. Simpler, no refresh dance. - GitHub Copilot MCP (
api.githubcopilot.com/mcp/) — GitHub does not expose DCR. Use a PAT or a pre-registered OAuth App (see pitfall 12).
Why the Built-in OAuth Flow Fails on a Remote Gateway
Hermes' native MCP OAuth client (tools/mcp_oauth.py):
- Picks a free local port
P. - Registers a dynamic OAuth client with the AS, sending
redirect_uri = http://127.0.0.1:P/callback. - Starts an HTTP server on
127.0.0.1:Pinside the Hermes process. - Prints the authorize URL and waits for the code at its local endpoint.
When Hermes runs remotely, the 127.0.0.1 in the redirect_uri is the remote
container's loopback, not the user's. After authorizing, the user's browser 302s
to http://127.0.0.1:P/callback?code=..., which resolves to the user's own
laptop and fails to connect. The callback never reaches the Hermes process, the
flow times out, and /reload-mcp returns "No MCP tools available" with no detail.
Symptoms to recognize: [xdg-open] <defunct> processes under the hermes user, an
empty or missing tokens directory ($HERMES_HOME/mcp-tokens/), and a reload that
responds without any "Added/Reconnected: X" line in change_detail.
Cheap First Fallbacks: the Built-in Flow's Own Escape Hatches
Before any manual token surgery, check whether the built-in flow's fallbacks
already cover the deployment. When Hermes detects a remote session it prints two
options alongside the authorize URL (tools/mcp_oauth.py):
- Paste-back — on an interactive TTY, a stdin reader races the HTTP
listener. The user authorizes, the browser fails to connect to
127.0.0.1:<port>, and they paste the full address-bar URL (?code=...&state=...) back at the prompt. Works for SSH'd-in CLI sessions. - SSH port-forward —
ssh -N -L <port>:127.0.0.1:<port> <user>@<host>makes the redirect reach the remote listener normally.
Both require an interactive terminal to the Hermes host. The rest of this skill
is for when there is NO interactive TTY — Hermes running purely as a messaging
gateway/bot where /reload-mcp triggers the flow with nobody at a prompt.
Preferred Front Door: the Hermes Dashboard (try this BEFORE manual token surgery)
A remote Hermes gateway often also runs the dashboard web UI as a SEPARATE
process (e.g. hermes dashboard --host 0.0.0.0 --port <port>; check with
ps aux | grep 'hermes dashboard'). It exposes a connector/MCP console —
endpoints like /api/mcp/servers, /api/mcp/status, and /connectors (all
login-gated; a cookieless curl returning 401/302 confirms they exist).
Why the dashboard solves the core problem: when the user drives OAuth from the dashboard in their own browser, the redirect lands in a context the dashboard can capture — sidestepp
Частые вопросы
Когда этот скилл не применяется?
Скилл велит не использовать его для установки Hermes на вашем компьютере, там можно пользоваться обычным входом.
Что делать, если сервер не поддерживает динамическую регистрацию?
Скилл указывает, что он в этом случае не подходит, поэтому используйте заранее зарегистрированное приложение OAuth или персональный токен доступа.
Почему обычный вход ломается на сервере?
Адрес обратного вызова указывает на ваш компьютер, а не на удалённый сервер, поэтому код входа туда не приходит.
Подробности
Оригинальное описание автора
Manual OAuth for remote MCP servers on headless gateways.
Популярность
- Звёзды на GitHub
- 260k
- Место в рейтинге
- #504
- Лицензия
- MIT
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
agent-merge-conflict-arbiter
260kРазрешает конфликт слияния git между ветками двух агентов как нейтральная третья сторона и создает один объединенный результат для репозитория.
antigravity-cli
260kПомогает установить, обновить и устранить неполадки в командной строке Antigravity, включая плагины, вход в аккаунт и песочницу.
blackbox
260kПозволяет агенту передать задачу по коду инструменту командной строки Blackbox AI, который запускает несколько ИИ-моделей и выбирает лучший результат.
dynamic-workflow
260kУчит агента выполнять большие пакеты однотипной работы как сохраненный скрипт, чтобы в основной разговор возвращались только проверенные результаты.
Похожие скиллы
mcporter
394kПомогает агенту выводить список, вызывать и проверять серверы MCP и их инструменты по HTTP или stdio, а также управлять настройками входа.
chatgpt-app-builder
144kПомогает агенту создавать приложения для ChatGPT с интерактивными виджетами, используя фреймворк mcp-use и OpenAI Apps SDK.
mcp-apps-builder
144kПомогает агенту создавать и исправлять MCP-серверы с инструментами, ресурсами, промптами и виджетами по лучшим практикам фреймворка mcp-use.