Zum Inhalt springen
Skillpedia
Konnektoren (MCP)260k · #504

mcp-oauth-remote-gateway

Was er macht

Hier wird die OAuth-Anmeldung von Hand für einen MCP-Server übernommen, der mit einem entfernten Hermes-Gateway verbunden ist. Danach werden die Tokens dort gespeichert, wo Hermes sie erwartet. Der Skill ist für Menschen gedacht, die Hermes in einem Container, auf einem VPS oder einem anderen entfernten Rechner betreiben.

Wann du ihn nutzt

  • ✓Wenn du einen entfernten MCP-Server hinzufügen willst, der auf einem entfernten Hermes-Setup eine OAuth-Anmeldung verlangt.
  • ✓Wenn der normale OAuth-Browserablauf scheitert, weil Hermes auf einem Server läuft.
  • ✓Wenn du die Browseranmeldung nach einem Neustart nicht wiederholen willst.

Link zum Skill

https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mcp/mcp-oauth-remote-gateway/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mcp/mcp-oauth-remote-gateway/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Verbinde unseren Linear-MCP-Server mit meinem Hermes-Gateway auf dem VPS, der eine OAuth-Anmeldung verlangt.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Agent führt dich durch die Anmeldung in deinem Browser, nimmt den Autorisierungscode entgegen und schreibt die Tokens in die Dateien, die Hermes verwendet. Bei späteren Neustarts findet Hermes die gespeicherten Tokens und überspringt den Browserablauf.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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:

  1. The user wants to add a remote HTTP MCP server that requires OAuth (not a static Bearer token).
  2. Hermes is running as a remote gateway (container, VPS, Docker, managed service) — NOT a local CLI on the user's laptop.
  3. 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: oauth in mcp_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):

  1. Picks a free local port P.
  2. Registers a dynamic OAuth client with the AS, sending redirect_uri = http://127.0.0.1:P/callback.
  3. Starts an HTTP server on 127.0.0.1:P inside the Hermes process.
  4. 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):

  1. 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.
  2. 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

Häufige Fragen

Wann gilt dieser Skill nicht?

Der Skill sagt, er gilt nicht für eine Hermes-Installation auf deinem eigenen Rechner. Dort kann der normale Anmeldeablauf genutzt werden.

Was ist, wenn der Server keine dynamische Registrierung unterstützt?

Laut Skill trifft dieser Fall nicht zu. Verwende stattdessen eine vorab registrierte OAuth-App oder ein persönliches Zugriffstoken.

Warum scheitert der normale Ablauf auf einem Server?

Seine Callback-Adresse zeigt auf deinen eigenen Rechner statt auf den entfernten Server, daher kommt der Anmeldecode nie an.

Details

Originalbeschreibung des Autors

Manual OAuth for remote MCP servers on headless gateways.

repo: NousResearch/hermes-agent

Beliebtheit

GitHub-Sterne
260k
Platz im Ranking
#504
Lizenz
MIT
Aktualisiert
2.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills