langchain-mcp-tools 0.2.6__tar.gz → 0.2.7__tar.gz
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.
- {langchain_mcp_tools-0.2.6/src/langchain_mcp_tools.egg-info → langchain_mcp_tools-0.2.7}/PKG-INFO +4 -4
- {langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7}/README.md +3 -3
- {langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7}/pyproject.toml +1 -1
- {langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7}/src/langchain_mcp_tools/langchain_mcp_tools.py +7 -4
- {langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7/src/langchain_mcp_tools.egg-info}/PKG-INFO +4 -4
- {langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7}/LICENSE +0 -0
- {langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7}/setup.cfg +0 -0
- {langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7}/src/langchain_mcp_tools/__init__.py +0 -0
- {langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7}/src/langchain_mcp_tools/py.typed +0 -0
- {langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7}/src/langchain_mcp_tools.egg-info/SOURCES.txt +0 -0
- {langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7}/src/langchain_mcp_tools.egg-info/dependency_links.txt +0 -0
- {langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7}/src/langchain_mcp_tools.egg-info/requires.txt +0 -0
- {langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7}/src/langchain_mcp_tools.egg-info/top_level.txt +0 -0
- {langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7}/tests/test_langchain_mcp_tools.py +0 -0
{langchain_mcp_tools-0.2.6/src/langchain_mcp_tools.egg-info → langchain_mcp_tools-0.2.7}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: langchain-mcp-tools
|
3
|
-
Version: 0.2.
|
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
|
@@ -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("
|
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:
|
@@ -104,7 +104,7 @@ The returned tools can be used with LangChain, e.g.:
|
|
104
104
|
|
105
105
|
```python
|
106
106
|
# from langchain.chat_models import init_chat_model
|
107
|
-
llm = init_chat_model("
|
107
|
+
llm = init_chat_model("google_genai:gemini-2.0-flash")
|
108
108
|
|
109
109
|
# from langgraph.prebuilt import create_react_agent
|
110
110
|
agent = create_react_agent(
|
@@ -128,6 +128,8 @@ See [README_DEV.md](https://github.com/hideya/langchain-mcp-tools-py/blob/main/R
|
|
128
128
|
This library supports **MCP Protocol version 2025-03-26** and maintains backwards compatibility with version 2024-11-05.
|
129
129
|
It follows the [official MCP specification](https://modelcontextprotocol.io/specification/2025-03-26/) for transport selection and backwards compatibility.
|
130
130
|
|
131
|
+
**Note:** The library automatically adds the `PATH` environment variable to stdio servers if not explicitly provided to ensure servers can find required executables.
|
132
|
+
|
131
133
|
## Features
|
132
134
|
|
133
135
|
### stderr Redirection for Local MCP Server
|
@@ -161,8 +163,6 @@ can be specified with the `"cwd"` key as follows:
|
|
161
163
|
The key name `cwd` is derived from
|
162
164
|
Python SDK's [`StdioServerParameters`](https://github.com/modelcontextprotocol/python-sdk/blob/babb477dffa33f46cdc886bc885eb1d521151430/src/mcp/client/stdio/__init__.py#L76-L77).
|
163
165
|
|
164
|
-
**Note:** The library automatically adds the `PATH` environment variable to stdio servers if not explicitly provided to ensure servers can find required executables.
|
165
|
-
|
166
166
|
### Transport Selection Priority
|
167
167
|
|
168
168
|
The library selects transports using the following priority order:
|
@@ -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:
|
{langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7/src/langchain_mcp_tools.egg-info}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: langchain-mcp-tools
|
3
|
-
Version: 0.2.
|
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
|
@@ -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("
|
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:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langchain_mcp_tools-0.2.6 → langchain_mcp_tools-0.2.7}/src/langchain_mcp_tools.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|