fix(mcp): make opennest server launchable on any machine

.mcp.json pointed at C:/Users/AJ/.claude/mcp/OpenNest.Mcp/run.cmd, a
profile path and wrapper script that only existed on one machine, so the
server failed with CONNECTION_CLOSED everywhere else. Launch the published
exe via ${USERPROFILE} instead.

Also route console logging to stderr: the host's default console logger
wrote to stdout, interleaving log lines with the JSON-RPC stream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
aj
2026-09-22 13:02:28 -04:00
co-authored by Claude Opus 5.5
parent 98c4929d14
commit 1be0904506
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
{ {
"mcpServers": { "mcpServers": {
"opennest": { "opennest": {
"command": "cmd", "command": "${USERPROFILE}/.claude/mcp/OpenNest.Mcp/OpenNest.Mcp.exe",
"args": ["/c", "C:/Users/AJ/.claude/mcp/OpenNest.Mcp/run.cmd"] "args": []
} }
} }
} }
+4
View File
@@ -1,9 +1,13 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using OpenNest.Mcp; using OpenNest.Mcp;
var builder = Host.CreateApplicationBuilder(args); var builder = Host.CreateApplicationBuilder(args);
// stdout carries the JSON-RPC stream; console logs must go to stderr or they corrupt it.
builder.Logging.AddConsole(o => o.LogToStandardErrorThreshold = LogLevel.Trace);
builder.Services.AddSingleton<NestSession>(); builder.Services.AddSingleton<NestSession>();
builder builder
.Services.AddMcpServer() .Services.AddMcpServer()