langchain-mcp-tools 0.2.5__py3-none-any.whl → 0.2.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -284,7 +284,8 @@ async def validate_auth_before_connection(
284
284
  headers: dict[str, str] | None = None,
285
285
  timeout: float = 30.0,
286
286
  auth: httpx.Auth | None = None,
287
- logger: logging.Logger = logging.getLogger(__name__)
287
+ logger: logging.Logger = logging.getLogger(__name__),
288
+ server_name: str = "Unknown"
288
289
  ) -> tuple[bool, str]:
289
290
  """Pre-validate authentication with a simple HTTP request before creating MCP connection.
290
291
 
@@ -302,6 +303,7 @@ async def validate_auth_before_connection(
302
303
  timeout: Request timeout in seconds
303
304
  auth: Optional httpx authentication object (OAuth providers are skipped)
304
305
  logger: Logger for debugging
306
+ server_name: MCP server name to be validated
305
307
 
306
308
  Returns:
307
309
  Tuple of (success: bool, message: str) where:
@@ -316,7 +318,7 @@ async def validate_auth_before_connection(
316
318
  # Skip auth validation for all httpx.Auth providers
317
319
  if auth is not None:
318
320
  auth_class_name = auth.__class__.__name__
319
- logger.info(f"Skipping auth validation for httpx.Auth provider: {auth_class_name}")
321
+ logger.info(f'MCP server "{server_name}": Skipping auth validation for httpx.Auth provider: {auth_class_name}')
320
322
  return True, "httpx.Auth authentication skipped (requires full flow)"
321
323
 
322
324
  # Create InitializeRequest as per MCP specification (similar to test_streamable_http_support)
@@ -360,7 +362,7 @@ async def validate_auth_before_connection(
360
362
  elif response.status_code == 403:
361
363
  return False, f"Authentication failed (403 Forbidden): {response.text if hasattr(response, 'text') else 'Unknown error'}"
362
364
 
363
- logger.info(f"Authentication validation passed: {response.status_code}")
365
+ logger.info(f'MCP server "{server_name}": Authentication validation passed: {response.status_code}')
364
366
  return True, "Authentication validation passed"
365
367
 
366
368
  except httpx.HTTPStatusError as e:
@@ -658,7 +660,8 @@ async def connect_to_mcp_server(
658
660
  headers=headers,
659
661
  timeout=timeout or 30.0,
660
662
  auth=auth,
661
- logger=logger
663
+ logger=logger,
664
+ server_name=server_name
662
665
  )
663
666
 
664
667
  if not auth_valid:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langchain-mcp-tools
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: Model Context Protocol (MCP) To LangChain Tools Conversion Utility
5
5
  Project-URL: Bug Tracker, https://github.com/hideya/langchain-mcp-tools-py/issues
6
6
  Project-URL: Source Code, https://github.com/hideya/langchain-mcp-tools-py
@@ -9,8 +9,8 @@ Requires-Python: >=3.11
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
11
  Requires-Dist: jsonschema-pydantic>=0.6
12
- Requires-Dist: langchain>=0.3.14
13
- Requires-Dist: mcp>=1.6.0
12
+ Requires-Dist: langchain>=0.3.26
13
+ Requires-Dist: mcp>=1.9.4
14
14
  Provides-Extra: dev
15
15
  Requires-Dist: dotenv>=0.9.9; extra == "dev"
16
16
  Requires-Dist: fastapi>=0.115.12; extra == "dev"
@@ -132,7 +132,7 @@ The returned tools can be used with LangChain, e.g.:
132
132
 
133
133
  ```python
134
134
  # from langchain.chat_models import init_chat_model
135
- llm = init_chat_model("anthropic:claude-sonnet-4-0")
135
+ llm = init_chat_model("google_genai:gemini-2.0-flash")
136
136
 
137
137
  # from langgraph.prebuilt import create_react_agent
138
138
  agent = create_react_agent(
@@ -156,6 +156,8 @@ See [README_DEV.md](https://github.com/hideya/langchain-mcp-tools-py/blob/main/R
156
156
  This library supports **MCP Protocol version 2025-03-26** and maintains backwards compatibility with version 2024-11-05.
157
157
  It follows the [official MCP specification](https://modelcontextprotocol.io/specification/2025-03-26/) for transport selection and backwards compatibility.
158
158
 
159
+ **Note:** The library automatically adds the `PATH` environment variable to stdio servers if not explicitly provided to ensure servers can find required executables.
160
+
159
161
  ## Features
160
162
 
161
163
  ### stderr Redirection for Local MCP Server
@@ -189,8 +191,6 @@ can be specified with the `"cwd"` key as follows:
189
191
  The key name `cwd` is derived from
190
192
  Python SDK's [`StdioServerParameters`](https://github.com/modelcontextprotocol/python-sdk/blob/babb477dffa33f46cdc886bc885eb1d521151430/src/mcp/client/stdio/__init__.py#L76-L77).
191
193
 
192
- **Note:** The library automatically adds the `PATH` environment variable to stdio servers if not explicitly provided to ensure servers can find required executables.
193
-
194
194
  ### Transport Selection Priority
195
195
 
196
196
  The library selects transports using the following priority order:
@@ -0,0 +1,8 @@
1
+ langchain_mcp_tools/__init__.py,sha256=vAPa7NK9mcKyzLFwiwF7nzvevHil4Tylc3EhE2CFEn4,223
2
+ langchain_mcp_tools/langchain_mcp_tools.py,sha256=Z3_UrrD2Dp6R2tzPVSTw08ZiQGAvU0jtQi6Ix2QLjL8,47857
3
+ langchain_mcp_tools/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ langchain_mcp_tools-0.2.7.dist-info/licenses/LICENSE,sha256=CRC91e8v116gCpnp7h49oIa6_zjhxqnHFTREeoZFJwA,1072
5
+ langchain_mcp_tools-0.2.7.dist-info/METADATA,sha256=JfKggddIKbHgb2qvG3w4RiYJbUqLCyt7ckoGsyp1cZc,16080
6
+ langchain_mcp_tools-0.2.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ langchain_mcp_tools-0.2.7.dist-info/top_level.txt,sha256=aR_9V2A1Yt-Bca60KmndmGLUWb2wiM5IOG-Gkaf1dxY,20
8
+ langchain_mcp_tools-0.2.7.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- langchain_mcp_tools/__init__.py,sha256=vAPa7NK9mcKyzLFwiwF7nzvevHil4Tylc3EhE2CFEn4,223
2
- langchain_mcp_tools/langchain_mcp_tools.py,sha256=jgwLcmuBD00yvf-p_N7YapKO8Jvu7-UWTCsIB91ttS0,47665
3
- langchain_mcp_tools/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- langchain_mcp_tools-0.2.5.dist-info/licenses/LICENSE,sha256=CRC91e8v116gCpnp7h49oIa6_zjhxqnHFTREeoZFJwA,1072
5
- langchain_mcp_tools-0.2.5.dist-info/METADATA,sha256=W9Hs56GOwtt1JK77p24fbhIWLe5jrx4HmkGxfp9gMCU,16078
6
- langchain_mcp_tools-0.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- langchain_mcp_tools-0.2.5.dist-info/top_level.txt,sha256=aR_9V2A1Yt-Bca60KmndmGLUWb2wiM5IOG-Gkaf1dxY,20
8
- langchain_mcp_tools-0.2.5.dist-info/RECORD,,