Commit 5cba9b4
fix(mcp-bridge): Node compat + JSR slow-types (main.d.ts) (#96)
## Summary
Two small fixes that close known cross-runtime + JSR posture gaps
surfaced during the v0.4.7 publish attempts.
## 1. Node compat — \`Deno.env.get\` at line 256
Bridge used \`Deno.env.get(\"COORD_BACKEND_URL\")\` directly, which
throws \`ReferenceError: Deno is not defined\` on Node and Bun. Switched
to the \`env.get\` shim from \`./lib/runtime.js\` that's already used
for every other env-var read in this file.
\`\`\`diff
-const LOCAL_COORD_URL = Deno.env.get("COORD_BACKEND_URL") ??
"http://127.0.0.1:7745";
+const LOCAL_COORD_URL = env.get("COORD_BACKEND_URL") ??
"http://127.0.0.1:7745";
\`\`\`
Bridge now runs cleanly on Deno, Node, and Bun — matches the runtime
support claimed in the README and \`jsr.json\`.
## 2. JSR slow-types — \`mcp-bridge/main.d.ts\`
JSR's \`deno publish\` warns with \`unsupported-javascript-entrypoint\`
because the entrypoint declared in \`jsr.json\`
(\`./mcp-bridge/main.js\`) has no type declarations. Added a minimal
\`main.d.ts\` declaring the entrypoint as a script with no public
exports (\`export {}\`), which is accurate — \`main.js\` is run as a
process via npx/deno-run, not imported as a library.
The \`.d.ts\` also documents which \`lib/*\` modules ARE intended for
library import (\`tools\`, \`resources\`, \`prompts\`, \`runtime\`,
\`otel\`, \`security\`, \`api-clients\`, \`nickel-validator\`,
\`logger\`) for downstream consumers.
## Verification
\`\`\`bash
$ echo '{...initialize...}' | node mcp-bridge/main.js # works
$ echo '{...initialize...}' | deno run -A mcp-bridge/main.js # works
\`\`\`
Both runtimes return the expected initialize response. Existing tests
still green.
## Scope
This is a packaging/compat fix — no behavioral or API change. Targets
the **next** release (0.4.8 or whenever you cut next). The
currently-failing 0.4.7 publish failures are auth-related (npm Trusted
Publisher / JSR linkage), not code-related, so this PR doesn't need to
land before the v0.4.7 re-tag.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 576f80d commit 5cba9b4
2 files changed
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| |||
0 commit comments