mcp-oauth-remote-gateway
यह क्या करती है
यह रिमोट Hermes गेटवे से जुड़े MCP सर्वर के लिए OAuth साइन-इन हाथ से करती है, और टोकन वहीं सेव करती है जहाँ Hermes उन्हें ढूँढता है। यह उन लोगों के लिए है जो Hermes को कंटेनर, VPS या किसी दूसरी रिमोट मशीन पर चलाते हैं।
कब इस्तेमाल करें
- ✓जब आप रिमोट Hermes सेटअप पर ऐसा रिमोट MCP सर्वर जोड़ना चाहें जिसे OAuth साइन-इन चाहिए।
- ✓जब Hermes सर्वर पर चलने के कारण सामान्य OAuth ब्राउज़र फ़्लो विफल हो जाए।
- ✓जब आप रीलोड के बाद दोबारा ब्राउज़र साइन-इन से बचना चाहें।
Skill का लिंक
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mcp/mcp-oauth-remote-gateway/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“हमारे Linear MCP सर्वर को मेरे VPS पर चल रहे Hermes गेटवे से जोड़िए, जिसे OAuth साइन-इन चाहिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट आपको अपने ब्राउज़र में साइन-इन करने में मदद करता है, authorization code लेता है, और टोकन उन फ़ाइलों में लिखता है जिन्हें 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 इंस्टॉल के लिए इस्तेमाल न करें, वहाँ सामान्य साइन-इन फ़्लो चल सकता है।
अगर सर्वर dynamic registration सपोर्ट न करे तो?
स्किल कहती है कि यह लागू नहीं होती, इसलिए पहले से रजिस्टर्ड OAuth ऐप या personal access token इस्तेमाल करें।
सर्वर पर सामान्य फ़्लो क्यों टूट जाता है?
उसका callback पता आपके अपने कंप्यूटर की ओर इशारा करता है, न कि रिमोट सर्वर की ओर, इसलिए साइन-इन कोड कभी नहीं पहुँचता।
जानकारी
लेखक का मूल विवरण
Manual OAuth for remote MCP servers on headless gateways.
लोकप्रियता
- GitHub स्टार
- 260k
- रैंकिंग में स्थान
- #504
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
agent-merge-conflict-arbiter
260kदो एजेंट्स की branches के बीच git merge conflict को एक निष्पक्ष तीसरे पक्ष के रूप में सुलझाती है और रिपॉज़िटरी के लिए एक merged नतीजा बनाती है।
antigravity-cli
260kAntigravity कमांड-लाइन टूल को इंस्टॉल करने, अपडेट करने और उसकी दिक्कतें सुलझाने में मार्गदर्शन देती है, जिसमें प्लगइन, साइन-इन और sandbox शामिल हैं।
blackbox
260kआपके एजेंट को कोडिंग काम Blackbox AI कमांड-लाइन टूल को सौंपने देती है, जो कई AI मॉडल चलाकर सबसे अच्छा नतीजा चुनता है।
dynamic-workflow
260kआपके एजेंट को बड़े बैच के एक जैसे कामों को सेव की गई स्क्रिप्ट के रूप में चलाना सिखाती है, ताकि मुख्य बातचीत में केवल जांचे गए नतीजे लौटें।
मिलती-जुलती skills
mcporter
394kयह आपके एजेंट को HTTP या stdio पर MCP सर्वर और उनके टूल सूचीबद्ध करने, चलाने और जांचने देती है, और उनकी साइन-इन सेटिंग्स प्रबंधित करती है।
chatgpt-app-builder
144kआपके एजेंट को mcp-use फ़्रेमवर्क और OpenAI Apps SDK से इंटरैक्टिव विजेट वाले ChatGPT ऐप बनाने में मदद करती है।
mcp-apps-builder
144kआपके एजेंट को mcp-use फ़्रेमवर्क की सर्वोत्तम प्रथाओं के अनुसार tools, resources, prompts और विजेट वाले MCP सर्वर बनाने और सुधारने में मदद करती है।