diff --git a/README.md b/README.md index 7a62a0f..22c9d50 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,12 @@ Publish one runtime: The script writes binaries under `artifacts/publish//`. +ReadyToRun is enabled by default to improve startup: + +```bash +PUBLISH_READY_TO_RUN=false ./scripts/publish.sh linux-x64 +``` + Trimming is disabled by default because the MCP SDK discovers tools through reflection. To experiment with trimming after validating tool discovery in the published binary: ```bash diff --git a/scripts/publish.sh b/scripts/publish.sh index 19f7012..d471396 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -5,6 +5,7 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" PROJECT="$ROOT_DIR/src/McpSsh.Server/McpSsh.Server.csproj" CONFIGURATION="${CONFIGURATION:-Release}" PUBLISH_TRIMMED="${PUBLISH_TRIMMED:-false}" +PUBLISH_READY_TO_RUN="${PUBLISH_READY_TO_RUN:-true}" if [[ $# -gt 0 ]]; then RIDS=("$@") @@ -21,5 +22,6 @@ for rid in "${RIDS[@]}"; do -o "$output" \ -p:PublishSingleFile=true \ -p:PublishTrimmed="$PUBLISH_TRIMMED" \ + -p:PublishReadyToRun="$PUBLISH_READY_TO_RUN" \ -p:EnableCompressionInSingleFile=true done diff --git a/src/McpSsh.Server/Program.cs b/src/McpSsh.Server/Program.cs index 7991abb..8bf68d4 100644 --- a/src/McpSsh.Server/Program.cs +++ b/src/McpSsh.Server/Program.cs @@ -9,10 +9,7 @@ using Microsoft.Extensions.Logging; var builder = Host.CreateApplicationBuilder(args); -builder.Logging.AddConsole(options => -{ - options.LogToStandardErrorThreshold = LogLevel.Trace; -}); +builder.Logging.ClearProviders(); builder.Services.AddSingleton(); builder.Services.AddSingleton();