Skip to content

[BUG] .NET adapter broken in npm publish: netcoredbg-bridge-core.js missing from 0.19.0 and 0.20.0 #72

@RagingOrator

Description

@RagingOrator

Summary

The .NET / C# adapter ships incomplete in the published npm package for both 0.19.0 and 0.20.0. Attaching to any .NET process fails because a required bridge file is missing from the publish.

Repro

On Windows 10 x64, Node v24.14.0:

npx @debugmcp/mcp-debugger@0.20.0 stdio
# Send via stdio:
# {"jsonrpc":"2.0","id":1,"method":"initialize",...}
# {"jsonrpc":"2.0","method":"notifications/initialized"}
# {"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"create_debug_session","arguments":{"language":"dotnet"}}}
# {"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"attach_to_process","arguments":{"sessionId":"...","processId":<some .NET pid>}}}

list_supported_languages reports the .NET adapter as installed: true. But attach_to_process fails.

Two layered issues

Issue 1: bridge entry path resolution

attach_to_process initially fails with:

Failed to attach: netcoredbg-bridge.js not found. Run: pnpm --filter @debugmcp/adapter-dotnet run build

The published package has netcoredbg-bridge.js at dist/packages/adapter-dotnet/dist/utils/netcoredbg-bridge.js. The resolver in dist/cli.mjs searches (relative to __dirname5 which is dist/):

dist/utils/netcoredbg-bridge.js
dist/../packages/adapter-dotnet/dist/utils/netcoredbg-bridge.js    # packages/ at package root, not dist/packages/
dist/../../../../packages/adapter-dotnet/dist/utils/netcoredbg-bridge.js
<cwd>/packages/adapter-dotnet/dist/utils/netcoredbg-bridge.js
/app/...

None of those resolve to where the file actually is. The path used by the resolver assumes the file lives at packages/... (next to dist/), but the publish bundles it INSIDE dist/packages/.... Adding a path that respects the actual bundled layout (or copying the file to one of the existing search paths during build) would fix this.

Issue 2 (the bigger one): netcoredbg-bridge-core.js is not in the publish at all

After working around Issue 1 by copying netcoredbg-bridge.js to one of the searched paths, the proxy fails again. The bridge entry file is:

import { createBridge } from './netcoredbg-bridge-core.js';

But netcoredbg-bridge-core.js is not present anywhere in the published tarball. The source netcoredbg-bridge-core.ts exists in the repo at packages/adapter-dotnet/src/utils/. The publish manifest excludes the compiled output.

Verified by inspecting the tarballs:

npm pack @debugmcp/mcp-debugger@0.20.0 | xargs tar -tzf | grep -E "adapter-dotnet|netcoredbg"
# Only shows: package/dist/packages/adapter-dotnet/dist/utils/netcoredbg-bridge.js
# No netcoredbg-bridge-core.js, no dotnet-utils.js

Same result for 0.19.0. Older versions (0.18.1 and below) don't have any .NET adapter files at all — confirming the .NET adapter is a recent addition that shipped broken from the start.

Workaround (for anyone hitting this in the meantime)

# 1. Clone source
git clone --depth 1 https://github.com/debugmcp/mcp-debugger
cd mcp-debugger
npx pnpm install

# 2. Build the .NET adapter
cd packages/adapter-dotnet
npx --no-install tsc -b

# 3. Copy the built outputs into your installed package at BOTH expected paths:
SRC=$(pwd)/dist/utils
PKG=$(find ~/.nuget ~/AppData ~/node_modules -path "*@debugmcp/mcp-debugger" -type d 2>/dev/null | head -1)
cp $SRC/* $PKG/packages/adapter-dotnet/dist/utils/
cp $SRC/* $PKG/dist/packages/adapter-dotnet/dist/utils/

After the workaround, attaching to a .NET 8 / Avalonia process works end-to-end (verified: attach succeeds, breakpoints resolve to source, locals are accessible, evaluate_expression returns correct values).

Likely root cause

Either the files / exports field in packages/adapter-dotnet/package.json (or the monorepo bundler config that produces the published tarball) excludes the utils/ subdirectory other than the bridge entry-point. Worth auditing the publish pipeline that produces the .NET adapter portion of the published tarball.

Environment

  • mcp-debugger: 0.19.0, 0.20.0
  • Node: v24.14.0
  • OS: Windows 10 x64
  • netcoredbg: 3.1.3-1062 (latest from Samsung/netcoredbg releases)
  • Target: .NET 8 Avalonia 11.2 desktop app

Happy to PR if it's just a files glob fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions