Skip to content

chore(mcp): drop sourcemap output from the published build - #106

Merged
awdr74100 merged 1 commit into
mainfrom
chore/mcp-drop-sourcemap
Jul 26, 2026
Merged

chore(mcp): drop sourcemap output from the published build#106
awdr74100 merged 1 commit into
mainfrom
chore/mcp-drop-sourcemap

Conversation

@awdr74100

Copy link
Copy Markdown
Owner

Summary

  • Removes sourcemap: true from packages/mcp/tsdown.config.ts — nothing consumes the .map today: Node only reads sourcemaps for stack traces with --enable-source-maps (not set anywhere in the bin), and the error path (dispatch.ts, index.ts's log()) only ever surfaces .message, never .stack.
  • The map file (679KB) outweighs the code it maps (317KB) and ships to npm since files includes dist, roughly doubling published package size for a benefit nobody can currently reach.
  • Checked against comparable MCP servers: the direct competitor (figma-developer-mcp) and the official @modelcontextprotocol/server-filesystem reference implementation both ship without one. (@sentry/mcp-server is the one counterexample, but that's because Sentry's own SDK has its own sourcemap-consuming pipeline for crash reporting — a consumer Figwright doesn't have.)
  • minify was evaluated too (tested: 317KB → 197KB) and deliberately left off — the same "can the user actually feel it" bar that killed the plugin's sideEffects: false proposal applies here, and minifying would also wreck the one fallback we still have (manually reading a reported dist/index.mjs:LINE against the readable, unminified bundle).

Test plan

  • pnpm build — dist now contains only index.mjs (317KB), no .map
  • pnpm typecheck && pnpm lint && pnpm format:check && pnpm knip — all pass
  • pnpm test — 172 files / 1212 tests pass

Nothing consumes it: Node doesn't read `.map` for stack traces without
`--enable-source-maps` (not set anywhere in the bin), and the error
path (dispatch.ts, index.ts's log()) only ever surfaces `.message`,
never `.stack`. Meanwhile the map file outweighs the code it maps
(679KB vs 317KB) and ships to npm since `files` includes `dist`,
roughly doubling install size for a benefit nobody can reach today.
Matches the direct competitor (figma-developer-mcp) and the official
reference server implementation, neither of which ship one.
@awdr74100
awdr74100 merged commit a101698 into main Jul 26, 2026
2 checks passed
@awdr74100
awdr74100 deleted the chore/mcp-drop-sourcemap branch July 26, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant