Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-anthropic for
openSUSE:Factory checked in at 2026-07-29 19:00:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-anthropic (Old)
and /work/SRC/openSUSE:Factory/.python-anthropic.new.2004 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-anthropic"
Wed Jul 29 19:00:00 2026 rev:8 rq:1368291 version:0.120.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-anthropic/python-anthropic.changes
2026-07-26 11:32:35.399220476 +0200
+++
/work/SRC/openSUSE:Factory/.python-anthropic.new.2004/python-anthropic.changes
2026-07-29 19:01:19.093926457 +0200
@@ -1,0 +2,8 @@
+Wed Jul 29 06:21:11 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Update to 0.120.2:
+ * Support MCP SDK v2 alongside v1
+- Changes from 0.120.1:
+ * Pin the mcp extra to < 2
+
+-------------------------------------------------------------------
Old:
----
anthropic-0.120.0.tar.gz
New:
----
anthropic-0.120.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-anthropic.spec ++++++
--- /var/tmp/diff_new_pack.IhZvC3/_old 2026-07-29 19:01:19.853952671 +0200
+++ /var/tmp/diff_new_pack.IhZvC3/_new 2026-07-29 19:01:19.861952946 +0200
@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-anthropic
-Version: 0.120.0
+Version: 0.120.2
Release: 0
Summary: The official Python library for the Anthropic API
License: MIT
++++++ anthropic-0.120.0.tar.gz -> anthropic-0.120.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/anthropic-0.120.0/.release-please-manifest.json
new/anthropic-0.120.2/.release-please-manifest.json
--- old/anthropic-0.120.0/.release-please-manifest.json 2020-02-02
01:00:00.000000000 +0100
+++ new/anthropic-0.120.2/.release-please-manifest.json 2020-02-02
01:00:00.000000000 +0100
@@ -1,3 +1,3 @@
{
- ".": "0.120.0"
+ ".": "0.120.2"
}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/anthropic-0.120.0/CHANGELOG.md
new/anthropic-0.120.2/CHANGELOG.md
--- old/anthropic-0.120.0/CHANGELOG.md 2020-02-02 01:00:00.000000000 +0100
+++ new/anthropic-0.120.2/CHANGELOG.md 2020-02-02 01:00:00.000000000 +0100
@@ -1,5 +1,21 @@
# Changelog
+## 0.120.2 (2026-07-28)
+
+Full Changelog:
[v0.120.1...v0.120.2](https://github.com/anthropics/anthropic-sdk-python/compare/v0.120.1...v0.120.2)
+
+### Bug Fixes
+
+* **mcp:** support mcp sdk v2 alongside v1
([#300](https://github.com/anthropics/anthropic-sdk-python/issues/300))
([177f88c](https://github.com/anthropics/anthropic-sdk-python/commit/177f88ccd7f966e47b654cb19ad0e9cfa4c58ac2))
+
+## 0.120.1 (2026-07-28)
+
+Full Changelog:
[v0.120.0...v0.120.1](https://github.com/anthropics/anthropic-sdk-python/compare/v0.120.0...v0.120.1)
+
+### Bug Fixes
+
+* **mcp:** pin mcp extra to <2
([#1783](https://github.com/anthropics/anthropic-sdk-python/issues/1783))
([fb66371](https://github.com/anthropics/anthropic-sdk-python/commit/fb66371322621be23a0956f1998da39c4686f4cb))
+
## 0.120.0 (2026-07-24)
Full Changelog:
[v0.119.0...v0.120.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.119.0...v0.120.0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/anthropic-0.120.0/PKG-INFO
new/anthropic-0.120.2/PKG-INFO
--- old/anthropic-0.120.0/PKG-INFO 2020-02-02 01:00:00.000000000 +0100
+++ new/anthropic-0.120.2/PKG-INFO 2020-02-02 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.3
Name: anthropic
-Version: 0.120.0
+Version: 0.120.2
Summary: The official Python library for the anthropic API
Project-URL: Homepage, https://github.com/anthropics/anthropic-sdk-python
Project-URL: Repository, https://github.com/anthropics/anthropic-sdk-python
@@ -42,7 +42,7 @@
Provides-Extra: google-cloud
Requires-Dist: google-auth[requests]<3,>=2; extra == 'google-cloud'
Provides-Extra: mcp
-Requires-Dist: mcp>=1.0; (python_version >= '3.10') and extra == 'mcp'
+Requires-Dist: mcp<3,>=1.0; (python_version >= '3.10') and extra == 'mcp'
Provides-Extra: vertex
Requires-Dist: google-auth[requests]<3,>=2; extra == 'vertex'
Provides-Extra: webhooks
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/anthropic-0.120.0/pyproject.toml
new/anthropic-0.120.2/pyproject.toml
--- old/anthropic-0.120.0/pyproject.toml 2020-02-02 01:00:00.000000000
+0100
+++ new/anthropic-0.120.2/pyproject.toml 2020-02-02 01:00:00.000000000
+0100
@@ -1,6 +1,6 @@
[project]
name = "anthropic"
-version = "0.120.0"
+version = "0.120.2"
description = "The official Python library for the anthropic API"
dynamic = ["readme"]
license = "MIT"
@@ -44,7 +44,7 @@
google_cloud = ["google-auth[requests] >=2, <3"]
aws = ["boto3 >= 1.28.57", "botocore >= 1.31.57"]
bedrock = ["boto3 >= 1.28.57", "botocore >= 1.31.57"]
-mcp = ["mcp>=1.0; python_version >= '3.10'"]
+mcp = ["mcp>=1.0, <3; python_version >= '3.10'"]
webhooks = ["standardwebhooks >= 1.0.1, < 2"]
[project.urls]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/anthropic-0.120.0/src/anthropic/_version.py
new/anthropic-0.120.2/src/anthropic/_version.py
--- old/anthropic-0.120.0/src/anthropic/_version.py 2020-02-02
01:00:00.000000000 +0100
+++ new/anthropic-0.120.2/src/anthropic/_version.py 2020-02-02
01:00:00.000000000 +0100
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for
details.
__title__ = "anthropic"
-__version__ = "0.120.0" # x-release-please-version
+__version__ = "0.120.2" # x-release-please-version
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/anthropic-0.120.0/src/anthropic/lib/tools/mcp.py
new/anthropic-0.120.2/src/anthropic/lib/tools/mcp.py
--- old/anthropic-0.120.0/src/anthropic/lib/tools/mcp.py 2020-02-02
01:00:00.000000000 +0100
+++ new/anthropic-0.120.2/src/anthropic/lib/tools/mcp.py 2020-02-02
01:00:00.000000000 +0100
@@ -65,6 +65,28 @@
]
# -----------------------------------------------------------------------
+# mcp version compatibility
+# -----------------------------------------------------------------------
+
+# mcp<2 exposes camelCase model fields (`tool.inputSchema`); mcp>=2 exposes
+# snake_case (`tool.input_schema`). Read through this helper to support both.
+
+_MCP_V1_NAMES = {
+ "input_schema": "inputSchema",
+ "mime_type": "mimeType",
+ "is_error": "isError",
+ "structured_content": "structuredContent",
+}
+
+
+def _mcp_field_v1_or_v2(obj: Any, name: str) -> Any:
+ try:
+ return getattr(obj, name)
+ except AttributeError:
+ return getattr(obj, _MCP_V1_NAMES[name])
+
+
+# -----------------------------------------------------------------------
# Supported MIME types
# -----------------------------------------------------------------------
@@ -128,15 +150,16 @@
return block # type: ignore[return-value]
if isinstance(content, ImageContent):
- if not _is_supported_image_type(content.mimeType):
- raise UnsupportedMCPValueError(f"Unsupported image MIME type:
{content.mimeType}")
+ mime_type = _mcp_field_v1_or_v2(content, "mime_type")
+ if not _is_supported_image_type(mime_type):
+ raise UnsupportedMCPValueError(f"Unsupported image MIME type:
{mime_type}")
image_block = _TaggedDict(
{
"type": "image",
"source": BetaBase64ImageSourceParam(
type="base64",
data=content.data,
- media_type=content.mimeType, # type:
ignore[typeddict-item]
+ media_type=mime_type, # type: ignore[typeddict-item]
),
}
)
@@ -159,7 +182,7 @@
cache_control: BetaCacheControlEphemeralParam | None = None,
) -> BetaContent:
"""Convert MCP resource contents to an Anthropic content block."""
- mime_type = resource.mimeType
+ mime_type = _mcp_field_v1_or_v2(resource, "mime_type")
# Images
if mime_type is not None and _is_supported_image_type(mime_type):
@@ -262,12 +285,13 @@
if not result.contents:
raise UnsupportedMCPValueError("Resource contents array must contain
at least one item")
+ mime_types = [_mcp_field_v1_or_v2(c, "mime_type") for c in result.contents]
supported = next(
- (c for c in result.contents if
_is_supported_resource_mime_type(c.mimeType)),
+ (c for c, mime_type in zip(result.contents, mime_types) if
_is_supported_resource_mime_type(mime_type)),
None,
)
if supported is None:
- mime_types = [c.mimeType for c in result.contents if c.mimeType is not
None]
+ mime_types = [m for m in mime_types if m is not None]
raise UnsupportedMCPValueError(
f"No supported MIME type found in resource contents. Available:
{', '.join(mime_types)}"
)
@@ -299,7 +323,7 @@
else:
content_bytes = resource.text.encode("utf-8")
- file_tuple = _TaggedTuple((name, content_bytes, resource.mimeType))
+ file_tuple = _TaggedTuple((name, content_bytes,
_mcp_field_v1_or_v2(resource, "mime_type")))
tag_helper(file_tuple, "mcp_resource_to_file")
return file_tuple
@@ -311,12 +335,13 @@
def _convert_tool_result(result: CallToolResult) -> BetaFunctionToolResultType:
"""Convert MCP ``CallToolResult`` to a value suitable for returning from
``call()``."""
- if result.isError:
+ if _mcp_field_v1_or_v2(result, "is_error"):
raise ToolError([mcp_content(item) for item in result.content])
# If content is empty but structuredContent is present, JSON-encode it
- if not result.content and result.structuredContent is not None:
- return json.dumps(result.structuredContent)
+ structured_content = _mcp_field_v1_or_v2(result, "structured_content")
+ if not result.content and structured_content is not None:
+ return json.dumps(structured_content)
return [mcp_content(item) for item in result.content]
@@ -376,7 +401,7 @@
call_mcp,
name=tool_name,
description=tool.description,
- input_schema=tool.inputSchema,
+ input_schema=_mcp_field_v1_or_v2(tool, "input_schema"),
cache_control=cache_control,
defer_loading=defer_loading,
allowed_callers=allowed_callers,
@@ -436,7 +461,7 @@
call_mcp,
name=tool_name,
description=tool.description,
- input_schema=tool.inputSchema,
+ input_schema=_mcp_field_v1_or_v2(tool, "input_schema"),
cache_control=cache_control,
defer_loading=defer_loading,
allowed_callers=allowed_callers,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/anthropic-0.120.0/uv.lock
new/anthropic-0.120.2/uv.lock
--- old/anthropic-0.120.0/uv.lock 2020-02-02 01:00:00.000000000 +0100
+++ new/anthropic-0.120.2/uv.lock 2020-02-02 01:00:00.000000000 +0100
@@ -278,7 +278,7 @@
{ name = "httpx", specifier = ">=0.25.0,<1" },
{ name = "httpx-aiohttp", marker = "extra == 'aiohttp'", specifier =
">=0.1.9,<1" },
{ name = "jiter", specifier = ">=0.4.0,<1" },
- { name = "mcp", marker = "python_full_version >= '3.10' and extra ==
'mcp'", specifier = ">=1.0" },
+ { name = "mcp", marker = "python_full_version >= '3.10' and extra ==
'mcp'", specifier = ">=1.0,<3" },
{ name = "pydantic", specifier = ">=1.9.0,<3" },
{ name = "sniffio" },
{ name = "standardwebhooks", marker = "extra == 'webhooks'", specifier =
">=1.0.1,<2" },