{
 "action": "Not for automatic application — wrong occurs 2 times in the example. Show this correction to the user as a lead. Review before applying: this fix runs on mcp 2.3.0, but its printed output differs from what the original printed on 1.26.0 (observed stdout of one example) — it may do different work. Replace the old line with the new one; the rest of the code can stay.",
 "alternatives": [],
 "applicability": {
  "method": "literal_patch",
  "occurrences": 2,
  "reason": "wrong occurs 2 times in the example",
  "run_on": "2.3.0",
  "status": "not_applicable"
 },
 "by_notes": true,
 "changelog_ref": {
  "quote": "the dead `RequestResponder` arm and the `mcp.shared.session` module are gone (#3168).",
  "url": "https://github.com/modelcontextprotocol/python-sdk/releases/tag/v1.28.0"
 },
 "confirmations": {
  "failed": 0,
  "worked": 1
 },
 "detect": [
  "shared_session.anyio.create_memory_object_stream"
 ],
 "ecosystem": "pypi",
 "equivalence": "differs",
 "error_kind": "missing_import",
 "error_signature": {
  "message": "cannot import name 'session' from 'mcp.shared' (/usr/local/lib/python3.11/site-packages/mcp/shared/__init__.py)",
  "norm": "missing_import:session",
  "type": "ImportError"
 },
 "first_seen": "2026-10-20T16:11:13+00:00",
 "format": "replace",
 "format_version": 2,
 "id": "pypi/mcp/2.3.0/0002",
 "kind": "behavior_changed",
 "license": "https://creativecommons.org/licenses/by/4.0/",
 "package": "mcp",
 "proof": {
  "applicability": {
   "method": "literal_patch",
   "occurrences": 2,
   "reason": "wrong occurs 2 times in the example",
   "run_on": "2.3.0",
   "status": "not_applicable"
  },
  "auto_apply": false,
  "auto_apply_reason": "the fix's output differs from the original's; the patch gives not_applicable when applied word for word",
  "auto_apply_rule": "Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own.",
  "equivalence": "differs",
  "equivalent": false,
  "fails_on": "2.3.0",
  "fixed_on": "2.3.0",
  "level": "differential",
  "method": {
   "fix_on": "2.3.0",
   "name": "stdout_match",
   "normalization": "lines stripped, blank lines dropped, runs of whitespace collapsed; memory addresses, timestamps and temporary paths masked",
   "original_on": "1.26.0",
   "scope": "the observable stdout of one example script; return values, files, other inputs and exception types are not compared, so a match is not a proof of equivalent behaviour"
  },
  "script_right": "import asyncio\n\nimport anyio\n\nfrom mcp import ClientSession\n\n\nasync def main():\n    # Use the anyio dependency directly (mcp.shared.session no longer exists).\n    inbound_send, inbound_receive = (\n        anyio.create_memory_object_stream(1)\n    )\n    outbound_send, outbound_receive = (\n        anyio.create_memory_object_stream(1)\n    )\n\n    try:\n        # Construct only: do not enter the session or initialize a connection.\n        session = ClientSession(inbound_receive, outbound_send)\n        # BaseSession was removed in mcp 2.3.0, so the isinstance check is dropped.\n        print(\"ClientSession MRO:\", [cls.__name__ for cls in ClientSession.__mro__])\n    finally:\n        inbound_send.close()\n        inbound_receive.close()\n        outbound_send.close()\n        outbound_receive.close()\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())",
  "script_wrong": "import asyncio\n\nfrom mcp import ClientSession\nfrom mcp.shared import session as shared_session\nfrom mcp.shared.session import BaseSession\n\n\nasync def main():\n    # Use the anyio dependency exposed by mcp's session module.\n    inbound_send, inbound_receive = (\n        shared_session.anyio.create_memory_object_stream(1)\n    )\n    outbound_send, outbound_receive = (\n        shared_session.anyio.create_memory_object_stream(1)\n    )\n\n    try:\n        # Construct only: do not enter the session or initialize a connection.\n        session = ClientSession(inbound_receive, outbound_send)\n        print(\"Is a BaseSession:\", isinstance(session, BaseSession))\n        print(\"ClientSession MRO:\", [cls.__name__ for cls in ClientSession.__mro__])\n    finally:\n        inbound_send.close()\n        inbound_receive.close()\n        outbound_send.close()\n        outbound_receive.close()\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())",
  "works_on": "1.26.0"
 },
 "right": "anyio.create_memory_object_stream(1)",
 "seen_in_models": [
  "gpt-6.1-sol"
 ],
 "seq": 2,
 "slug": "mcp-shared-session",
 "source": "pipeline",
 "symbol": "mcp.shared.session",
 "updated": "2026-10-27T17:20:00+00:00",
 "url": "https://formachines.ai/errata/pypi/mcp/0002-mcp-shared-session/",
 "variant_confirmations": 1,
 "variant_models": [
  "gpt-6.1-sol"
 ],
 "verified": "sandbox",
 "versions": {
  "changed_in": ">1.26.0,<=2.3.0",
  "fails_on": "2.3.0",
  "works_on": "1.26.0"
 },
 "wrong": "shared_session.anyio.create_memory_object_stream(1)"
}