mcp-oauth-remote-gateway
Fungsinya
Skill ini menangani proses masuk OAuth secara manual untuk server MCP yang terhubung ke gateway Hermes jarak jauh, lalu menyimpan token di lokasi yang diharapkan Hermes. Skill ini ditujukan untuk orang yang menjalankan Hermes di kontainer, VPS, atau mesin jarak jauh lainnya.
Kapan dipakai
- βSaat Anda ingin menambahkan server MCP jarak jauh yang memerlukan masuk OAuth pada pengaturan Hermes jarak jauh.
- βSaat alur OAuth di browser gagal karena Hermes berjalan di server.
- βSaat Anda ingin menghindari masuk browser berulang setelah dimuat ulang.
Link skill
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mcp/mcp-oauth-remote-gateway/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βHubungkan server MCP Linear kami ke gateway Hermes di VPS saya, yang memerlukan masuk OAuth.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memandu Anda masuk di browser, mengambil kode otorisasi, lalu menulis token ke file yang digunakan Hermes. Pemuatan ulang berikutnya akan menemukan token yang tersimpan dan melewati alur browser.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Kapan skill ini tidak berlaku?
Skill menyatakan jangan dipakai untuk instalasi Hermes di komputer Anda sendiri, karena di sana dapat memakai alur masuk biasa.
Bagaimana jika server tidak mendukung pendaftaran dinamis?
Skill menyatakan skill ini tidak berlaku, sehingga gunakan aplikasi OAuth yang sudah terdaftar sebelumnya atau token akses pribadi.
Mengapa alur normal gagal di server?
Alamat callback-nya mengarah ke komputer Anda sendiri, bukan ke server jarak jauh, sehingga kode masuk tidak pernah sampai.
Detail
Deskripsi asli dari pembuat
Manual OAuth for remote MCP servers on headless gateways.
Popularitas
- Bintang GitHub
- 260k
- Peringkat
- #504
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
agent-merge-conflict-arbiter
260kMenyelesaikan konflik merge git antara cabang dua agent sebagai pihak ketiga yang netral, menghasilkan satu hasil gabungan untuk repo.
antigravity-cli
260kMemandu Anda memasang, memperbarui, dan memecahkan masalah alat baris perintah Antigravity, termasuk plugin, login, dan sandbox-nya.
blackbox
260kMemungkinkan agent Anda menyerahkan tugas pemrograman ke alat baris perintah Blackbox AI, yang menjalankan beberapa model AI dan memilih hasil terbaik.
dynamic-workflow
260kMengajari agent Anda menjalankan pekerjaan sejenis dalam jumlah besar sebagai skrip tersimpan, sehingga hanya hasil terverifikasi yang kembali ke percakapan utama.
Skill serupa
mcporter
394kMembantu agent Anda mendaftar, memanggil, dan memeriksa server MCP beserta alatnya lewat HTTP atau stdio, serta mengatur pengaturan login mereka.
chatgpt-app-builder
144kMembantu agent Anda membangun aplikasi ChatGPT dengan widget interaktif, memakai framework mcp-use dan OpenAI Apps SDK.
mcp-apps-builder
144kMembantu agent Anda membangun dan memperbaiki server MCP dengan alat, sumber daya, prompt, dan widget, mengikuti praktik terbaik framework mcp-use.