Compare commits

...
2 Commits
6 changed files with 67 additions and 13 deletions

No files matched your search

+14 -1
View File
@@ -81,7 +81,20 @@ hyperstitionstud.io {
}
redir /ci /ci/ permanent
# 6. Repo Install Dir: hyperstitionstudio-core -> /schemas/* and Root Portal Homepage (/)
# 6. Stateless Read-Only Model Context Protocol (MCP) Streamable HTTP Endpoint -> /mcp & /mcp/*
@mcp_route path /mcp /mcp/*
handle @mcp_route {
reverse_proxy 127.0.0.1:8095
}
# Long-Term Plan (Disabled for Now): /gallery & /gallery/* Artifact Gallery
# See docs/PLAN-MEMETIC-GALLERY-SUBPAGE.pdf to re-enable when activated.
@gallery_disabled path /gallery /gallery/*
handle @gallery_disabled {
respond "404 Not Found" 404
}
# 7. Repo Install Dir: hyperstitionstudio-core -> /schemas/*, /learn/* & Root Portal Homepage (/)
handle_path /schemas/* {
root * /var/www/hyperstitionstud.io/repos/hyperstitionstudio-core/schemas
file_server {
+20
View File
@@ -0,0 +1,20 @@
# /etc/systemd/system/hyperstition-mcp.service
[Unit]
Description=Stateless Read-Only Model Context Protocol (MCP) HTTP Server for hyperstitionstud.io (127.0.0.1:8095)
After=network.target local-fs.target hyperstition-tmpfs-sync.service
Before=caddy.service
[Service]
Type=simple
WorkingDirectory=/srv/hyperstitionstud.io/repos
Environment="HYPERSTITIONSTUDIO_CONFIG=/srv/hyperstitionstud.io/repos/workspace.toml"
Environment="PYTHONPATH=/srv/hyperstitionstud.io/repos/hyperstitionstudio-core/src"
ExecStart=/srv/hyperstitionstud.io/repos/.venv/bin/python3 /srv/hyperstitionstud.io/repos/hyperstitionstudio-core/src/hyperstitionstud_io/mcp/server.py --transport http --host 127.0.0.1 --port 8095
Restart=always
RestartSec=2
NoNewPrivileges=true
ProtectSystem=strict
ReadOnlyPaths=/srv/hyperstitionstud.io/repos
[Install]
WantedBy=multi-user.target
+3 -2
View File
@@ -98,10 +98,11 @@ if [[ "${CI_REPO_DIR}" == "hyperdope-ci-build" ]] && [[ -d "${LIVE_REPOS}/hyperd
${SUDO} ln -sfn "hyperdope-ci-build" "${LIVE_REPOS}/ingglish-hyperdope-ci"
fi
# Create relative route symlinks inside LIVE_REPOS so both Caddy and standalone HTTP servers resolve all routes
# Create relative route symlinks inside LIVE_REPOS so both Caddy and standalone HTTP servers resolve all active routes
${SUDO} ln -sfn "hyperstitionstudio-core/site/index.html" "${LIVE_REPOS}/index.html"
${SUDO} ln -sfn "hyperstitionstudio-core/site/learn" "${LIVE_REPOS}/learn"
${SUDO} ln -sfn "hyperstitionstudio-core/site/gallery" "${LIVE_REPOS}/gallery"
# Note: /gallery is disabled for now (tracked as a long-term plan in docs/PLAN-MEMETIC-GALLERY-SUBPAGE.pdf)
${SUDO} rm -rf "${LIVE_REPOS}/gallery" "${LIVE_REPOS}/hyperstitionstudio-core/site/gallery"
${SUDO} ln -sfn "encyclopedia-knowledge-graph" "${LIVE_REPOS}/graph"
${SUDO} ln -sfn "technocapital-singularity-zoology/encyclopedia" "${LIVE_REPOS}/encyclopedia"
${SUDO} ln -sfn "technocapital-singularity-zoology" "${LIVE_REPOS}/zoology"
+29 -8
View File
@@ -14,37 +14,43 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
TARGET_BASE_URL="${1:-}"
SERVER_PID=""
MCP_PID=""
cleanup() {
if [[ -n "${SERVER_PID}" ]] && kill -0 "${SERVER_PID}" 2>/dev/null; then
kill "${SERVER_PID}" 2>/dev/null || true
fi
if [[ -n "${MCP_PID}" ]] && kill -0 "${MCP_PID}" 2>/dev/null; then
kill "${MCP_PID}" 2>/dev/null || true
fi
}
trap cleanup EXIT
if [[ -z "${TARGET_BASE_URL}" ]]; then
export LIVE_REPOS="${LIVE_REPOS:-/tmp/hyperstition-live-repos}"
rm -rf "${LIVE_REPOS}"
echo "[1/3] Hydrating per-repository webroot at ${LIVE_REPOS} via sync-vps-repos.sh --no-pull..."
echo "[1/4] Hydrating per-repository webroot at ${LIVE_REPOS} via sync-vps-repos.sh --no-pull..."
"${SCRIPT_DIR}/sync-vps-repos.sh" --no-pull
PORT="${TEST_PORT:-18090}"
echo "[2/3] Starting local HTTP server on http://127.0.0.1:${PORT} serving ${LIVE_REPOS}..."
MCP_PORT="${TEST_MCP_PORT:-18095}"
echo "[2/4] Starting local HTTP server on http://127.0.0.1:${PORT} and MCP HTTP server on http://127.0.0.1:${MCP_PORT}/mcp..."
python3 -m http.server "${PORT}" --bind 127.0.0.1 --directory "${LIVE_REPOS}" >/dev/null 2>&1 &
SERVER_PID="$!"
PYTHONPATH="${SCRIPT_DIR}/../src" python3 "${SCRIPT_DIR}/../src/hyperstitionstud_io/mcp/server.py" --transport http --host 127.0.0.1 --port "${MCP_PORT}" >/dev/null 2>&1 &
MCP_PID="$!"
sleep 0.6
TARGET_BASE_URL="http://127.0.0.1:${PORT}"
MCP_URL="http://127.0.0.1:${MCP_PORT}/mcp"
else
MCP_URL="${TARGET_BASE_URL%/}/mcp"
fi
echo "[3/3] Verifying all 35 portal, /learn/, /gallery/, graph, encyclopedia, haiperdohp-jemaytreeah (.gitignore artifacts), CI & schema routes against ${TARGET_BASE_URL}..."
echo "[3/4] Verifying all 32 active portal, /learn/, graph, encyclopedia, haiperdohp-jemaytreeah (.gitignore artifacts), CI & schema routes against ${TARGET_BASE_URL}..."
ROUTES=(
"/"
"/learn/index.html"
"/learn/learn-app.js"
"/gallery/index.html"
"/gallery/gallery-data.js"
"/gallery/media/meme_1_custom_pokedex_technocapital_zoology_m7_129_125.png"
"/gallery/media/meme_1_custom_pokedex_technocapital_zoology_m7_129_125.pdf"
"/graph/index.html"
"/graph/graph-data.js"
"/graph/encyclopedia-graph.json"
@@ -89,4 +95,19 @@ for route in "${ROUTES[@]}"; do
fi
done
echo "[OK] All ${PASS_COUNT}/${#ROUTES[@]} deployment routes verified (HTTP 200 OK)."
echo "[4/4] Verifying stateless read-only MCP Streamable HTTP endpoint (${MCP_URL})..."
mcp_get_code="$(curl -s -o /dev/null -w "%{http_code}" "${MCP_URL}")"
if [[ "${mcp_get_code}" != "200" ]]; then
echo " [FAIL ${mcp_get_code}] GET ${MCP_URL}" >&2
exit 1
fi
echo " [200 OK] GET ${MCP_URL} (MCP capability manifest)"
mcp_post_out="$(curl -s -X POST "${MCP_URL}" -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"hs_evaluate_aq_and_ingglish","arguments":{"terms":["capital","capture","folds"]}}}')"
if ! grep -q 'exact_gen1_singularity.*true' <<<"${mcp_post_out}"; then
echo " [FAIL] POST ${MCP_URL} did not return exact_gen1_singularity=true" >&2
exit 1
fi
echo " [200 OK] POST ${MCP_URL} (JSON-RPC 2.0 tools/call hs_evaluate_aq_and_ingglish verified)"
echo "[OK] All ${PASS_COUNT}/${#ROUTES[@]} static routes + 2 MCP HTTP endpoints verified (HTTP 200 OK)."
+1 -1
View File
@@ -135,8 +135,8 @@
</div>
<div class="meta-badges">
<a class="btn primary" data-route="learn-track" href="/learn/index.html" style="padding:0.35rem 0.75rem;font-size:0.74rem;">Start Learning Track (/learn/)</a>
<a class="btn" data-route="meme-gallery" href="/gallery/index.html" style="padding:0.35rem 0.75rem;font-size:0.74rem;">Memetic Gallery (/gallery/)</a>
<span class="badge">388 Graph Nodes</span>
<span class="badge">1,282 Typed Edges</span>
<span class="badge">22 PDF Volumes</span>
</div>
</header>
-1
View File
@@ -215,7 +215,6 @@
</div>
<nav class="top-nav">
<a class="btn" data-learn-route="nav-home" href="../index.html">&larr; Portal Home</a>
<a class="btn" data-learn-route="nav-gallery" href="../gallery/index.html">Memetic Gallery</a>
<a class="btn" data-learn-route="nav-graph" href="/graph/index.html">Knowledge Graph</a>
<a class="btn" data-learn-route="nav-calc" href="/calc/index.html">AQ Calculator</a>
</nav>