refactor: serve MCP bundles under <name>/mcp with nginx guard; rename core->mcp_server

- collect.py: copy repo MCP bundles to ROOT/<name>/mcp (instead of ROOT/mcp/<name>); add nginx location guard to deny /<name>/mcp/
- config.py: bundle roots now point to <repo>/mcp and standards/mcp for static bundles
- Rename core.py -> mcp_server.py and update imports in main.py and registry.py
- Dockerfile: per-repo MCP COPYs under /app/<name>/mcp, drop blog copy; add ports 8008/8009 in .drone.yml
- Restore standards/mcp/libraries.json from git for registry server
This commit is contained in:
2026-10-11 23:37:46 +05:30
parent c5619bc5e8
commit 9929f05334
194 changed files with 166 additions and 83 deletions

View File

@@ -256,6 +256,10 @@ NGINX_TEMPLATE = r"""server {{
root /usr/share/nginx/html;
index index.html lib/index.html api/index.html;
location ~ ^/[^/]+/mcp/ {{
deny all;
}}
location / {{
try_files $uri $uri/ /index.html;
}}
@@ -316,7 +320,7 @@ def collect(config: dict, dry_run: bool = False) -> list[str]:
if not src.is_dir():
errors.append(f"{name}: mcp bundle missing ({src})")
continue
dst = ROOT / MCP_DIR / name
dst = ROOT / name / MCP_DIR
copied.append(f" mcp {name} {dst.relative_to(ROOT)}/")
if not dry_run:
_copy_dir(src, dst)