mcp-use 1.3.13__py3-none-any.whl → 1.4.0__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.
Potentially problematic release.
This version of mcp-use might be problematic. Click here for more details.
- mcp_use/agents/adapters/__init__.py +8 -1
- mcp_use/agents/adapters/anthropic.py +93 -0
- mcp_use/agents/adapters/base.py +178 -55
- mcp_use/agents/adapters/google.py +103 -0
- mcp_use/agents/adapters/langchain_adapter.py +6 -22
- mcp_use/agents/adapters/openai.py +111 -0
- mcp_use/agents/mcpagent.py +371 -472
- mcp_use/agents/prompts/system_prompt_builder.py +1 -1
- mcp_use/agents/remote.py +1 -1
- mcp_use/client/auth/oauth_callback.py +3 -2
- mcp_use/logging.py +1 -1
- mcp_use/telemetry/utils.py +1 -1
- {mcp_use-1.3.13.dist-info → mcp_use-1.4.0.dist-info}/METADATA +18 -18
- {mcp_use-1.3.13.dist-info → mcp_use-1.4.0.dist-info}/RECORD +16 -14
- mcp_use/cli.py +0 -581
- {mcp_use-1.3.13.dist-info → mcp_use-1.4.0.dist-info}/WHEEL +0 -0
- {mcp_use-1.3.13.dist-info → mcp_use-1.4.0.dist-info}/entry_points.txt +0 -0
mcp_use/agents/remote.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""OAuth callback server implementation."""
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
|
+
import html
|
|
4
5
|
from dataclasses import dataclass
|
|
5
6
|
|
|
6
7
|
import anyio
|
|
@@ -170,8 +171,8 @@ class OAuthCallbackServer:
|
|
|
170
171
|
|
|
171
172
|
def _error_html(self, error: str | None, description: str | None) -> str:
|
|
172
173
|
"""HTML response for authorization error."""
|
|
173
|
-
error_msg = error or "Unknown error"
|
|
174
|
-
desc_msg = description or "Authorization was not completed successfully."
|
|
174
|
+
error_msg = html.escape(error or "Unknown error")
|
|
175
|
+
desc_msg = html.escape(description or "Authorization was not completed successfully.")
|
|
175
176
|
|
|
176
177
|
return f"""
|
|
177
178
|
<!DOCTYPE html>
|
mcp_use/logging.py
CHANGED
|
@@ -9,7 +9,7 @@ import logging
|
|
|
9
9
|
import os
|
|
10
10
|
import sys
|
|
11
11
|
|
|
12
|
-
from
|
|
12
|
+
from langchain_core.globals import set_debug as langchain_set_debug
|
|
13
13
|
|
|
14
14
|
# Global debug flag - can be set programmatically or from environment
|
|
15
15
|
MCP_USE_DEBUG = 1
|
mcp_use/telemetry/utils.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mcp-use
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: MCP Library for LLMs
|
|
5
5
|
Author-email: "mcp-use, Inc." <dev@mcp-use.io>, Pietro Zullo <pietro.zullo@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -16,8 +16,8 @@ Requires-Python: >=3.11
|
|
|
16
16
|
Requires-Dist: aiohttp>=3.9.0
|
|
17
17
|
Requires-Dist: authlib>=1.6.3
|
|
18
18
|
Requires-Dist: jsonschema-pydantic>=0.1.0
|
|
19
|
-
Requires-Dist: langchain-core
|
|
20
|
-
Requires-Dist: langchain
|
|
19
|
+
Requires-Dist: langchain-core>=1.0.0
|
|
20
|
+
Requires-Dist: langchain>=1.0.0
|
|
21
21
|
Requires-Dist: mcp>=1.10.0
|
|
22
22
|
Requires-Dist: posthog>=4.8.0
|
|
23
23
|
Requires-Dist: pydantic-core==2.33.2
|
|
@@ -54,7 +54,7 @@ Description-Content-Type: text/markdown
|
|
|
54
54
|
</picture>
|
|
55
55
|
</div>
|
|
56
56
|
|
|
57
|
-
<h1 align="center">🚀
|
|
57
|
+
<h1 align="center">🚀 mcp-use for Python</h1>
|
|
58
58
|
<p align="center">
|
|
59
59
|
<a href="https://github.com/pietrozullo/mcp-use/stargazers" alt="GitHub stars">
|
|
60
60
|
<img src="https://img.shields.io/github/stars/pietrozullo/mcp-use?style=social" /></a>
|
|
@@ -71,15 +71,15 @@ Description-Content-Type: text/markdown
|
|
|
71
71
|
</p>
|
|
72
72
|
</div>
|
|
73
73
|
|
|
74
|
-
> **📦 Part of the [
|
|
74
|
+
> **📦 Part of the [mcp-use Monorepo](../../README.md)** - This is the Python implementation. Also available in [TypeScript](../typescript/README.md).
|
|
75
75
|
|
|
76
|
-
🌐 **
|
|
76
|
+
🌐 **mcp-use for Python** is the complete way to connect **any LLM to any MCP server** and build custom MCP agents with tool access.
|
|
77
77
|
|
|
78
78
|
💡 Let your Python applications leverage the power of the Model Context Protocol with support for agents, clients, and advanced features.
|
|
79
79
|
|
|
80
80
|
## 🏗️ What's Included
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
mcp-use for Python provides three main capabilities:
|
|
83
83
|
|
|
84
84
|
- **🤖 MCP Agent** - Build AI agents that can use tools and reason across multiple steps
|
|
85
85
|
- **🔌 MCP Client** - Connect directly to MCP servers for programmatic tool access
|
|
@@ -89,15 +89,15 @@ MCP-Use for Python provides three main capabilities:
|
|
|
89
89
|
|
|
90
90
|
## 📖 Quick Links
|
|
91
91
|
|
|
92
|
-
- **[Main Repository](../../README.md)** - Overview of the entire
|
|
92
|
+
- **[Main Repository](../../README.md)** - Overview of the entire mcp-use ecosystem
|
|
93
93
|
- **[TypeScript Version](../typescript/README.md)** - TypeScript implementation with server framework
|
|
94
94
|
- **[Documentation](https://docs.mcp-use.com)** - Complete online documentation
|
|
95
95
|
- **[Examples](./examples/)** - Python code examples
|
|
96
96
|
|
|
97
97
|
| Supports | |
|
|
98
98
|
| :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
99
|
-
| **Primitives** | [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) |
|
|
100
|
+
| **Transports** | [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) |
|
|
101
101
|
|
|
102
102
|
## Features
|
|
103
103
|
|
|
@@ -260,7 +260,7 @@ For other settings, models, and more, check out the documentation.
|
|
|
260
260
|
|
|
261
261
|
## Streaming Agent Output
|
|
262
262
|
|
|
263
|
-
|
|
263
|
+
mcp-use supports asynchronous streaming of agent output using the `stream` method on `MCPAgent`. This allows you to receive incremental results, tool actions, and intermediate steps as they are generated by the agent, enabling real-time feedback and progress reporting.
|
|
264
264
|
|
|
265
265
|
### How to use
|
|
266
266
|
|
|
@@ -433,7 +433,7 @@ if __name__ == "__main__":
|
|
|
433
433
|
|
|
434
434
|
## HTTP Connection Example
|
|
435
435
|
|
|
436
|
-
|
|
436
|
+
mcp-use supports HTTP connections, allowing you to connect to MCP servers running on specific HTTP ports. This feature is particularly useful for integrating with web-based MCP servers.
|
|
437
437
|
|
|
438
438
|
Here's an example of how to use the HTTP connection feature:
|
|
439
439
|
|
|
@@ -482,7 +482,7 @@ This example demonstrates how to connect to an MCP server running on a specific
|
|
|
482
482
|
|
|
483
483
|
# Multi-Server Support
|
|
484
484
|
|
|
485
|
-
|
|
485
|
+
mcp-use allows configuring and connecting to multiple MCP servers simultaneously using the `MCPClient`. This enables complex workflows that require tools from different servers, such as web browsing combined with file operations or 3D modeling.
|
|
486
486
|
|
|
487
487
|
## Configuration
|
|
488
488
|
|
|
@@ -564,7 +564,7 @@ if __name__ == "__main__":
|
|
|
564
564
|
|
|
565
565
|
# Tool Access Control
|
|
566
566
|
|
|
567
|
-
|
|
567
|
+
mcp-use allows you to restrict which tools are available to the agent, providing better security and control over agent capabilities:
|
|
568
568
|
|
|
569
569
|
```python
|
|
570
570
|
import asyncio
|
|
@@ -597,7 +597,7 @@ if __name__ == "__main__":
|
|
|
597
597
|
|
|
598
598
|
# Sandboxed Execution
|
|
599
599
|
|
|
600
|
-
|
|
600
|
+
mcp-use supports running MCP servers in a sandboxed environment using E2B's cloud infrastructure. This allows you to run MCP servers without having to install dependencies locally, making it easier to use tools that might have complex setups or system requirements.
|
|
601
601
|
|
|
602
602
|
## Installation
|
|
603
603
|
|
|
@@ -787,7 +787,7 @@ Python agents and clients can connect to TypeScript servers seamlessly - the MCP
|
|
|
787
787
|
|
|
788
788
|
# Debugging
|
|
789
789
|
|
|
790
|
-
|
|
790
|
+
mcp-use provides a built-in debug mode that increases log verbosity and helps diagnose issues in your agent implementation.
|
|
791
791
|
|
|
792
792
|
## Enabling Debug Mode
|
|
793
793
|
|
|
@@ -913,12 +913,12 @@ MIT
|
|
|
913
913
|
|
|
914
914
|
# Citation
|
|
915
915
|
|
|
916
|
-
If you use
|
|
916
|
+
If you use mcp-use in your research or project, please cite:
|
|
917
917
|
|
|
918
918
|
```bibtex
|
|
919
919
|
@software{mcp_use2025,
|
|
920
920
|
author = {Zullo, Pietro},
|
|
921
|
-
title = {
|
|
921
|
+
title = {mcp-use: MCP Library for Python},
|
|
922
922
|
year = {2025},
|
|
923
923
|
publisher = {GitHub},
|
|
924
924
|
url = {https://github.com/pietrozullo/mcp-use}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
mcp_use/__init__.py,sha256=0LfDNKkzNXXOx9B4-SsMIuwkj9Cm-8JVPmC9yb5cFnw,1277
|
|
2
|
-
mcp_use/cli.py,sha256=d3_RqN-lca7igS-aZQIdNQidBOILVihyldywcf8GR-c,15602
|
|
3
2
|
mcp_use/client.py,sha256=m-nwSnO147tBXji0KmXULJ2B1Uy7cGidnutRTnASmjU,426
|
|
4
3
|
mcp_use/config.py,sha256=RNYKUJPEpLGZQFg-ahwsYf1B7xXZM1gUA-_57FngAJc,760
|
|
5
4
|
mcp_use/exceptions.py,sha256=YAbLz1S_4aQiNGWgh80lk0lwgF3L109P-cjbV_QW-WQ,1260
|
|
6
|
-
mcp_use/logging.py,sha256=
|
|
5
|
+
mcp_use/logging.py,sha256=y0BEx1bofSehRqGIe6oTRtHDqTb_KnmAxcH6V1oR6Do,4976
|
|
7
6
|
mcp_use/session.py,sha256=2exxHhIfXcf6UFndiwmi-db3Wvh_Dqeh89iiSIcFtYY,438
|
|
8
7
|
mcp_use/utils.py,sha256=QavJcVq2WxUUUCCpPCUeOB5bqIS0FFmpK-RAZkGc6aA,720
|
|
9
8
|
mcp_use/adapters/.deprecated,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -12,11 +11,14 @@ mcp_use/adapters/base.py,sha256=Cc-stCnM6j0JtQeR1j1sqQX0ZtHjWUFdRNKsHiQv6mQ,444
|
|
|
12
11
|
mcp_use/adapters/langchain_adapter.py,sha256=LDlCvqnWDNmY1YxNKYX9PafNZl9o8LMXwp3W4XQaJLY,541
|
|
13
12
|
mcp_use/agents/__init__.py,sha256=FzkntihbAqzixWdWe99zIrrcIfd4N3YWltNniutG9VA,267
|
|
14
13
|
mcp_use/agents/base.py,sha256=3hlKEnSq89yMdd6tBN_FPfx-aPj7En0yNqE7EqTQpVQ,1604
|
|
15
|
-
mcp_use/agents/mcpagent.py,sha256=
|
|
16
|
-
mcp_use/agents/remote.py,sha256=
|
|
17
|
-
mcp_use/agents/adapters/__init__.py,sha256
|
|
18
|
-
mcp_use/agents/adapters/
|
|
19
|
-
mcp_use/agents/adapters/
|
|
14
|
+
mcp_use/agents/mcpagent.py,sha256=tiPFeN5oFwch3ULD8Ggcn4cl3v5tFknC4VtgJebDkzU,49586
|
|
15
|
+
mcp_use/agents/remote.py,sha256=wBzkU7rgkA1EBMSfedyLsA01Rz4I2AXPwo-z607Uy2Q,16511
|
|
16
|
+
mcp_use/agents/adapters/__init__.py,sha256=VIxigHnP0ZBUTFV3bQlxnYNgXhawkuoY7OtYe6dZiqw,582
|
|
17
|
+
mcp_use/agents/adapters/anthropic.py,sha256=EZ8XEArYaXacmqCKC4aEhiHNI-rfEBP3Y9GPHt08Uow,3753
|
|
18
|
+
mcp_use/agents/adapters/base.py,sha256=37GjE3WiBfatoT5AnXXPkbxa18WROdP6-MQBKTLbv5k,12398
|
|
19
|
+
mcp_use/agents/adapters/google.py,sha256=YCBrYJFbqnKBxMrzmk0tGUQcBT3knAH5zEzLQ7O2nTU,4284
|
|
20
|
+
mcp_use/agents/adapters/langchain_adapter.py,sha256=eu4_71VE7cURj493FtZRGwiWBZFtWCPeC3AHlPSzys0,8865
|
|
21
|
+
mcp_use/agents/adapters/openai.py,sha256=pItLuNbuzrGydmxEzxidNkTNITCleQInUwYxdmHD1C8,4236
|
|
20
22
|
mcp_use/agents/managers/__init__.py,sha256=FRTuJw5kYtY1Eo7wN9Aeqeqo1euiR5slvrx5Fl_SGvk,383
|
|
21
23
|
mcp_use/agents/managers/base.py,sha256=fJA4ct6GIcACOzmCSQGga1HoHYjsauaMHZsXehCPQNA,1138
|
|
22
24
|
mcp_use/agents/managers/server_manager.py,sha256=MdsttZ3zl0sMUslZTfZ6xNZkDNTIK9_TggDKT-LY5mw,5485
|
|
@@ -31,7 +33,7 @@ mcp_use/agents/observability/__init__.py,sha256=qJR51lpW6lVvhgNnUHBXYN6FKn4kDKbG
|
|
|
31
33
|
mcp_use/agents/observability/callbacks_manager.py,sha256=6jIcE6ofiLRxoi4fECaTlpnllTEFQdwB0IZ0ZkY0WAQ,5324
|
|
32
34
|
mcp_use/agents/observability/laminar.py,sha256=eBY23B8rxQOW5ggHeGB0ZCpCSMnK4rC8fBOvDdbuoq4,1613
|
|
33
35
|
mcp_use/agents/observability/langfuse.py,sha256=kOF05cbSEir7r3fibx_q6TfKzqmbjKLV7uNxBote9XY,2677
|
|
34
|
-
mcp_use/agents/prompts/system_prompt_builder.py,sha256=
|
|
36
|
+
mcp_use/agents/prompts/system_prompt_builder.py,sha256=1Nt4JA_WZFuTiA-cz5EA9_pUHBzLIO1yR2_pMvaa_-U,4123
|
|
35
37
|
mcp_use/agents/prompts/templates.py,sha256=Yd-3NILgHXTrBUw9WE11gt0-QrlvN1pykeEpg3LY4HU,1545
|
|
36
38
|
mcp_use/auth/.deprecated,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
39
|
mcp_use/auth/__init__.py,sha256=5ZetbbZDfGI4vli6tgHt-XTAEZh7fqn_eHdF0Rirsf4,516
|
|
@@ -46,7 +48,7 @@ mcp_use/client/session.py,sha256=DPud5dMil3lJq9pUQq4z9IpWCy_xRmpzKeCVLVzNKp8,503
|
|
|
46
48
|
mcp_use/client/auth/__init__.py,sha256=TBNMvgRDp-lC3n2f0UB6kZUZlJ35SYRBVDt3hadpvXI,138
|
|
47
49
|
mcp_use/client/auth/bearer.py,sha256=wgG3_TZDNoqo7hnezLHqOZpsWFOAXTxFbIg6t1qemQ8,678
|
|
48
50
|
mcp_use/client/auth/oauth.py,sha256=HU1sxo74L-0Gf-VbK4FmSrZKoxkJg4bW50emUakYBoE,27801
|
|
49
|
-
mcp_use/client/auth/oauth_callback.py,sha256=
|
|
51
|
+
mcp_use/client/auth/oauth_callback.py,sha256=BRdVnbt1SENvsrudBFUB_XYhRb1G30Qjf8x5Vw1xZzo,7558
|
|
50
52
|
mcp_use/client/connectors/__init__.py,sha256=cUF4yT0bNr8qeLkSzg28SHueiV5qDaHEB1l1GZ2K0dc,536
|
|
51
53
|
mcp_use/client/connectors/base.py,sha256=R5NbN_NGuJnT82cGMweOaAdA5g6mZnsN4KyqG0_XffE,18687
|
|
52
54
|
mcp_use/client/connectors/http.py,sha256=LFk8QLx4GBYWe7lYWHXfC8HH97lOSFAJRuhW7XlkLY8,13742
|
|
@@ -100,10 +102,10 @@ mcp_use/task_managers/websocket.py,sha256=cis-KJFccCi55rvk-FVlKFtncGNnm8QiNcpwzu
|
|
|
100
102
|
mcp_use/telemetry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
101
103
|
mcp_use/telemetry/events.py,sha256=4u-PWeg03jozG9rLunDB7JHtFmmesgu3J8aRAq93qAU,4706
|
|
102
104
|
mcp_use/telemetry/telemetry.py,sha256=uCOGRDNTyDfyvBGypGUpTk9-IGOe2P7CbUQjPlnkQ9Y,14082
|
|
103
|
-
mcp_use/telemetry/utils.py,sha256=
|
|
105
|
+
mcp_use/telemetry/utils.py,sha256=_nPJU7e1XZeUWcWKmumbhNcC2OEAU1wvNXJe3CNgHEY,1764
|
|
104
106
|
mcp_use/types/.deprecated,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
105
107
|
mcp_use/types/sandbox.py,sha256=gaZaLE-i6rftaIF-OYyMDc1W6Il-g4MpFbCD1IdyBPg,481
|
|
106
|
-
mcp_use-1.
|
|
107
|
-
mcp_use-1.
|
|
108
|
-
mcp_use-1.
|
|
109
|
-
mcp_use-1.
|
|
108
|
+
mcp_use-1.4.0.dist-info/METADATA,sha256=pnimjYDLE5DteEtiB0eIH5QuyQTbILh7etAlnLrdOc4,35394
|
|
109
|
+
mcp_use-1.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
110
|
+
mcp_use-1.4.0.dist-info/entry_points.txt,sha256=3jzEN6xbVsMErm_cxlHpCzvM97gFgjvtOEEspUp1vK8,45
|
|
111
|
+
mcp_use-1.4.0.dist-info/RECORD,,
|