ddtrace 4.8.2 through 4.13.0rc3, mcp 2.0.0, py3.14.
_supported_versions() in ddtrace/contrib/internal/mcp/patch.py returns
{"mcp": ">=1.10.0"} with no upper bound. mcp 2.0.0 dropped mcp.shared.session, so
the version check passes and patch() then dies on the import.
repro:
pip install ddtrace==4.12.2 mcp==2.0.0
DD_TRACE_ENABLED=true python -c "import ddtrace.auto; import mcp"
File ".../ddtrace/contrib/internal/mcp/patch.py", line 288, in patch
from mcp.shared.session import BaseSession
ModuleNotFoundError: No module named 'mcp.shared.session'
mcp.types and mcp.client.session are still there, it's only mcp.shared.session
that went away.
not fatal, the patch failure gets swallowed, but it's a traceback on every boot and no
mcp spans either way.
DD_TRACE_SAFE_INSTRUMENTATION_ENABLED=true doesn't catch it, 2.0.0 satisfies the
declared spec.
pip install mcp pulls 2.x now, so anything unpinned lands here:
https://github.com/modelcontextprotocol/python-sdk/releases/tag/v2.0.0
those release notes also tell people to pin <2 if they haven't migrated, which is what
the spec should be doing.
working around it with DD_PATCH_MODULES=mcp:false. still on main and 4.13.0rc3.
ddtrace 4.8.2 through 4.13.0rc3, mcp 2.0.0, py3.14.
_supported_versions()inddtrace/contrib/internal/mcp/patch.pyreturns{"mcp": ">=1.10.0"}with no upper bound. mcp 2.0.0 droppedmcp.shared.session, sothe version check passes and
patch()then dies on the import.repro:
mcp.typesandmcp.client.sessionare still there, it's onlymcp.shared.sessionthat went away.
not fatal, the patch failure gets swallowed, but it's a traceback on every boot and no
mcp spans either way.
DD_TRACE_SAFE_INSTRUMENTATION_ENABLED=truedoesn't catch it, 2.0.0 satisfies thedeclared spec.
pip install mcppulls 2.x now, so anything unpinned lands here:https://github.com/modelcontextprotocol/python-sdk/releases/tag/v2.0.0
those release notes also tell people to pin
<2if they haven't migrated, which is whatthe spec should be doing.
working around it with
DD_PATCH_MODULES=mcp:false. still on main and 4.13.0rc3.