Repository navigation
feat: self-refreshing MCP telemetry attribution via mcp_proxy.py launcher (#114) - #145
Open
arorashivam96 wants to merge 1 commit into
Open
arorashivam96 wants to merge 1 commit into
arorashivam96 wants to merge 1 commit into
Conversation
…cher (#114) Resolve the plugin version live at every MCP proxy start instead of baking a frozen literal into the host config at registration time. Adds scripts/mcp_proxy.py (fail-open launcher), rewires the Claude/Cursor/Codex registration blocks, and adds a CAT-13 regression check. Bumps 1.14.1 -> 1.15.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #114 — MCP-path telemetry attribution goes stale after a plugin upgrade because the plugin version is baked as a frozen literal into the host MCP config at registration time (
DATAVERSE_OPERATION_CONTEXT=app=dataverse-skills/<version>;...). The npx proxy reads that env value once at startup and never again, and a normal reconnect short-circuitsdv-connectStep 0 straight to Step 7, skipping the re-registration that would refresh it.This replaces the frozen literal with a tiny launcher,
scripts/mcp_proxy.py, that the MCP server is registered to run instead ofnpxdirectly. At every proxy start it resolves the currently-installed plugin version live from the manifest, builds the attribution string, and execs the npx stdio proxy withDATAVERSE_OPERATION_CONTEXTset in the child env. The only value baked into the host config is the stable, rarely-changingDATAVERSE_PLUGIN_AGENT— never the version. So MCP-path attribution tracks in-place upgrades with no re-registration.Why a launcher (not reconcile-on-reconnect)
I grounded the fix in WebRequestStatistics (server-seen attribution) and the
dataversecli_commandexecutionAria telemetry, last 30 days, fleet-wideapp=dataverse-skillstraffic:skill=mcp-direct) traffic is smeared across ~28 version tokens, with old ones dominating:1.6.0alone = ~147K calls (2nd highest), plus still-live1.5.0,1.0.0, etc. The current version is almost absent from MCP (~91 calls). That means virtually no MCP config in the fleet carries the current version.dv-connect" fix (the original suggestion in MCP-path telemetry attribution can go stale after a plugin upgrade (frozen DATAVERSE_OPERATION_CONTEXT) #114) would rarely fire and barely move the distribution. A launcher that re-resolves the version at every proxy start (which happens on every editor/session restart) is the only approach that actually reduces the stale tail without depending on reconnect.Design
scripts/mcp_proxy.py— resolves the version fail-open: in-package manifest (via__file__) → optionalDATAVERSE_PLUGIN_ROOT→.envDATAVERSE_PLUGIN_VERSION→"unknown". It sanitizes the value, reads the agent fromDATAVERSE_PLUGIN_AGENT(allowlisted, elseunknown), setsDATAVERSE_OPERATION_CONTEXT, and launches the npx proxy (POSIXexecvpe; Windowscmd /c npxwith inherited stdio). MCP availability is never gated on attribution — any resolution failure still launches the proxy, and nothing is written to stdout before exec so the MCP stream stays clean.dv-connect/references/mcp-configuration.md— the Claude / Cursor / Codex registration blocks now invokepython <scripts>/mcp_proxy.py <url>withDATAVERSE_PLUGIN_AGENTin the env, instead of baking the version literal.dv-connect/SKILL.md— Step 6 attribution prose rewritten; Step 0 notes the MCP path self-refreshes (the.envrefresh is retained for the SDK path, which reads it at runtime).static_checks.py— new CAT-13 (EVAL-MCPATTR-01/02):mcp_proxy.pymust exist and be fail-open, and nodv-connectdoc may bake a concrete or{DATAVERSE_PLUGIN_VERSION}version into an MCP registration.Cross-agent behavior
Residual / validation needed
.env, and the nextdv-connectre-registers. It never silently breaks MCP.static_checksvalidates the launcher's shape (exists, fail-open, no baked literal) but not a live 4-host handshake. Please validate the MCP handshake on Claude / Cursor / Codex (Windows + POSIX) before merge. I verified the launcher compiles and resolves the live manifest version (1.14.1) with correct closed-schema output and fail-open agent handling.Version bumped 1.14.1 → 1.15.0 (MINOR — new capability; 8 fields across 6 files).
Authored by DDC-Agent (Domain Dev Companion) on behalf of arorashivam96.