From c879d9bfce3751bee7066678baf2a8131428df6d Mon Sep 17 00:00:00 2001 From: James Wampler Date: Mon, 17 Aug 2026 18:38:48 -0700 Subject: [PATCH] Add publish-mcp.sh so the standalone MCP binary stops going stale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aspire doesn't run or manage src/Novelly.Mcp — it's a separate stdio process the MCP client spawns from a published binary that nothing rebuilds automatically. It had drifted 12 days out of date and was silently missing the service-API-key auth header, causing confusing 401s. Script wraps the existing dotnet publish command via the shared ensure_dotnet helper; README points at it instead of the raw command. Also registers a UserSecretsId on Novelly.Api so Auth:ServiceApiKey can be set locally without landing in appsettings. --- README.md | 7 ++++++- scripts/publish-mcp.sh | 15 +++++++++++++++ src/Novelly.Api/Novelly.Api.csproj | 3 ++- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100755 scripts/publish-mcp.sh diff --git a/README.md b/README.md index 80a6b49..3fbab77 100644 --- a/README.md +++ b/README.md @@ -185,9 +185,14 @@ its own — it is a second front end, not a second implementation. Build it, then point your MCP client at the produced binary: ```bash -dotnet publish src/Novelly.Mcp -c Release -o ./mcp-server +./scripts/publish-mcp.sh ``` +Aspire does not run or manage this process — it's a separate stdio subprocess your MCP +client spawns directly, so nothing rebuilds it automatically. Re-run the script (and +reconnect your MCP client) after pulling changes that touch `src/Novelly.Mcp`, or it keeps +serving whatever was published last, including against a stale auth contract. + `.mcp.json` (or Claude Desktop's config): ```jsonc diff --git a/scripts/publish-mcp.sh b/scripts/publish-mcp.sh new file mode 100755 index 0000000..695be23 --- /dev/null +++ b/scripts/publish-mcp.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Rebuilds the standalone Novelly.Mcp binary that Claude Code (or Claude Desktop) spawns +# per .mcp.json. Aspire does not run or manage this process, so nothing else rebuilds it — +# run this after pulling changes that touch src/Novelly.Mcp, or the MCP server silently +# keeps serving whatever was published last. +set -euo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")/.." && source ./scripts/ci/lib.sh +cd "$CI_ROOT" + +ensure_dotnet + +log "Publishing Novelly.Mcp to ./mcp-server" +dotnet publish src/Novelly.Mcp -c Release -o ./mcp-server + +log "Done. Reconnect the MCP server (e.g. /mcp in Claude Code) to pick up the new build." diff --git a/src/Novelly.Api/Novelly.Api.csproj b/src/Novelly.Api/Novelly.Api.csproj index 2b01d36..3019eb9 100644 --- a/src/Novelly.Api/Novelly.Api.csproj +++ b/src/Novelly.Api/Novelly.Api.csproj @@ -1,4 +1,4 @@ - + @@ -24,6 +24,7 @@ enable latest enable + fb455630-f631-46bb-9c60-0deaf01c593e