langchain-mcp-tools 0.1.9__py3-none-any.whl → 0.1.10__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.
@@ -247,13 +247,22 @@ async def get_mcp_server_tools(
247
247
  return langchain_tools
248
248
 
249
249
 
250
+ # A very simple pre-implemented logger for fallback
251
+ def init_logger() -> logging.Logger:
252
+ logging.basicConfig(
253
+ level=logging.INFO, # logging.DEBUG,
254
+ format='\x1b[90m[%(levelname)s]\x1b[0m %(message)s'
255
+ )
256
+ return logging.getLogger()
257
+
258
+
250
259
  # Type hint for cleanup function
251
260
  McpServerCleanupFn = Callable[[], Awaitable[None]]
252
261
 
253
262
 
254
263
  async def convert_mcp_to_langchain_tools(
255
264
  server_configs: Dict[str, Dict[str, Any]],
256
- logger: logging.Logger = logging.getLogger(__name__)
265
+ logger: Optional[logging.Logger] = None
257
266
  ) -> Tuple[List[BaseTool], McpServerCleanupFn]:
258
267
  """Initialize multiple MCP servers and convert their tools to
259
268
  LangChain format.
@@ -267,7 +276,8 @@ async def convert_mcp_to_langchain_tools(
267
276
  configurations, where each configuration contains command, args,
268
277
  and env settings
269
278
  logger: Logger instance to use for logging events and errors.
270
- Defaults to module logger.
279
+ If None, uses module logger with fallback to a pre-configured
280
+ logger when no root handlers exist.
271
281
 
272
282
  Returns:
273
283
  A tuple containing:
@@ -285,6 +295,13 @@ async def convert_mcp_to_langchain_tools(
285
295
  await cleanup()
286
296
  """
287
297
 
298
+ if logger is None:
299
+ logger = logging.getLogger(__name__)
300
+ # Check if the root logger has handlers configured
301
+ if not logging.root.handlers and not logger.handlers:
302
+ # No logging configured, use our pre-implemented logger
303
+ logger = init_logger()
304
+
288
305
  # Initialize AsyncExitStack for managing multiple server lifecycles
289
306
  stdio_transports: List[StdioTransport] = []
290
307
  async_exit_stack = AsyncExitStack()
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: langchain-mcp-tools
3
- Version: 0.1.9
3
+ Version: 0.1.10
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
@@ -12,7 +12,6 @@ Requires-Dist: jsonschema-pydantic>=0.6
12
12
  Requires-Dist: langchain>=0.3.14
13
13
  Requires-Dist: mcp>=1.2.0
14
14
  Requires-Dist: pyjson5>=1.6.8
15
- Requires-Dist: python-dotenv>=1.0.1
16
15
  Provides-Extra: dev
17
16
  Requires-Dist: dotenv>=0.9.9; extra == "dev"
18
17
  Requires-Dist: langchain-anthropic>=0.3.1; extra == "dev"
@@ -21,6 +20,7 @@ Requires-Dist: langchain-openai>=0.3.0; extra == "dev"
21
20
  Requires-Dist: langgraph>=0.2.62; extra == "dev"
22
21
  Requires-Dist: pytest>=8.3.4; extra == "dev"
23
22
  Requires-Dist: pytest-asyncio>=0.25.2; extra == "dev"
23
+ Dynamic: license-file
24
24
 
25
25
  # MCP To LangChain Tools Conversion Utility [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/hideya/langchain-mcp-tools-py/blob/main/LICENSE) [![pypi version](https://img.shields.io/pypi/v/langchain-mcp-tools.svg)](https://pypi.org/project/langchain-mcp-tools/)
26
26
 
@@ -37,9 +37,9 @@ Google Drive, Slack, Notion, Spotify, Docker, PostgreSQL, and more…
37
37
 
38
38
  Over 1500 functional components available as MCP servers:
39
39
 
40
- - [Glama’s list of Open-Source MCP servers](https://glama.ai/mcp/servers)
40
+ - [MCP.so - Find Awesome MCP Servers and Clients](https://mcp.so/)
41
41
  - [Smithery: MCP Server Registry](https://smithery.ai/)
42
- - [awesome-mcp-servers](https://github.com/hideya/awesome-mcp-servers#Server-Implementations)
42
+ - [pulse - Browse and discover MCP use cases, servers, clients, and news](https://www.pulsemcp.com/)
43
43
  - [MCP Get Started/Example Servers](https://modelcontextprotocol.io/examples)
44
44
 
45
45
  The goal of this utility is to make these 1500+ MCP servers readily accessible from LangChain.
@@ -0,0 +1,8 @@
1
+ langchain_mcp_tools/__init__.py,sha256=Xtv2VphhrWB_KlxTIofHZqtCIGtNEl0MxugnrNXTERA,94
2
+ langchain_mcp_tools/langchain_mcp_tools.py,sha256=vIiOB8u62Q-7Mi8U6XI247g-xfxpE2QvoBeo0pbtFX4,12838
3
+ langchain_mcp_tools/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ langchain_mcp_tools-0.1.10.dist-info/licenses/LICENSE,sha256=CRC91e8v116gCpnp7h49oIa6_zjhxqnHFTREeoZFJwA,1072
5
+ langchain_mcp_tools-0.1.10.dist-info/METADATA,sha256=kAMCbY0YTAA5aj-SaiGqtAanX30ggpEeZO39zChua0Y,5135
6
+ langchain_mcp_tools-0.1.10.dist-info/WHEEL,sha256=DK49LOLCYiurdXXOXwGJm6U4DkHkg4lcxjhqwRa0CP4,91
7
+ langchain_mcp_tools-0.1.10.dist-info/top_level.txt,sha256=aR_9V2A1Yt-Bca60KmndmGLUWb2wiM5IOG-Gkaf1dxY,20
8
+ langchain_mcp_tools-0.1.10.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.1.0)
2
+ Generator: setuptools (78.0.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,8 +0,0 @@
1
- langchain_mcp_tools/__init__.py,sha256=Xtv2VphhrWB_KlxTIofHZqtCIGtNEl0MxugnrNXTERA,94
2
- langchain_mcp_tools/langchain_mcp_tools.py,sha256=0uKhEeaMLPTHvsLVMrs18MuVz1SxSQZmTE0y8NYbs5o,12221
3
- langchain_mcp_tools/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- langchain_mcp_tools-0.1.9.dist-info/LICENSE,sha256=CRC91e8v116gCpnp7h49oIa6_zjhxqnHFTREeoZFJwA,1072
5
- langchain_mcp_tools-0.1.9.dist-info/METADATA,sha256=7-GqU1Lt_iTfkY0Jn-OmKhcBTMseNx_DlRwTlZNmhbY,5150
6
- langchain_mcp_tools-0.1.9.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
7
- langchain_mcp_tools-0.1.9.dist-info/top_level.txt,sha256=aR_9V2A1Yt-Bca60KmndmGLUWb2wiM5IOG-Gkaf1dxY,20
8
- langchain_mcp_tools-0.1.9.dist-info/RECORD,,