/byteforge-claude-skills:mcp-docker-deploymentfrom byteforge-claude-skills
Set up Docker deployment for Python MCP servers (FastMCP or low-level mcp.server.Server SDK) with streamable-http transport (preferred) or legacy SSE, automated versioning, and container registry publishing. Use when dockerizing an MCP server, containerizing for remote access, deploying an MCP server behind nginx, or setting up a production MCP server with Docker. Covers Dockerfile, build scripts, docker-compose, and nginx reverse proxy.
Ships in byteforge-claude-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Containerize Python MCP servers (FastMCP or low-level SDK) for remote deployment with streamable-http transport (preferred) or legacy SSE, nginx reverse proxy with HTTPS, and GHCR publishing.
Always pick streamable-http with stateless_http=True unless you have a specific reason to use SSE. SSE has a wedge bug class with Claude Code as the client: when the long-lived SSE GET dies (container restart, network blip, idle close), Claude Code's MCP client auto-reconnects but does NOT re-run the initialize handshake. The new server-side session sees tools/call before initialize, raises RuntimeError("Received request before initialization was complete"), and the SDK's catch-all converts it to a generic -32602 "Invalid request parameters". Claude Code treats -32602 as unrecoverable; every subsequent call returns the same error until the user manually /mcp reloads.
Streamable-http with stateless_http=True has no per-session state to lose — every POST stands alone. The bug class is structurally impossible on this transport.
References: anthropics/claude-code#60061 (open upstream issue tracking the wedge on the SSE side; multiple independent reporters, same diagnosis, same workaround).
Pick sse ONLY if you have a non-Claude-Code MCP client that explicitly requires it (rare).
Ask the user:
my_mcp_server.py)mcp.server.fastmcp.FastMCP) or the low-level SDK (mcp.server.Server)?"streamable-http (recommended, default) or sse (legacy)?" — default to streamable-http. Only use sse if a non-Claude-Code client explicitly requires it. See the "Transport choice" section above for why. (Note: the two are NOT interchangeable — different endpoints, different SDK classes.)tools/, models/, formatting.py)ghcr.io/{org}/{project})mcp-server-nginx-gatekeeper sets up): use the shared-network compose. Also ask for the name of the Docker network nginx is attached to; it goes in MCP_DOCKER_NETWORK.url.insteadOf auth so requirements.txt and every pyproject stay token-free)FROM python:3.13-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code - adjust to match project structure
COPY {entry_point} .
# COPY additional files/directories as needed
# Non-root user — uid pinned so tmpfs mounts (e.g. byteforge-prometheus-metrics) can set a matching owner
RUN useradd --uid 1000 --create-home appuser && chown -R appuser:appuser /app
USER appuser
EXPOSE 8000
# Transport for Docker, bind to all interfaces
ENV MCP_TRANSPORT=streamable-http
ENV MCP_HOST=0.0.0.0
ENV MCP_PORT=8000
# Healthcheck: probe socket.gethostname(), NOT 127.0.0.1. A loopback
# probe from inside the container succeeds even when the server is
# bound only to 127.0.0.1 — the exact bind trap this skill warns about
# on the FastMCP path. gethostname() resolves to the container's
# address on the docker network, which is the path nginx actually uses,
# so a false-healthy state on 127.0.0.1 becomes a real
# ConnectionRefusedError instead.
#
# Port resolution mirrors the FastMCP Path A fallback chain
# (FASTMCP_PORT → MCP_PORT → 8000), so a user who overrides only
# FASTMCP_PORT doesn't leave the healthcheck probing the wrong port.
# On Path B, FASTMCP_PORT is unset so the chain falls through to
# MCP_PORT — which is what the low-level SDK reads directly.
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
CMD python -c "import os,socket; socket.create_connection((socket.gethostname(), int(os.getenv('FASTMCP_PORT', os.getenv('MCP_PORT','8000')))), timeout=3).close()" || exit 1
CMD ["python", "{entry_point}"]
FastMCP note: If the server uses FastMCP, also set
FASTMCP_HOSTandFASTMCP_PORTin the Dockerfile since FastMCP reads those specific env vars:ENV FASTMCP_HOST=0.0.0.0 ENV FASTMCP_PORT=8000
If private pip dependencies, replace the plain pip install line above with a
BuildKit secret mount + scrub block. CR_PAT enters via --mount=type=secret
(never recorded in docker history). Auth comes from git url.insteadOf
config scoped to the one pip install command, so requirements.txt stays
token-free (pkg @ git+https://github.com/{owner}/{repo}.git) and every
clone in the graph is authenticated, including transitive private deps that
a private library declares token-free in its own pyproject.toml. An inline
git+https://${CR_PAT}@... URL in requirements.txt authenticates only the
top-level clones, so a nested private dep fails with git exit 128. This is the
same pattern as the uv-supply-chain-hardening skill's with_private_git
helper.
test -n makes a build without --secret fail fast instead of cloning
anonymously. The RUN then scrubs pip's install metadata (direct_url.json
records and any hatchling-baked METADATA lines) and self-verifies: the build
FAILS if any token byte survives in site-packages. Requires BuildKit (default
in Docker 23+; for older Docker, export DOCKER_BUILDKIT=1).
RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/*
RUN --mount=type=secret,id=cr_pat \
CR_PAT="$(cat /run/secrets/cr_pat)" \
&& test -n "${CR_PAT}" \
&& GIT_CONFIG_COUNT=1 \
GIT_CONFIG_KEY_0="url.https://${CR_PAT}@github.com/.insteadOf" \
GIT_CONFIG_VALUE_0="https://github.com/" \
pip install --no-cache-dir -r requirements.txt \
&& find /usr/local/lib/python3.13/site-packages -name direct_url.json -delete \
&& grep -rl "${CR_PAT}" /usr/local/lib/python3.13/site-packages | xargs -r sed -i "s|${CR_PAT}|REDACTED|g" \
&& ! grep -rq "${CR_PAT}" /usr/local/lib/python3.13/site-packages
If the project is uv-hardened (hash-locked requirements.txt, private deps in
requirements-private.txt), use the uv-supply-chain-hardening Dockerfile
instead of this block.
Do NOT use ARG CR_PAT + --build-arg: any layer that consumes the ARG
records the value verbatim in docker history, readable by anyone who can
pull the image. And never ENV CR_PAT=... — that bakes the live token into
.Config.Env where docker inspect prints it.
The template code in Step 3 imports from mcp.server.fastmcp (Path A) or
mcp.server.* submodules (Path B). Those import paths only exist in the
mcp package's 1.x line — the 2.0.0 release (2026-07-28) renamed
FastMCP → MCPServer, moved mcp.server.fastmcp → mcp.server.mcpserver,
and made other breaking API changes. Bound the mcp requirement to
<2.0 so a fresh Docker build (especially with --no-cache) can't
silently resolve into 2.x and crash-loop on
ModuleNotFoundError: No module named 'mcp.server.fastmcp':
# requirements.txt
# Bounded to <2.0 — the 2.0 rewrite renames FastMCP and moves the
# module paths this template uses. Unbounding without migrating the
# server code will build green locally (against a pre-existing 1.x
# venv) and crash-loop on the first --no-cache rebuild.
mcp>=1.8,<2.0
The 1.8 minimum is required for the default transport: MCP SDK 1.8.0 introduced Streamable HTTP, including FastMCP's stateless_http setting / streamable_http_app() and the low-level StreamableHTTPSessionManager(..., stateless=True) used below. Earlier 1.x versions cannot run these examples.
For existing projects, update the dependency declaration and regenerate the lockfile with the project's existing package manager, then sync the environment and verify the installed mcp version. For a uv-managed project, preserve any extras (e.g. mcp[cli]>=1.8,<2.0) in pyproject.toml, run uv lock --upgrade-package mcp, and sync from the updated lock. Keep its existing uv-based Docker install flow; do not introduce a parallel requirements.txt dependency source. For hashed requirements locks, follow the deliberate-upgrade workflow in uv-supply-chain-hardening instead of hand-editing generated pins or hashes.
mcp 1.x is in maintenance mode (security fixes only); the 2.x rewrite is
far enough that migrating warrants a considered code change, not an
accidental resolve during a rebuild. Migrate by removing the upper bound
AND updating imports/constructor to the 2.x API in the same commit.
Low-level SDK (Path B) servers also need uvicorn and starlette in
requirements.txt — FastMCP bundles those, the low-level SDK does not.
mcp.server.fastmcp.FastMCP)FastMCP's constructor defaults override env vars, so host/port must be passed explicitly:
import os
from mcp.server.fastmcp import FastMCP
mcp = FastMCP(
"my_mcp_server",
# Honor MCP_HOST/MCP_PORT as fallbacks: the template sets both name
# pairs in the Dockerfile/compose, so a user who edits MCP_PORT
# expecting it to take effect isn't silently ignored on Path A.
host=os.getenv("FASTMCP_HOST", os.getenv("MCP_HOST", "127.0.0.1")),
port=int(os.getenv("FASTMCP_PORT", os.getenv("MCP_PORT", "8000"))),
stateless_http=True,
)
# ... register tools ...
if __name__ == "__main__":
transport = os.getenv("MCP_TRANSPORT", "stdio")
mcp.run(transport=transport)
CRITICAL: Without explicit host/port args, the container binds to 127.0.0.1 and is unreachable despite FASTMCP_HOST=0.0.0.0 being set. This is because FastMCP's pydantic-settings defaults take precedence over env vars when constructor args are provided.
CRITICAL: stateless_http=True is required for streamable-http to actually be stateless (it has no effect on sse, which has its own per-connection state). Without it, the server tracks sessions via Mcp-Session-Id headers; if the proxy drops that header or the connection breaks, clients get "Session not found" errors. The combination of streamable-http AND stateless_http=True is what makes the SSE wedge bug class (see "Transport choice" above) structurally impossible — every POST stands alone, with no per-session handshake state to lose.
Supported transports:
stdio — Local development (Claude Code local MCP servers)streamable-http — Recommended. Single /mcp endpoint, supports stateless_http=True, avoids the SSE wedge bug class.sse — Legacy. Two-endpoint protocol (/sse + /messages/). Wedge-prone with Claude Code; use only if forced by client compatibility.mcp.server.Server)The low-level SDK requires manual transport wiring with Starlette and uvicorn. Each transport type uses different SDK classes and different endpoints.
import asyncio
import contextlib
import os
from collections.abc import AsyncIterator
from typing import Any
import uvicorn
from mcp.server import Server
from mcp.server.sse import SseServerTransport
from mcp.server.stdio import stdio_server
from mcp.server.streamable_http_manager import StreamableHTTPSessionManager
from starlette.applications import Starlette
from starlette.responses import Response
from starlette.routing import Mount, Route
app = Server("my_mcp_server")
# ... register tools with @app.list_tools(), @app.call_tool(), etc. ...
async def main_stdio() -> None:
"""Run the MCP server over stdio transport (local development)."""
async with stdio_server() as (read_stream, write_stream):
await app.run(
read_stream,
write_stream,
app.create_initialization_options()
)
def main_sse() -> None:
"""Run the MCP server over SSE transport (Docker/remote deployment)."""
host: str = os.environ.get("MCP_HOST", "0.0.0.0")
port: int = int(os.environ.get("MCP_PORT", "8000"))
sse_transport = SseServerTransport("/messages/")
async def handle_sse(request: Any) -> Response:
async with sse_transport.connect_sse(
request.scope, request.receive, request._send
) as streams:
await app.run(
streams[0],
streams[1],
app.create_initialization_options(),
)
return Response()
starlette_app = Starlette(
routes=[
Route("/sse", endpoint=handle_sse),
Mount("/messages/", app=sse_transport.handle_post_message),
],
)
uvicorn.run(starlette_app, host=host, port=port)
def main_streamable_http() -> None:
"""Run the MCP server over streamable-http transport."""
host: str = os.environ.get("MCP_HOST", "0.0.0.0")
port: int = int(os.environ.get("MCP_PORT", "8000"))
session_manager = StreamableHTTPSessionManager(
app=app,
json_response=False,
stateless=True,
)
@contextlib.asynccontextmanager
async def lifespan(starlette_app: Starlette) -> AsyncIterator[None]:
async with session_manager.run():
yield
starlette_app = Starlette(
routes=[
Mount("/mcp", app=session_manager.handle_request),
],
lifespan=lifespan,
)
uvicorn.run(starlette_app, host=host, port=port)
if __name__ == "__main__":
transport: str = os.environ.get("MCP_TRANSPORT", "stdio")
if transport == "stdio":
asyncio.run(main_stdio())
elif transport == "sse":
main_sse()
elif transport == "streamable-http":
main_streamable_http()
else:
raise SystemExit(f"Unknown MCP_TRANSPORT: {transport} (expected: stdio, sse, streamable-http)")
Transcribe this template exactly — do not rewrite the directory anchor or the argument loop using shell positional parameters (a dollar sign followed by a digit). Claude Code substitutes dollar-digit tokens in a SKILL.md with the skill's invocation arguments, so such a template arrives corrupted: the
cdanchor silently becomes a no-op and--no-cachenever matches.${BASH_SOURCE[0]}and"$@"survive intact, which is why the script uses bash.
#!/usr/bin/env bash
# Build and publish MCP Docker image
# Usage: ./build-publish.sh [--no-cache]
# Anchor to the script's directory so VERSION, Dockerfile, and `.` all
# resolve to the project root — not the caller's cwd. Without this,
# running as `./myapp/build-publish.sh` from a parent directory writes
# a stray VERSION in the parent, uses the parent as build context (which
# in a multi-repo workspace can sweep sibling projects into the image),
# and corrupts this project's version tracking.
cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
REGISTRY="{registry_url}"
NO_CACHE=""
for arg in "$@"; do
if [ "$arg" = "--no-cache" ]; then
NO_CACHE="--no-cache"
fi
done
# Seed at 0, not 1: the version published is CURRENT+1, so seeding
# at 1 makes the very first image :2 and leaves :1 permanently missing
# from the registry.
if [ ! -f VERSION ]; then
echo "0" > VERSION
fi
CURRENT_VERSION=$(cat VERSION)
case "$CURRENT_VERSION" in
''|*[!0-9]*)
echo "ERROR: VERSION file contains non-numeric value: $CURRENT_VERSION"
exit 1
;;
esac
NEXT_VERSION=$((CURRENT_VERSION + 1))
IMAGE_TAG="${REGISTRY}:${NEXT_VERSION}"
# VERSION is local and gitignored, so a stale copy can point at a tag that is
# already published. Pushing would silently replace that image. Only a clear
# "not found" from the registry counts as unused: auth, network and unrecognized
# errors stop the script too.
check_tag_unused() {
local output
if output=$(docker manifest inspect "$IMAGE_TAG" 2>&1); then
echo "ERROR: $IMAGE_TAG already exists in the registry, so VERSION is stale."
echo "Set VERSION to the highest published numeric tag and re-run."
exit 1
fi
if ! grep -qiE 'manifest unknown|no such manifest|name unknown' <<< "$output"; then
echo "ERROR: Could not confirm $IMAGE_TAG is unused:"
echo "$output"
exit 1
fi
}
check_tag_unused
echo "Building ${REGISTRY}:${NEXT_VERSION}..."
docker build \
--platform linux/amd64 \
$NO_CACHE \
-t "${REGISTRY}:${NEXT_VERSION}" \
.
if [ $? -ne 0 ]; then
echo "ERROR: Docker build failed"
exit 1
fi
docker tag "${REGISTRY}:${NEXT_VERSION}" "${REGISTRY}:latest"
if [ $? -ne 0 ]; then
echo "ERROR: Docker tag failed"
exit 1
fi
# Check again: the tag may have been published while this image was building.
check_tag_unused
echo "Pushing ${REGISTRY}:${NEXT_VERSION}..."
docker push "${REGISTRY}:${NEXT_VERSION}"
if [ $? -ne 0 ]; then
echo "ERROR: Push failed"
exit 1
fi
echo "Pushing ${REGISTRY}:latest..."
docker push "${REGISTRY}:latest"
if [ $? -ne 0 ]; then
echo "ERROR: Push failed"
exit 1
fi
echo "$NEXT_VERSION" > VERSION
echo "Published ${REGISTRY}:${NEXT_VERSION} and :latest"
If private dependencies, add --secret id=cr_pat,env=CR_PAT to docker build — the
Dockerfile's --mount=type=secret,id=cr_pat will read the value from the env-backed
secret. Do NOT use --build-arg CR_PAT=$CR_PAT: it records the token in every
layer that consumes the ARG, visible via docker history --no-trunc to anyone
who can pull the image.
Make executable: chmod +x build-publish.sh
bin/
lib/
lib64/
include/
share/
pyvenv.cfg
.venv/
.Python
__pycache__/
*.py[cod]
*$py.class
*.egg-info/
tests/
.pytest_cache/
.coverage
htmlcov/
.git/
.gitignore
.env
VERSION
*.md
.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store
Pick the variant from the Step 1 Q7 answer. Both keep the MCP endpoint off public interfaces: the server itself has no auth, and many MCP servers hold credentials or write keys.
Use this whenever nginx runs in Docker, including every setup made with the
mcp-server-nginx-gatekeeper skill. That skill's snippet proxies with
proxy_pass http://$mcp_upstream:$mcp_port and resolver 127.0.0.11, so
nginx must reach this container by its service name over a Docker network
they share. A published host port can't help here: inside the nginx
container, 127.0.0.1 is nginx itself.
# No published ports: the only way in is nginx (+ Gatekeeper auth), which
# reaches this container by name over the shared Docker network.
services:
{service_name}:
image: {registry_url}:latest
container_name: {container_name}
restart: unless-stopped
env_file: .env
environment:
MCP_TRANSPORT: streamable-http
MCP_HOST: 0.0.0.0
MCP_PORT: 8000
# Add all app-specific env vars from example.env (or keep them in .env)
networks:
- mcp
read_only: true
tmpfs:
- /tmp
cap_drop: [ALL]
security_opt:
- no-new-privileges:true
# volumes:
# - /path/to/cert.pem:/app/ca.pem:ro
# For LOCAL testing only, uncomment to reach it directly:
# ports:
# - "127.0.0.1:8000:8000"
networks:
mcp:
external: true
# The existing Docker network nginx is attached to.
name: ${MCP_DOCKER_NETWORK:?set MCP_DOCKER_NETWORK in .env to the Docker network nginx is attached to}
{service_name} (or container_name) is the hostname nginx uses: it is the
<UPSTREAM_CONTAINER> / set $mcp_upstream ...; value in
mcp-server-nginx-gatekeeper, and 8000 is its $mcp_port.external, so compose never creates it. Compose refuses to
start until MCP_DOCKER_NETWORK is set. List candidates with
docker network ls, or read nginx's with
docker inspect -f '{{json .NetworkSettings.Networks}}' {nginx_container}.read_only: true with a /tmp tmpfs is fine for a stock FastMCP or
low-level SDK server. If the server writes anywhere else (a cache dir, a
Prometheus multiprocess dir), add a tmpfs or volume for that path rather
than dropping read_only.Then wire nginx with the mcp-server-nginx-gatekeeper skill (Step 9).
services:
{service_name}:
image: {registry_url}:latest
container_name: {container_name}
restart: unless-stopped
env_file: .env
ports:
# Loopback only: host nginx proxies to localhost:8000. Never publish
# "8000:8000", which exposes the unauthenticated endpoint on every
# interface (and Docker's port publishing bypasses ufw).
- "127.0.0.1:8000:8000"
environment:
MCP_TRANSPORT: streamable-http
MCP_HOST: 0.0.0.0
MCP_PORT: 8000
# Add all app-specific env vars from example.env (or keep them in .env)
read_only: true
tmpfs:
- /tmp
cap_drop: [ALL]
security_opt:
- no-new-privileges:true
# volumes:
# - /path/to/cert.pem:/app/ca.pem:ro
FastMCP note (both variants): If using FastMCP, also add
FASTMCP_HOST: 0.0.0.0andFASTMCP_PORT: 8000to the environment section.
Include all environment variables from the project's example.env.
# MCP transport: "stdio" for local dev; "streamable-http" (recommended) or "sse" (legacy) for Docker/remote
MCP_TRANSPORT=streamable-http
# MCP network settings (used with streamable-http or sse transport)
# MCP_HOST=0.0.0.0
# MCP_PORT=8000
# FastMCP only: FastMCP reads these specific env vars for host/port binding.
# Not needed for low-level SDK servers.
# FASTMCP_HOST=0.0.0.0
# FASTMCP_PORT=8000
# Step 6 Variant A only: the existing Docker network nginx is attached to.
# Read by docker-compose.yaml; compose refuses to start without it.
# MCP_DOCKER_NETWORK=
# App-specific variables below
For Variant A, uncomment MCP_DOCKER_NETWORK here and set it in .env.
Add VERSION and .env entries.
mcp-server-nginx-gatekeeper skill. It adds the location /mcp-{name} block, the shared proxy/auth/streaming snippet, Gatekeeper auth_request, and the resolver 127.0.0.11 that by-name proxy_pass needs. Give it this container's service name as the upstream, 8000 as the port, and the network from MCP_DOCKER_NETWORK.location block that proxies to localhost:8000. The same block works cleanly for both transports — proxy_buffering off plus long proxy_read_timeout are still useful for streamable-http's optional server→client streaming responses. It adds no authentication: put auth in front of it if the server holds credentials.Streamable-http (recommended) exposes:
/mcp - Single endpoint (POST for requests, optional GET for server→client streams)SSE (legacy) exposes:
/sse - SSE connection endpoint/messages/ - Message posting endpointConnect to a remote MCP server in .mcp.json:
{
"mcpServers": {
"my-mcp": {
"type": "http",
"url": "https://server.example.com/my-mcp/mcp",
"headers": {
"Authorization": "Bearer <token>"
}
}
}
}
Auth is handled at the nginx layer via Bearer token headers. The MCP server does not need to know about authentication.
build-publish.sh says a tag already exists - The local VERSION is behind the registry, which is common on a new machine or fresh clone because VERSION is gitignored. Find the highest numeric tag in the registry, write it to VERSION, and re-run. Do not delete the existing tag to get past the check. The check and push are not atomic, so two machines publishing at the same moment can still collide; keep to one publisher at a time.
build-publish.sh says it could not confirm a tag is unused - The registry did not give a clear "not found", so the script stops rather than risk overwriting an image. Read the error it prints: usually you need to run docker login for that registry. Docker Hub also answers denied for a repository that does not exist yet, so create the repository before the first publish there.
Unknown streamable-http transport / missing streamable_http_app or streamable_http_manager - Check the installed mcp version. These APIs require mcp>=1.8,<2.0; an older lockfile or environment can retain an incompatible 1.x release. Update the declaration and lockfile, sync, and rebuild with the updated dependencies (see Step 2).
Container binds to 127.0.0.1 instead of 0.0.0.0 (FastMCP) - FastMCP constructor defaults override env vars. Pass host/port explicitly in the FastMCP constructor (see Step 3, Path A).
SSE connection stale / wedged after container restart or network blip - When Claude Code's SSE GET dies, it auto-reconnects but does NOT re-run the initialize handshake; the new server-side session sees tools/call before initialize, the SDK raises RuntimeError("Received request before initialization was complete"), and the wire-level error becomes a generic -32602 "Invalid request parameters". Claude Code treats -32602 as unrecoverable and stays wedged on every subsequent call. Workaround: /mcp reload in Claude Code to force a fresh handshake. Real fix: migrate to streamable-http with stateless_http=True — that's exactly what this bug class needs (see "Transport choice" near the top). Upstream issue: anthropics/claude-code#60061.
nginx returns 502 / host not found for the MCP upstream - With containerized nginx, the MCP container must be on the same Docker network (Step 6 Variant A); a published host port is not reachable from inside the nginx container. Check with docker network inspect "$MCP_DOCKER_NETWORK" that both containers are listed, and that nginx has a resolver 127.0.0.11 (see mcp-server-nginx-gatekeeper Trap 5).
Private dependency clone fails with git exit 128 during docker build - Either the build ran without --secret id=cr_pat,env=CR_PAT (the secret read and test -n check stop it before any clone), or the Dockerfile authenticates with an inline ${CR_PAT} URL that only covers top-level requirements. Use the Step 2 url.insteadOf block, which also authenticates transitive private deps.
PyPI package version stale in Docker image - Publish the new version to PyPI before running build-publish.sh. Verify with docker exec {container} pip show {package}.
Missing uvicorn or starlette (low-level SDK) - Low-level SDK servers need uvicorn and starlette in requirements.txt. FastMCP bundles these, but the low-level SDK does not.
Wrong transport route (low-level SDK) - SSE uses /sse and /messages/, streamable-http uses /mcp. These are NOT interchangeable. Make sure the client URL matches the transport configured on the server.
"Session not found" errors behind nginx - The MCP SDK's streamable-http transport is stateful by default. During initialization, the server assigns a session ID and expects the client to send it back via the Mcp-Session-Id header on every request. Behind a reverse proxy, this header can be dropped or the SSE connection that maintains the session can be interrupted, causing "Session not found" errors. Fix: set stateless_http=True (FastMCP) or stateless=True (low-level SDK StreamableHTTPSessionManager). This disables session tracking so each request is handled independently. See the "Transport choice" section near the top — streamable-http + stateless is the recommended default for exactly this reason.
If you find a bug or stale instruction while using this skill:
byteforge-skills-maintainer-agent is available,
file a ticket with that agent. Use discover_agents to find its project ID.Include the skill name, plugin version if known, the instruction followed, expected and actual results, relevant errors/runtime versions, and any fix or workaround that worked. Omit credentials and private data.
Address the user's immediate problem first; report the skill defect afterward.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jmazzahacks/byteforge-claude-skills --plugin byteforge-skills16 skills in this plugin
/aegis-nextjs-frontendThis skill should be used when the user asks to "create a new website", "spin up a frontend", "set up a Next.js site with aegis auth", "scaffold a new web app with authentication", "create a site with login and i18n", or needs a production-ready Next.js frontend integrated with ByteForge Aegis authentication. Provides complete project scaffolding with auth pages, internationalization, Docker deployment, and a design system./byteforge-loki-loggingConfigure Grafana Loki logging using byteforge-loki-logging library for Python/Flask applications. Use when setting up Loki logging, configuring centralized logging, or adding structured JSON logging to any Python project./byteforge-prometheus-metricsConfigure Prometheus metrics for Python/Flask applications with multi-worker gunicorn safety and optional Redis-backed business metrics. Use when adding a /metrics endpoint, instrumenting a Flask app, or fixing inflated metrics from multi-worker gunicorn./codync-tailscale-hostInstall a Codync host (persistent coding-agent bots driven from a phone or desktop app) on Linux or macOS so it is reachable ONLY over the user's Tailscale tailnet, with the Codync cloud relay off, pinned to host v2.53.0 with automatic updates off (2.54.0+ move bots out of their project folders), and chosen environment variables (agent auth tokens etc.) passed into the background service. Use when the user asks to install, set up, harden or replicate a Codync host, make Codync tailnet-only, turn off the Codync cloud relay, fix bots that can't see env vars or tokens under the codync-host service, or roll a host on 2.54.0+ back to 2.53.0 and return its bots to their project folders./flask-docker-deploymentSet up Docker deployment for Flask applications with Gunicorn, automated versioning, and container registry publishing. Use when dockerizing a Flask app, containerizing for production, or setting up CI/CD with Docker./flask-smorest-apiSet up Flask REST API with flask-smorest, OpenAPI docs, blueprint architecture, and dataclass models. Use when creating a new Flask API server, building REST endpoints, or setting up a production API.