mcp-oauth-remote-gateway
하는 일
원격 Hermes 게이트웨이에 연결된 MCP 서버의 OAuth 로그인을 직접 처리한 뒤, 토큰을 Hermes가 찾는 위치에 저장합니다. 컨테이너, VPS, 기타 원격 장비에서 Hermes를 실행하는 사람을 위한 것입니다.
사용하는 경우
- ✓원격 Hermes 설정에서 OAuth 로그인이 필요한 원격 MCP 서버를 추가하고 싶을 때.
- ✓Hermes가 서버에서 실행되어 일반 OAuth 브라우저 흐름이 실패할 때.
- ✓다시 불러온 뒤에도 브라우저 로그인을 반복하지 않고 싶을 때.
스킬 링크
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mcp/mcp-oauth-remote-gateway/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“VPS에 있는 제 Hermes 게이트웨이에 Linear MCP 서버를 연결해 주세요. 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 앱이나 개인 액세스 토큰을 대신 사용하세요.
서버에서는 왜 일반 흐름이 깨지나요?
콜백 주소가 원격 서버가 아니라 자신의 컴퓨터를 가리켜서 로그인 코드가 도착하지 않기 때문입니다.
상세 정보
인기도
- GitHub 스타
- 260k
- 순위
- #504
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
agent-merge-conflict-arbiter
260k병렬로 작업한 두 에이전트 브랜치 사이의 git 병합 충돌을 중립적인 제3자로서 해결하고, 저장소에 하나의 병합 결과를 만듭니다.
antigravity-cli
260kAntigravity 명령줄 도구의 설치, 업데이트, 플러그인, 로그인, 샌드박스 문제를 해결하도록 단계별로 안내합니다.
blackbox
260k에이전트가 여러 AI 모델을 실행해 최선의 결과를 고르는 Blackbox AI 명령줄 도구에 코딩 작업을 맡기도록 돕습니다.
dynamic-workflow
260k많은 비슷한 작업을 저장된 스크립트로 실행하고, 검증된 결과만 메인 대화로 돌아오도록 에이전트에게 가르칩니다.
비슷한 스킬
mcporter
394k에이전트가 HTTP나 stdio로 MCP 서버와 그 도구를 목록화하고, 호출하고, 점검하며, 로그인 설정을 관리하도록 돕습니다.
chatgpt-app-builder
144kmcp-use 프레임워크와 OpenAI Apps SDK를 사용해 대화형 위젯이 있는 ChatGPT 앱을 만드는 것을 에이전트가 돕습니다.
mcp-apps-builder
144kmcp-use 모범 사례에 따라 도구, 리소스, 프롬프트, 위젯을 갖춘 MCP 서버를 만들고 고치도록 돕습니다.