mcp-data-platform-v0.33.4
Summary
Fixes two bugs in the Asset Portal and hardens the JSX renderer, provenance tracking, and test coverage.
Bug Fix: Blank JSX Content in Asset Viewer
Problem: Agent-generated JSX components define React components but never call createRoot/ReactDOM.render, so the iframe rendered blank with no errors.
Fix: The JsxRenderer now detects whether content is self-mounting (contains createRoot or ReactDOM.render) and handles each path differently:
- Self-mounting path (backward compatible): content with mount calls uses the existing import-map + inline injection, now with error handling
- Auto-mount path (new): content without mount calls goes through bare-specifier resolution (rewrites
from 'react'to absolute esm.sh URLs for blob module compatibility), automaticexport defaultdetection, and dynamic import viaReact.createElement(mod.default)
Additional hardening:
- Memory leak fix: module blob URLs are now tracked via
useRefand properly revoked on cleanup - Single source of truth:
IMPORT_MAPis derived fromBARE_IMPORT_MAP— no more duplicated maps - XSS prevention: error display uses
textContentvia ashowError()helper instead ofinnerHTMLconcatenation - Fewer false positives:
hasMountCodeuses regex (/\bcreateRoot\s*\(/) instead ofString.includes(), reducing false matches from comments - Class component support:
ensureExportnow handlesclassdeclarations alongsidefunction|const|let - CSP updated: added
blob:toscript-srcandconnect-srcfor the auto-mount path
Bug Fix: Empty Provenance ("No provenance data available")
Problem: The provenance middleware accumulates tool calls keyed by session ID, but AwareHandler's session ID was not propagated through the Go request context. MCPToolCallMiddleware used the default "stdio" key while save_artifact used a different key, resulting in an empty harvest.
Fix: Context-based session ID propagation:
AwareHandlernow callsWithAwareSessionID(ctx, sessionID)in bothhandleInitializeandhandleExisting, injecting the session ID into the Go request contextMCPToolCallMiddlewarefalls back toAwareSessionID(ctx)when the MCP SDK returns the default"stdio"session ID- This ensures Streamable HTTP requests always get the correct per-client session ID regardless of MCP SDK behavior
| Transport | Before | After |
|---|---|---|
| Streamable HTTP + AwareHandler | Works only if client echoes Mcp-Session-Id header |
Always works via context propagation |
| SSE | All clients share "stdio" key |
Same (AwareHandler doesn't wrap SSE) |
| stdio | Uses "stdio" |
Same (no HTTP layer) |
Other Improvements
- Provenance log noise reduced:
Harvest()log level lowered fromInfotoDebug— no longer logs on everysave_artifactcall in production - Diagnostic logging:
Record(),Harvest(), andsave_artifacthandler now emit structured debug/info logs with session ID and tool call counts for troubleshooting
Test Coverage
- Integration test added:
TestMiddlewareChain_AwareHandler_ProvenanceSessionIDwires up the fullAwareHandler→ Stateless StreamableHTTP →MCPToolCallMiddleware→MCPProvenanceMiddlewarechain and verifies end-to-end session ID propagation with a real HTTP transport - Unit tests:
AwareSessionID/WithAwareSessionIDroundtrip,handleInitializeandhandleExistingcontext propagation,MCPToolCallMiddlewareAwareHandler fallback - All new functions at 100% coverage
Files Changed
pkg/session/handler.go—WithAwareSessionID/AwareSessionIDcontext helperspkg/middleware/mcp.go— AwareHandler session ID fallback inMCPToolCallMiddlewarepkg/middleware/mcp_provenance.go— diagnostic logging,Harvestlog level fixpkg/toolkits/portal/toolkit.go—save_artifactprovenance diagnostic loggingui/src/components/renderers/JsxRenderer.tsx— auto-mount, memory leak, XSS, dedup fixes
Installation
Homebrew (macOS)
brew install txn2/tap/mcp-data-platformClaude Code CLI
claude mcp add mcp-data-platform -- mcp-data-platformDocker
docker pull ghcr.io/txn2/mcp-data-platform:v0.33.4Verification
All release artifacts are signed with Cosign. Verify with:
cosign verify-blob --bundle mcp-data-platform_0.33.4_linux_amd64.tar.gz.sigstore.json \
mcp-data-platform_0.33.4_linux_amd64.tar.gz