Files
docs/history/mcp-gateway-requirements/index.html
T

2228 lines
44 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="Single source of truth for the homelab">
<link rel="canonical" href="http://192.168.1.8:13080/history/mcp-gateway-requirements/">
<link rel="prev" href="../traefik-migration-docker-labels/">
<link rel="next" href="../scrubbing-list-2026-05-17/">
<link rel="icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
<title>MCP gateway requirements (superseded) - nuclide.systems docs</title>
<link rel="stylesheet" href="../../assets/stylesheets/main.484c7ddc.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/palette.ab4e12ef.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="slate" data-md-color-primary="black" data-md-color-accent="blue">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#mcp-gateway-reconstructed-design-spec-in-progress-phase-1" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../.." title="nuclide.systems docs" class="md-header__button md-logo" aria-label="nuclide.systems docs" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
nuclide.systems docs
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
MCP gateway requirements (superseded)
</span>
</div>
</div>
</div>
<form class="md-header__option" data-md-component="palette">
<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="black" data-md-color-accent="blue" aria-hidden="true" type="radio" name="__palette" id="__palette_0">
<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="black" data-md-color-accent="blue" aria-hidden="true" type="radio" name="__palette" id="__palette_1">
</form>
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
</button>
</nav>
<div class="md-search__suggest" data-md-component="search-suggest"></div>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<nav class="md-tabs" aria-label="Tabs" data-md-component="tabs">
<div class="md-grid">
<ul class="md-tabs__list">
<li class="md-tabs__item">
<a href="../.." class="md-tabs__link">
Home
</a>
</li>
<li class="md-tabs__item">
<a href="../../CHANGELOG/" class="md-tabs__link">
Changelog
</a>
</li>
<li class="md-tabs__item">
<a href="../../RESUME/" class="md-tabs__link">
Resume
</a>
</li>
<li class="md-tabs__item">
<a href="../../ct-inventory/" class="md-tabs__link">
CT inventory
</a>
</li>
<li class="md-tabs__item">
<a href="../../infra/proxmox-state/" class="md-tabs__link">
Infra
</a>
</li>
<li class="md-tabs__item">
<a href="../../services/homelab-architecture/" class="md-tabs__link">
Services
</a>
</li>
<li class="md-tabs__item">
<a href="../../security/data-leak-audit-comparison/" class="md-tabs__link">
Security & audits
</a>
</li>
<li class="md-tabs__item">
<a href="../../ideas/stack-ideas/" class="md-tabs__link">
Ideas
</a>
</li>
<li class="md-tabs__item md-tabs__item--active">
<a href="../traefik-migration/" class="md-tabs__link">
History
</a>
</li>
</ul>
</div>
</nav>
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary md-nav--lifted" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../.." title="nuclide.systems docs" class="md-nav__button md-logo" aria-label="nuclide.systems docs" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
</a>
nuclide.systems docs
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../.." class="md-nav__link">
<span class="md-ellipsis">
Home
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../CHANGELOG/" class="md-nav__link">
<span class="md-ellipsis">
Changelog
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../RESUME/" class="md-nav__link">
<span class="md-ellipsis">
Resume
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../ct-inventory/" class="md-nav__link">
<span class="md-ellipsis">
CT inventory
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5" >
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
<span class="md-ellipsis">
Infra
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
Infra
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../infra/proxmox-state/" class="md-nav__link">
<span class="md-ellipsis">
Proxmox state
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../infra/portmap/" class="md-nav__link">
<span class="md-ellipsis">
Port map
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../infra/storage/" class="md-nav__link">
<span class="md-ellipsis">
Storage
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../infra/volumes/" class="md-nav__link">
<span class="md-ellipsis">
Volumes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../infra/docker-networks/" class="md-nav__link">
<span class="md-ellipsis">
Docker networks
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../infra/connection-hosts/" class="md-nav__link">
<span class="md-ellipsis">
Connection hosts
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../infra/proxmox-memory-audit/" class="md-nav__link">
<span class="md-ellipsis">
Memory audit
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_6" >
<label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
<span class="md-ellipsis">
Services
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_6">
<span class="md-nav__icon md-icon"></span>
Services
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../services/homelab-architecture/" class="md-nav__link">
<span class="md-ellipsis">
Homelab architecture
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/dev-environment/" class="md-nav__link">
<span class="md-ellipsis">
Dev environment (Coder + Gitea)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/mcp-gateway/" class="md-nav__link">
<span class="md-ellipsis">
MCP gateway
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/mcp-servers/" class="md-nav__link">
<span class="md-ellipsis">
MCP servers
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/pocket-id/" class="md-nav__link">
<span class="md-ellipsis">
Pocket-ID (OIDC)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/backrest/" class="md-nav__link">
<span class="md-ellipsis">
Backrest (backups)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/databases/" class="md-nav__link">
<span class="md-ellipsis">
Databases
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/secrets-manager/" class="md-nav__link">
<span class="md-ellipsis">
Secrets manager
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/comfyui/" class="md-nav__link">
<span class="md-ellipsis">
ComfyUI
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/zoraxy/" class="md-nav__link">
<span class="md-ellipsis">
Zoraxy
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/adguard-dns/" class="md-nav__link">
<span class="md-ellipsis">
AdGuard DNS
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/cloud-gpu/" class="md-nav__link">
<span class="md-ellipsis">
Cloud GPU
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/arcane/" class="md-nav__link">
<span class="md-ellipsis">
Arcane
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/doc-ingestion/" class="md-nav__link">
<span class="md-ellipsis">
Doc ingestion pipeline
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../services/llm-benchmark/" class="md-nav__link">
<span class="md-ellipsis">
LLM benchmark
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_7" >
<label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
<span class="md-ellipsis">
Security & audits
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_7">
<span class="md-nav__icon md-icon"></span>
Security & audits
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../security/data-leak-audit-comparison/" class="md-nav__link">
<span class="md-ellipsis">
Comparison
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../security/data-leak-audit-2026-05-20-tr004-cloud-sandbox/" class="md-nav__link">
<span class="md-ellipsis">
2026-05-20 · cloud-sandbox breach
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../security/data-leak-audit-2026-05-21-tr004-artifacts/" class="md-nav__link">
<span class="md-ellipsis">
2026-05-21 · artifacts (clean)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../security/audit-claude-code-meta/" class="md-nav__link">
<span class="md-ellipsis">
Self-audit (Claude Code)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../security/transcripts/audit-chat-2026-05-21/" class="md-nav__link">
<span class="md-ellipsis">
Transcript (audit session)
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_8" >
<label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
<span class="md-ellipsis">
Ideas
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_8">
<span class="md-nav__icon md-icon"></span>
Ideas
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../ideas/stack-ideas/" class="md-nav__link">
<span class="md-ellipsis">
Stack ideas
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_9" checked>
<label class="md-nav__link" for="__nav_9" id="__nav_9_label" tabindex="">
<span class="md-ellipsis">
History
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_9">
<span class="md-nav__icon md-icon"></span>
History
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../traefik-migration/" class="md-nav__link">
<span class="md-ellipsis">
Traefik (abandoned 2026-05-16)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../traefik-migration-docker-labels/" class="md-nav__link">
<span class="md-ellipsis">
Traefik labels (abandoned)
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
MCP gateway requirements (superseded)
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
MCP gateway requirements (superseded)
</span>
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#1-goal-intent" class="md-nav__link">
<span class="md-ellipsis">
1. Goal / Intent
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#2-architecture-three-competing-models-in-repo-a-chosen-b-orphaned-c-aspirational" class="md-nav__link">
<span class="md-ellipsis">
2. Architecture (three competing models in-repo; A chosen, B orphaned, C aspirational)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#3-mcp-server-inventory-reconciled-serverpy-mcp_servers-is-authoritative" class="md-nav__link">
<span class="md-ellipsis">
3. MCP Server Inventory (reconciled — server.py MCP_SERVERS is authoritative)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#4-implemented-vs-unfinished-vs-broken" class="md-nav__link">
<span class="md-ellipsis">
4. Implemented vs Unfinished vs Broken
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#5-relevant-env-keys-names-only" class="md-nav__link">
<span class="md-ellipsis">
5. Relevant .env keys (names only)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#6-open-design-decisions-must-resolve" class="md-nav__link">
<span class="md-ellipsis">
6. Open Design Decisions (must resolve)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#7-recommended-path-ordered-lowest-risk-first" class="md-nav__link">
<span class="md-ellipsis">
7. Recommended Path (ordered, lowest-risk first)
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../scrubbing-list-2026-05-17/" class="md-nav__link">
<span class="md-ellipsis">
Scrubbing list (2026-05-17)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../case-study/" class="md-nav__link">
<span class="md-ellipsis">
Case study
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#1-goal-intent" class="md-nav__link">
<span class="md-ellipsis">
1. Goal / Intent
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#2-architecture-three-competing-models-in-repo-a-chosen-b-orphaned-c-aspirational" class="md-nav__link">
<span class="md-ellipsis">
2. Architecture (three competing models in-repo; A chosen, B orphaned, C aspirational)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#3-mcp-server-inventory-reconciled-serverpy-mcp_servers-is-authoritative" class="md-nav__link">
<span class="md-ellipsis">
3. MCP Server Inventory (reconciled — server.py MCP_SERVERS is authoritative)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#4-implemented-vs-unfinished-vs-broken" class="md-nav__link">
<span class="md-ellipsis">
4. Implemented vs Unfinished vs Broken
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#5-relevant-env-keys-names-only" class="md-nav__link">
<span class="md-ellipsis">
5. Relevant .env keys (names only)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#6-open-design-decisions-must-resolve" class="md-nav__link">
<span class="md-ellipsis">
6. Open Design Decisions (must resolve)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#7-recommended-path-ordered-lowest-risk-first" class="md-nav__link">
<span class="md-ellipsis">
7. Recommended Path (ordered, lowest-risk first)
</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<blockquote>
<p><strong>STATUS: SUPERSEDED 2026-05-17 — current implementation lives in services/mcp-gateway.md. Kept for design-rationale history.</strong></p>
</blockquote>
<hr />
<h1 id="mcp-gateway-reconstructed-design-spec-in-progress-phase-1">MCP Gateway — Reconstructed Design Spec (in-progress, "Phase 1")<a class="headerlink" href="#mcp-gateway-reconstructed-design-spec-in-progress-phase-1" title="Permanent link">&para;</a></h1>
<blockquote>
<p>Reconstructed 2026-05-16 from code/configs/git history. The gateway is a
single-squash-commit first draft (<code>0cad389 "Phase 1: Create MCP Gateway with
Docker-in-Docker support"</code>, preceded by <code>726bd10 "WIP: MCP gateway prep"</code>).
Nothing has a second iteration in git — everything below is first-draft intent.</p>
</blockquote>
<h2 id="1-goal-intent">1. Goal / Intent<a class="headerlink" href="#1-goal-intent" title="Permanent link">&para;</a></h2>
<p>A single <strong>OAuth-protected HTTP entrypoint at <code>https://mcp.nuclide.systems</code></strong> that
exposes a curated set of MCP servers to AI clients on the homelab. Primary
consumer: <strong>Claude.ai</strong> as a remote connector (SSE at <code>/</code>, every README's
"Usage in Claude.ai"). Secondary: <strong>LobeChat</strong> (<code>chat.nuclide.systems</code>) and
<strong>LiteLLM</strong> (<code>ai.nuclide.systems</code>), sharing the same Pocket ID OAuth app. It is
meant to replace the "cumbersome" static-compose approach (<code>mcp-tools.yaml</code>)
with a dynamic, UI-managed, self-hosting model — answering the open <code>todo.md</code>
question "MCP deployment seems cumbersome — can litellm host directly? how to
integrate npx, uvx, docker-based containers?". Unifying idea: normalize
npx / uvx / docker MCP servers behind one Dockerized gateway.</p>
<h2 id="2-architecture-three-competing-models-in-repo-a-chosen-b-orphaned-c-aspirational">2. Architecture (three competing models in-repo; A chosen, B orphaned, C aspirational)<a class="headerlink" href="#2-architecture-three-competing-models-in-repo-a-chosen-b-orphaned-c-aspirational" title="Permanent link">&para;</a></h2>
<p><strong>A. FastAPI gateway + Docker-in-Docker (chosen)</strong><code>ai/mcp-gateway/</code>
- FastAPI + <code>uvicorn</code> on <code>0.0.0.0:8080</code>, container <code>mcp-gateway</code>.
- DinD via bind-mounted <code>/var/run/docker.sock</code>; <code>docker.from_env()</code>.
- Per-server containers spawned <code>mcp-&lt;name&gt;</code>, hardcoded onto <code>ai-internal</code>.
- Config <code>config.json</code> (RW bind, currently EMPTY → falls back to <code>DEFAULT_SERVERS</code>).
- Gateway joins <code>ai-internal</code> + <code>shared_backend</code> (both <code>external: true</code>).</p>
<p><strong>B. Static compose <code>mcp-tools.yaml</code></strong> — orphaned; <code>ai/docker-compose.yml:6</code>
include is <strong>commented out</strong>. Internally malformed (see §4).</p>
<p><strong>C. LiteLLM-hosted</strong><code>litellm-config/config.yaml</code> <code>mcp_servers: {}</code> empty.
Confirms MCP hosting was intended for the gateway, not LiteLLM (the
<code>todo.md</code> "can litellm host directly?" question remains open).</p>
<p><strong>Transports</strong> (normalized to HTTP-on-:8000): streamable-http (nextcloud,
mermaid), <code>mcp-proxy --stateless</code> stdio→HTTP (papersearch), native HTTP
(markitdown, crawl4ai :11235), and the gateway's own <strong>SSE <code>/</code> endpoint —
a STUB</strong> (fake <code>initialize</code> + 60s pings, no routing to backends).</p>
<p><strong>Reverse proxy:</strong> Zoraxy <code>mcp.nuclide.systems → 192.168.1.40:8080</code>.
<code>mcp-auth.nuclide.systems</code> is an abandoned auth-sidecar idea (not exposed).</p>
<p><strong>OAuth (Pocket ID @ <code>id.nuclide.systems</code>):</strong> <code>OAuth2AuthorizationCodeBearer</code>,
scopes <code>{openid, mcp}</code>, token validation via userinfo. Shared gateway client
(<code>GENERIC_CLIENT_ID</code>, same as LiteLLM/LobeChat). Per-server OAuth for
papersearch &amp; nextcloud against the same Pocket ID.</p>
<h2 id="3-mcp-server-inventory-reconciled-serverpy-mcp_servers-is-authoritative">3. MCP Server Inventory (reconciled — <code>server.py</code> MCP_SERVERS is authoritative)<a class="headerlink" href="#3-mcp-server-inventory-reconciled-serverpy-mcp_servers-is-authoritative" title="Permanent link">&para;</a></h2>
<table>
<thead>
<tr>
<th>Server</th>
<th>Image / build</th>
<th>Transport</th>
<th>Port</th>
<th>Auth</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>papersearch</td>
<td><code>python:3.12-slim</code> + runtime <code>uv tool install mcp-proxy</code><code>paper_search_mcp.server</code></td>
<td>mcp-proxy stdio→http</td>
<td>8000</td>
<td>Pocket ID <code>PAPERSEARCH_MCP_OAUTH_*</code></td>
<td>plausible, runtime-install fragile</td>
</tr>
<tr>
<td>nextcloud</td>
<td><code>ghcr.io/cbcoutinho/nextcloud-mcp-server:latest</code></td>
<td>streamable-http</td>
<td>8000</td>
<td>Pocket ID <code>NEXTCLOUD_MCP_OAUTH_*</code></td>
<td>likely workable (real image)</td>
</tr>
<tr>
<td>markitdown</td>
<td><code>python:3.12-slim</code> + <code>uvx markitdown-mcp --http</code></td>
<td>http</td>
<td>8000</td>
<td>none</td>
<td><strong>broken as written</strong> (<code>uvx</code> not in base image)</td>
</tr>
<tr>
<td>comfyui</td>
<td><code>ghcr.io/richardi-ai/comfyui-mcp-server:latest</code> (<code>type:"npm"</code> mismatch)</td>
<td>unspecified</td>
<td>8000</td>
<td>none</td>
<td><strong>image not pullable</strong>; backend ComfyUI was crash-looping</td>
</tr>
<tr>
<td>crawl4ai</td>
<td><code>unclecode/crawl4ai:latest</code></td>
<td>http</td>
<td>11235</td>
<td>none</td>
<td>likely workable; resource limits lost in rewrite</td>
</tr>
<tr>
<td>mermaid</td>
<td><code>node:20-slim</code> + runtime <code>npx -y mcp-mermaid</code></td>
<td>streamable-http</td>
<td>8000</td>
<td>none</td>
<td>plausible, slow first start</td>
</tr>
</tbody>
</table>
<h2 id="4-implemented-vs-unfinished-vs-broken">4. Implemented vs Unfinished vs Broken<a class="headerlink" href="#4-implemented-vs-unfinished-vs-broken" title="Permanent link">&para;</a></h2>
<p><strong>Implemented:</strong> FastAPI app + OAuth scheme + userinfo token validation;
container lifecycle CRUD + persistence; Web UI SPA (<code>templates/ui.html</code> @ <code>/ui</code>);
gateway compose/Dockerfile + Zoraxy route.</p>
<p><strong>Unfinished / stub:</strong>
- <strong>SSE <code>/</code> is fake</strong> — no MCP transport bridging Claude.ai → spawned servers. <em>Core gap.</em>
- <strong>No routing to per-server containers</strong>; all five servers bind the same <code>:8000</code>
and <code>spawn_container</code> host-publishes <code>8000:8000</code><strong>two servers can't run at once</strong>.
- <strong>OAuth callback non-functional</strong> — token-exchange URL built via
<code>OAUTH_REDIRECT_URI.replace("/sso/callback","/token")</code> (→ wrong host, not the
Pocket ID token endpoint); token never stored/used.
- <code>config.json</code> empty → always defaults; secrets hardcoded plaintext in <code>server.py</code>.</p>
<p><strong>Broken / contradictory:</strong>
- <code>ai/docker-compose.yml:6</code> mcp-tools include commented out; gateway compose is a
<em>separate project</em> not referenced by the stack either — wired in only via Zoraxy.
- <code>mcp-tools.yaml</code>: duplicate <code>markitdown-mcp</code> key; <code>comfyui-mcp</code> env missing <code>=</code>
(<code>- COMFYUI_URL http://comfyui:8188</code>); missing images/ports.
- <code>comfyui</code> server <code>type:"npm"</code> vs Docker-image mismatch; upstream image/npm
package existence unverified (image confirmed <strong>not pullable</strong>).
- <code>.env</code> has <code>CRAWL4AI_MCP_OAUTH_*</code>, <code>COMFYUI_MCP_OAUTH_*</code> that <code>server.py</code>
never consumes; code hardcodes secrets instead of <code>${ENV}</code> substitution.</p>
<h2 id="5-relevant-env-keys-names-only">5. Relevant <code>.env</code> keys (names only)<a class="headerlink" href="#5-relevant-env-keys-names-only" title="Permanent link">&para;</a></h2>
<p>Gateway: <code>GENERIC_CLIENT_ID/_SECRET/_REDIRECT_URI</code>,
<code>GENERIC_{AUTHORIZATION,TOKEN,USERINFO}_ENDPOINT</code>, <code>GENERIC_CLIENT_USE_PKCE</code>,
<code>OAUTH_SCOPES</code>, <code>OAUTH_TOKEN_URL</code>.
Per-server: <code>NEXTCLOUD_MCP_OAUTH_CLIENT_ID/_SECRET</code>,
<code>PAPERSEARCH_MCP_OAUTH_CLIENT_ID/_SECRET</code>,
<code>MARKITDOWN_MCP_OAUTH_CLIENT_ID/_SECRET</code> (declared, unused),
<code>CRAWL4AI_/COMFYUI_MCP_OAUTH_*</code> (orphaned).
papersearch data sources: <code>UNPAYWALL_EMAIL</code>, <code>CORE_API_KEY</code>,
<code>SEMANTIC_SCHOLAR_API_KEY</code>, <code>ZENODO_ACCESS_TOKEN</code>, <code>GOOGLE_SCHOLAR_PROXY_URL</code>,
<code>DOAJ_API_KEY</code>. comfyui: <code>COMFYUI_URL</code>, <code>COMFYUI_WS_URL</code>.</p>
<h2 id="6-open-design-decisions-must-resolve">6. Open Design Decisions (must resolve)<a class="headerlink" href="#6-open-design-decisions-must-resolve" title="Permanent link">&para;</a></h2>
<ol>
<li><strong>Hosting model</strong>: DinD gateway vs static <code>mcp-tools.yaml</code> vs LiteLLM-hosted.</li>
<li><strong>How Claude.ai/LobeChat reach a tool</strong>: the MCP transport bridge doesn't exist.</li>
<li><strong>Port allocation</strong>: all servers hardcode <code>:8000</code> — need internal DNS, no host publish.</li>
<li><strong>Uniform npx/uvx/docker run model</strong>: prebuilt images vs runtime install.</li>
<li><strong>Auth model</strong>: gateway-terminated vs per-MCP vs pass-through (callback is broken).</li>
<li><strong>Secret handling</strong>: hardcoded → <code>${ENV}</code> from <code>ai/.env</code>.</li>
<li><strong>comfyui server</strong>: image vs npm; keep only once ComfyUI itself is stable.</li>
<li><strong>Discovery for LobeChat/LiteLLM</strong>: <code>/mcp.json</code> is OAuth-gated, lists config not endpoints.</li>
</ol>
<h2 id="7-recommended-path-ordered-lowest-risk-first">7. Recommended Path (ordered, lowest-risk first)<a class="headerlink" href="#7-recommended-path-ordered-lowest-risk-first" title="Permanent link">&para;</a></h2>
<ol>
<li><strong>Pick the static-compose path, not DinD</strong> — lowest risk on a single NUC;
DinD adds socket-exposure risk + a broken SSE bridge for little gain.
Fix and re-enable <code>mcp-tools.yaml</code> (uncomment <code>ai/docker-compose.yml:6</code>).</li>
<li><strong>Fix <code>mcp-tools.yaml</code></strong>: dedupe <code>markitdown-mcp</code>, fix <code>comfyui-mcp</code> env <code>=</code>,
unique service names → <code>ai-internal</code> DNS, pin images, drop comfyui for now.</li>
<li><strong>One streamable-http reverse proxy keyed by path</strong> (<code>mcp.nuclide.systems/&lt;server&gt;</code>)
via Zoraxy or a small <code>httpx</code> proxy — replace the fake SSE stub. Backends stay
internal on <code>ai-internal:8000</code>, never host-published.</li>
<li><strong>Move secrets to <code>${ENV}</code></strong> from <code>ai/.env</code> (keys already exist).</li>
<li><strong>Fix OAuth callback</strong>: exchange code against <code>GENERIC_TOKEN_ENDPOINT</code>.</li>
<li><strong>Verify each upstream image/tool exists</strong> before marking a server "working".</li>
<li><strong>Defer the DinD gateway + Web UI</strong> to phase-2 (read-only status over the
running compose, not spawning).</li>
<li><strong>Answer the litellm question</strong>: once stable <code>https://mcp.nuclide.systems/&lt;server&gt;</code>
URLs exist, populate <code>litellm-config/config.yaml</code> <code>mcp_servers:</code> so
LiteLLM/LobeChat discover them — no bespoke discovery path needed.</li>
</ol>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
Back to top
</button>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"annotate": null, "base": "../..", "features": ["navigation.tabs", "navigation.sections", "navigation.expand", "navigation.top", "search.highlight", "search.suggest", "content.code.copy"], "search": "../../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
<script src="../../assets/javascripts/bundle.79ae519e.min.js"></script>
</body>
</html>