langchain-mcp-tools 0.1.5__tar.gz → 0.1.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.1.5/src/langchain_mcp_tools.egg-info → langchain_mcp_tools-0.1.7}/PKG-INFO +10 -10
- {langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7}/README.md +4 -4
- {langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7}/pyproject.toml +6 -6
- {langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7}/src/langchain_mcp_tools/langchain_mcp_tools.py +22 -6
- {langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7/src/langchain_mcp_tools.egg-info}/PKG-INFO +10 -10
- {langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7}/src/langchain_mcp_tools.egg-info/requires.txt +5 -5
- {langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7}/LICENSE +0 -0
- {langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7}/setup.cfg +0 -0
- {langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7}/src/langchain_mcp_tools/__init__.py +0 -0
- {langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7}/src/langchain_mcp_tools/py.typed +0 -0
- {langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7}/src/langchain_mcp_tools.egg-info/SOURCES.txt +0 -0
- {langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7}/src/langchain_mcp_tools.egg-info/dependency_links.txt +0 -0
- {langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7}/src/langchain_mcp_tools.egg-info/top_level.txt +0 -0
- {langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7}/tests/test_langchain_mcp_tools.py +0 -0
{langchain_mcp_tools-0.1.5/src/langchain_mcp_tools.egg-info → langchain_mcp_tools-0.1.7}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: langchain-mcp-tools
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.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
|
@@ -10,15 +10,15 @@ Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
11
11
|
Requires-Dist: jsonschema-pydantic>=0.6
|
12
12
|
Requires-Dist: langchain>=0.3.14
|
13
|
-
Requires-Dist: langchain-anthropic>=0.3.1
|
14
|
-
Requires-Dist: langchain-groq>=0.2.3
|
15
|
-
Requires-Dist: langchain-openai>=0.3.0
|
16
|
-
Requires-Dist: langgraph>=0.2.62
|
17
13
|
Requires-Dist: mcp>=1.2.0
|
18
14
|
Requires-Dist: pyjson5>=1.6.8
|
19
|
-
Requires-Dist: pympler>=1.1
|
20
15
|
Requires-Dist: python-dotenv>=1.0.1
|
21
16
|
Provides-Extra: dev
|
17
|
+
Requires-Dist: dotenv>=0.9.9; extra == "dev"
|
18
|
+
Requires-Dist: langchain-anthropic>=0.3.1; extra == "dev"
|
19
|
+
Requires-Dist: langchain-groq>=0.2.3; extra == "dev"
|
20
|
+
Requires-Dist: langchain-openai>=0.3.0; extra == "dev"
|
21
|
+
Requires-Dist: langgraph>=0.2.62; extra == "dev"
|
22
22
|
Requires-Dist: pytest>=8.3.4; extra == "dev"
|
23
23
|
Requires-Dist: pytest-asyncio>=0.25.2; extra == "dev"
|
24
24
|
|
@@ -35,21 +35,21 @@ dramatically expands LLM’s scope
|
|
35
35
|
by enabling external tool and resource integration, including
|
36
36
|
Google Drive, Slack, Notion, Spotify, Docker, PostgreSQL, and more…
|
37
37
|
|
38
|
-
Over
|
38
|
+
Over 800 functional components available as MCP servers:
|
39
39
|
|
40
40
|
- [Glama’s list of Open-Source MCP servers](https://glama.ai/mcp/servers)
|
41
41
|
- [Smithery: MCP Server Registry](https://smithery.ai/)
|
42
42
|
- [awesome-mcp-servers](https://github.com/hideya/awesome-mcp-servers#Server-Implementations)
|
43
43
|
- [MCP Get Started/Example Servers](https://modelcontextprotocol.io/examples)
|
44
44
|
|
45
|
-
The goal of this utility is to make these
|
45
|
+
The goal of this utility is to make these 800+ MCP servers readily accessible from LangChain.
|
46
46
|
|
47
47
|
It contains a utility function `convert_mcp_to_langchain_tools()`.
|
48
48
|
This async function handles parallel initialization of specified multiple MCP servers
|
49
49
|
and converts their available tools into a list of LangChain-compatible tools.
|
50
50
|
|
51
51
|
For detailed information on how to use this library, please refer to the following document:
|
52
|
-
- ["Supercharging LangChain: Integrating
|
52
|
+
- ["Supercharging LangChain: Integrating 800+ MCP with ReAct"](https://medium.com/@h1deya/supercharging-langchain-integrating-800-mcp-with-react-d4e467cbf41a)
|
53
53
|
|
54
54
|
A typescript equivalent of this utility is available
|
55
55
|
[here](https://www.npmjs.com/package/@h1deya/langchain-mcp-tools)
|
@@ -120,7 +120,7 @@ For hands-on experimentation with MCP server integration,
|
|
120
120
|
try [this LangChain application built with the utility](https://github.com/hideya/mcp-client-langchain-py)
|
121
121
|
|
122
122
|
For detailed information on how to use this library, please refer to the following document:
|
123
|
-
["Supercharging LangChain: Integrating
|
123
|
+
["Supercharging LangChain: Integrating 800+ MCP with ReAct"](https://medium.com/@h1deya/supercharging-langchain-integrating-800-mcp-with-react-d4e467cbf41a)
|
124
124
|
|
125
125
|
## Limitations
|
126
126
|
|
@@ -11,21 +11,21 @@ dramatically expands LLM’s scope
|
|
11
11
|
by enabling external tool and resource integration, including
|
12
12
|
Google Drive, Slack, Notion, Spotify, Docker, PostgreSQL, and more…
|
13
13
|
|
14
|
-
Over
|
14
|
+
Over 800 functional components available as MCP servers:
|
15
15
|
|
16
16
|
- [Glama’s list of Open-Source MCP servers](https://glama.ai/mcp/servers)
|
17
17
|
- [Smithery: MCP Server Registry](https://smithery.ai/)
|
18
18
|
- [awesome-mcp-servers](https://github.com/hideya/awesome-mcp-servers#Server-Implementations)
|
19
19
|
- [MCP Get Started/Example Servers](https://modelcontextprotocol.io/examples)
|
20
20
|
|
21
|
-
The goal of this utility is to make these
|
21
|
+
The goal of this utility is to make these 800+ MCP servers readily accessible from LangChain.
|
22
22
|
|
23
23
|
It contains a utility function `convert_mcp_to_langchain_tools()`.
|
24
24
|
This async function handles parallel initialization of specified multiple MCP servers
|
25
25
|
and converts their available tools into a list of LangChain-compatible tools.
|
26
26
|
|
27
27
|
For detailed information on how to use this library, please refer to the following document:
|
28
|
-
- ["Supercharging LangChain: Integrating
|
28
|
+
- ["Supercharging LangChain: Integrating 800+ MCP with ReAct"](https://medium.com/@h1deya/supercharging-langchain-integrating-800-mcp-with-react-d4e467cbf41a)
|
29
29
|
|
30
30
|
A typescript equivalent of this utility is available
|
31
31
|
[here](https://www.npmjs.com/package/@h1deya/langchain-mcp-tools)
|
@@ -96,7 +96,7 @@ For hands-on experimentation with MCP server integration,
|
|
96
96
|
try [this LangChain application built with the utility](https://github.com/hideya/mcp-client-langchain-py)
|
97
97
|
|
98
98
|
For detailed information on how to use this library, please refer to the following document:
|
99
|
-
["Supercharging LangChain: Integrating
|
99
|
+
["Supercharging LangChain: Integrating 800+ MCP with ReAct"](https://medium.com/@h1deya/supercharging-langchain-integrating-800-mcp-with-react-d4e467cbf41a)
|
100
100
|
|
101
101
|
## Limitations
|
102
102
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "langchain-mcp-tools"
|
3
|
-
version = "0.1.
|
3
|
+
version = "0.1.7"
|
4
4
|
description = "Model Context Protocol (MCP) To LangChain Tools Conversion Utility"
|
5
5
|
keywords = [
|
6
6
|
"modelcontextprotocol",
|
@@ -17,18 +17,18 @@ requires-python = ">=3.11"
|
|
17
17
|
dependencies = [
|
18
18
|
"jsonschema-pydantic>=0.6",
|
19
19
|
"langchain>=0.3.14",
|
20
|
-
"langchain-anthropic>=0.3.1",
|
21
|
-
"langchain-groq>=0.2.3",
|
22
|
-
"langchain-openai>=0.3.0",
|
23
|
-
"langgraph>=0.2.62",
|
24
20
|
"mcp>=1.2.0",
|
25
21
|
"pyjson5>=1.6.8",
|
26
|
-
"pympler>=1.1",
|
27
22
|
"python-dotenv>=1.0.1",
|
28
23
|
]
|
29
24
|
|
30
25
|
[project.optional-dependencies]
|
31
26
|
dev = [
|
27
|
+
"dotenv>=0.9.9",
|
28
|
+
"langchain-anthropic>=0.3.1",
|
29
|
+
"langchain-groq>=0.2.3",
|
30
|
+
"langchain-openai>=0.3.0",
|
31
|
+
"langgraph>=0.2.62",
|
32
32
|
"pytest>=8.3.4",
|
33
33
|
"pytest-asyncio>=0.25.2",
|
34
34
|
]
|
@@ -28,7 +28,7 @@ try:
|
|
28
28
|
from mcp.client.stdio import stdio_client
|
29
29
|
import mcp.types as mcp_types
|
30
30
|
from pydantic import BaseModel
|
31
|
-
from
|
31
|
+
# from pydantic_core import to_json
|
32
32
|
except ImportError as e:
|
33
33
|
print(f'\nError: Required package not found: {e}')
|
34
34
|
print('Please ensure all required packages are installed\n')
|
@@ -165,8 +165,8 @@ async def get_mcp_server_tools(
|
|
165
165
|
Asynchronously executes the tool with given arguments.
|
166
166
|
Logs input/output and handles errors.
|
167
167
|
"""
|
168
|
-
logger.info(f'MCP tool "{server_name}"/"{tool.name}"'
|
169
|
-
f'
|
168
|
+
logger.info(f'MCP tool "{server_name}"/"{tool.name}" '
|
169
|
+
f'received input: {kwargs}')
|
170
170
|
|
171
171
|
try:
|
172
172
|
result = await session.call_tool(self.name, kwargs)
|
@@ -186,7 +186,12 @@ async def get_mcp_server_tools(
|
|
186
186
|
for item in result.content
|
187
187
|
if isinstance(item, mcp_types.TextContent)
|
188
188
|
)
|
189
|
-
|
189
|
+
# text_items = [
|
190
|
+
# item
|
191
|
+
# for item in result.content
|
192
|
+
# if isinstance(item, mcp_types.TextContent)
|
193
|
+
# ]
|
194
|
+
# result_content_text =to_json(text_items).decode()
|
190
195
|
|
191
196
|
except KeyError as e:
|
192
197
|
result_content_text = (
|
@@ -194,14 +199,25 @@ async def get_mcp_server_tools(
|
|
194
199
|
f'contents: {repr(result.content)}'
|
195
200
|
)
|
196
201
|
|
197
|
-
# Log result size for monitoring
|
198
|
-
size =
|
202
|
+
# Log rough result size for monitoring
|
203
|
+
size = len(result_content_text.encode())
|
199
204
|
logger.info(f'MCP tool "{server_name}"/"{tool.name}" '
|
200
205
|
f'received result (size: {size})')
|
201
206
|
|
207
|
+
# If no text content, return a clear message
|
208
|
+
# describing the situation.
|
209
|
+
result_content_text = (
|
210
|
+
result_content_text or
|
211
|
+
'No text content available in response'
|
212
|
+
)
|
213
|
+
|
202
214
|
return result_content_text
|
203
215
|
|
204
216
|
except Exception as e:
|
217
|
+
logger.warn(
|
218
|
+
f'MCP tool "{server_name}"/"{tool.name}" '
|
219
|
+
f'caused error: {str(e)}'
|
220
|
+
)
|
205
221
|
if self.handle_tool_error:
|
206
222
|
return f'Error executing MCP tool: {str(e)}'
|
207
223
|
raise
|
{langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7/src/langchain_mcp_tools.egg-info}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: langchain-mcp-tools
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.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
|
@@ -10,15 +10,15 @@ Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
11
11
|
Requires-Dist: jsonschema-pydantic>=0.6
|
12
12
|
Requires-Dist: langchain>=0.3.14
|
13
|
-
Requires-Dist: langchain-anthropic>=0.3.1
|
14
|
-
Requires-Dist: langchain-groq>=0.2.3
|
15
|
-
Requires-Dist: langchain-openai>=0.3.0
|
16
|
-
Requires-Dist: langgraph>=0.2.62
|
17
13
|
Requires-Dist: mcp>=1.2.0
|
18
14
|
Requires-Dist: pyjson5>=1.6.8
|
19
|
-
Requires-Dist: pympler>=1.1
|
20
15
|
Requires-Dist: python-dotenv>=1.0.1
|
21
16
|
Provides-Extra: dev
|
17
|
+
Requires-Dist: dotenv>=0.9.9; extra == "dev"
|
18
|
+
Requires-Dist: langchain-anthropic>=0.3.1; extra == "dev"
|
19
|
+
Requires-Dist: langchain-groq>=0.2.3; extra == "dev"
|
20
|
+
Requires-Dist: langchain-openai>=0.3.0; extra == "dev"
|
21
|
+
Requires-Dist: langgraph>=0.2.62; extra == "dev"
|
22
22
|
Requires-Dist: pytest>=8.3.4; extra == "dev"
|
23
23
|
Requires-Dist: pytest-asyncio>=0.25.2; extra == "dev"
|
24
24
|
|
@@ -35,21 +35,21 @@ dramatically expands LLM’s scope
|
|
35
35
|
by enabling external tool and resource integration, including
|
36
36
|
Google Drive, Slack, Notion, Spotify, Docker, PostgreSQL, and more…
|
37
37
|
|
38
|
-
Over
|
38
|
+
Over 800 functional components available as MCP servers:
|
39
39
|
|
40
40
|
- [Glama’s list of Open-Source MCP servers](https://glama.ai/mcp/servers)
|
41
41
|
- [Smithery: MCP Server Registry](https://smithery.ai/)
|
42
42
|
- [awesome-mcp-servers](https://github.com/hideya/awesome-mcp-servers#Server-Implementations)
|
43
43
|
- [MCP Get Started/Example Servers](https://modelcontextprotocol.io/examples)
|
44
44
|
|
45
|
-
The goal of this utility is to make these
|
45
|
+
The goal of this utility is to make these 800+ MCP servers readily accessible from LangChain.
|
46
46
|
|
47
47
|
It contains a utility function `convert_mcp_to_langchain_tools()`.
|
48
48
|
This async function handles parallel initialization of specified multiple MCP servers
|
49
49
|
and converts their available tools into a list of LangChain-compatible tools.
|
50
50
|
|
51
51
|
For detailed information on how to use this library, please refer to the following document:
|
52
|
-
- ["Supercharging LangChain: Integrating
|
52
|
+
- ["Supercharging LangChain: Integrating 800+ MCP with ReAct"](https://medium.com/@h1deya/supercharging-langchain-integrating-800-mcp-with-react-d4e467cbf41a)
|
53
53
|
|
54
54
|
A typescript equivalent of this utility is available
|
55
55
|
[here](https://www.npmjs.com/package/@h1deya/langchain-mcp-tools)
|
@@ -120,7 +120,7 @@ For hands-on experimentation with MCP server integration,
|
|
120
120
|
try [this LangChain application built with the utility](https://github.com/hideya/mcp-client-langchain-py)
|
121
121
|
|
122
122
|
For detailed information on how to use this library, please refer to the following document:
|
123
|
-
["Supercharging LangChain: Integrating
|
123
|
+
["Supercharging LangChain: Integrating 800+ MCP with ReAct"](https://medium.com/@h1deya/supercharging-langchain-integrating-800-mcp-with-react-d4e467cbf41a)
|
124
124
|
|
125
125
|
## Limitations
|
126
126
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
jsonschema-pydantic>=0.6
|
2
2
|
langchain>=0.3.14
|
3
|
-
langchain-anthropic>=0.3.1
|
4
|
-
langchain-groq>=0.2.3
|
5
|
-
langchain-openai>=0.3.0
|
6
|
-
langgraph>=0.2.62
|
7
3
|
mcp>=1.2.0
|
8
4
|
pyjson5>=1.6.8
|
9
|
-
pympler>=1.1
|
10
5
|
python-dotenv>=1.0.1
|
11
6
|
|
12
7
|
[dev]
|
8
|
+
dotenv>=0.9.9
|
9
|
+
langchain-anthropic>=0.3.1
|
10
|
+
langchain-groq>=0.2.3
|
11
|
+
langchain-openai>=0.3.0
|
12
|
+
langgraph>=0.2.62
|
13
13
|
pytest>=8.3.4
|
14
14
|
pytest-asyncio>=0.25.2
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langchain_mcp_tools-0.1.5 → langchain_mcp_tools-0.1.7}/src/langchain_mcp_tools.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|