mcp-use 1.1.4__py3-none-any.whl → 1.1.5__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.

@@ -112,7 +112,7 @@ class LangChainAgent:
112
112
  # Recreate the agent with the new system message if it exists
113
113
  if self.agent and self.tools:
114
114
  self.agent = self._create_agent()
115
- logger.info("Agent recreated with new system message")
115
+ logger.debug("Agent recreated with new system message")
116
116
 
117
117
  async def initialize(self) -> None:
118
118
  """Initialize the agent and its tools."""
@@ -181,7 +181,7 @@ class LangChainAgent:
181
181
  Raises:
182
182
  ToolException: If tool execution fails.
183
183
  """
184
- logger.info(f'MCP tool: "{self.name}" received input: {kwargs}')
184
+ logger.debug(f'MCP tool: "{self.name}" received input: {kwargs}')
185
185
 
186
186
  try:
187
187
  tool_result: CallToolResult = await self.connector.call_tool(
@@ -207,7 +207,7 @@ class LangChainAgent:
207
207
  tools.append(McpToLangChainAdapter())
208
208
 
209
209
  # Log available tools for debugging
210
- logger.info(f"Available tools: {[tool.name for tool in tools]}")
210
+ logger.debug(f"Available tools: {[tool.name for tool in tools]}")
211
211
  return tools
212
212
 
213
213
  def _create_agent(self) -> AgentExecutor:
@@ -209,7 +209,7 @@ class MCPAgent:
209
209
  # If the agent is already initialized, we need to reinitialize it
210
210
  # to apply the changes to the available tools
211
211
  if self._initialized:
212
- logger.info(
212
+ logger.debug(
213
213
  "Agent already initialized. Changes will take effect on next initialization."
214
214
  )
215
215
  # We don't automatically reinitialize here as it could be disruptive
@@ -254,11 +254,11 @@ class MCPAgent:
254
254
  try:
255
255
  # Initialize if needed
256
256
  if manage_connector and (not self._initialized or not self._agent):
257
- logger.info("Initializing agent before running query")
257
+ logger.debug("Initializing agent before running query")
258
258
  await self.initialize()
259
259
  initialized_here = True
260
260
  elif not self._initialized and self.auto_initialize:
261
- logger.info("Auto-initializing agent before running query")
261
+ logger.debug("Auto-initializing agent before running query")
262
262
  await self.initialize()
263
263
  initialized_here = True
264
264
 
@@ -289,7 +289,7 @@ class MCPAgent:
289
289
  # Other message types can be handled here if needed
290
290
 
291
291
  # Run the query with the specified max_steps or default
292
- logger.info(f"Running query with max_steps={max_steps or self.max_steps}")
292
+ logger.debug(f"Running query with max_steps={max_steps or self.max_steps}")
293
293
  result = await self._agent.run(
294
294
  query=query,
295
295
  max_steps=max_steps,
@@ -307,7 +307,7 @@ class MCPAgent:
307
307
  # If we initialized in this method and there was an error,
308
308
  # make sure to clean up
309
309
  if initialized_here and manage_connector:
310
- logger.info("Cleaning up resources after initialization error")
310
+ logger.debug("Cleaning up resources after initialization error")
311
311
  await self.close()
312
312
  raise
313
313
 
@@ -315,7 +315,7 @@ class MCPAgent:
315
315
  # Clean up resources if we're managing the connector and
316
316
  # we're not using a client that manages sessions
317
317
  if manage_connector and not self.client and not initialized_here:
318
- logger.info("Closing agent after query completion")
318
+ logger.debug("Closing agent after query completion")
319
319
  await self.close()
320
320
 
321
321
  async def close(self) -> None:
@@ -338,7 +338,7 @@ class MCPAgent:
338
338
  await connector.disconnect()
339
339
 
340
340
  self._initialized = False
341
- logger.info("Agent closed successfully")
341
+ logger.debug("Agent closed successfully")
342
342
 
343
343
  except Exception as e:
344
344
  logger.error(f"Error during agent closure: {e}")
mcp_use/client.py CHANGED
@@ -214,7 +214,7 @@ class MCPClient:
214
214
 
215
215
  try:
216
216
  # Disconnect from the session
217
- logger.info(f"Closing session for server '{server_name}'")
217
+ logger.debug(f"Closing session for server '{server_name}'")
218
218
  await session.disconnect()
219
219
  except Exception as e:
220
220
  logger.error(f"Error closing session for server '{server_name}': {e}")
@@ -237,7 +237,7 @@ class MCPClient:
237
237
 
238
238
  for server_name in server_names:
239
239
  try:
240
- logger.info(f"Closing session for server '{server_name}'")
240
+ logger.debug(f"Closing session for server '{server_name}'")
241
241
  await self.close_session(server_name)
242
242
  except Exception as e:
243
243
  error_msg = f"Failed to close session for server '{server_name}': {e}"
@@ -248,4 +248,4 @@ class MCPClient:
248
248
  if errors:
249
249
  logger.error(f"Encountered {len(errors)} errors while closing sessions")
250
250
  else:
251
- logger.info("All sessions closed successfully")
251
+ logger.debug("All sessions closed successfully")
@@ -39,10 +39,10 @@ class BaseConnector(ABC):
39
39
  logger.debug("Not connected to MCP implementation")
40
40
  return
41
41
 
42
- logger.info("Disconnecting from MCP implementation")
42
+ logger.debug("Disconnecting from MCP implementation")
43
43
  await self._cleanup_resources()
44
44
  self._connected = False
45
- logger.info("Disconnected from MCP implementation")
45
+ logger.debug("Disconnected from MCP implementation")
46
46
 
47
47
  async def _cleanup_resources(self) -> None:
48
48
  """Clean up all resources associated with this connector."""
@@ -83,7 +83,7 @@ class BaseConnector(ABC):
83
83
  if not self.client:
84
84
  raise RuntimeError("MCP client is not connected")
85
85
 
86
- logger.info("Initializing MCP session")
86
+ logger.debug("Initializing MCP session")
87
87
 
88
88
  # Initialize the session
89
89
  result = await self.client.initialize()
@@ -92,7 +92,7 @@ class BaseConnector(ABC):
92
92
  tools_result = await self.client.list_tools()
93
93
  self._tools = tools_result.tools
94
94
 
95
- logger.info(f"MCP session initialized with {len(self._tools)} tools")
95
+ logger.debug(f"MCP session initialized with {len(self._tools)} tools")
96
96
 
97
97
  return result
98
98
 
@@ -110,6 +110,7 @@ class BaseConnector(ABC):
110
110
 
111
111
  logger.debug(f"Calling tool '{name}' with arguments: {arguments}")
112
112
  result = await self.client.call_tool(name, arguments)
113
+ logger.debug(f"Tool '{name}' called with result: {result}")
113
114
  return result
114
115
 
115
116
  async def list_resources(self) -> list[dict[str, Any]]:
@@ -51,7 +51,7 @@ class HttpConnector(BaseConnector):
51
51
  logger.debug("Already connected to MCP implementation")
52
52
  return
53
53
 
54
- logger.info(f"Connecting to MCP implementation via HTTP/SSE: {self.base_url}")
54
+ logger.debug(f"Connecting to MCP implementation via HTTP/SSE: {self.base_url}")
55
55
  try:
56
56
  # Create the SSE connection URL
57
57
  sse_url = f"{self.base_url}"
@@ -68,7 +68,7 @@ class HttpConnector(BaseConnector):
68
68
 
69
69
  # Mark as connected
70
70
  self._connected = True
71
- logger.info(
71
+ logger.debug(
72
72
  f"Successfully connected to MCP implementation via HTTP/SSE: {self.base_url}"
73
73
  )
74
74
 
@@ -49,7 +49,7 @@ class StdioConnector(BaseConnector):
49
49
  logger.debug("Already connected to MCP implementation")
50
50
  return
51
51
 
52
- logger.info(f"Connecting to MCP implementation: {self.command}")
52
+ logger.debug(f"Connecting to MCP implementation: {self.command}")
53
53
  try:
54
54
  # Create server parameters
55
55
  server_params = StdioServerParameters(
@@ -66,7 +66,7 @@ class StdioConnector(BaseConnector):
66
66
 
67
67
  # Mark as connected
68
68
  self._connected = True
69
- logger.info(f"Successfully connected to MCP implementation: {self.command}")
69
+ logger.debug(f"Successfully connected to MCP implementation: {self.command}")
70
70
 
71
71
  except Exception as e:
72
72
  logger.error(f"Failed to connect to MCP implementation: {e}")
@@ -57,7 +57,7 @@ class WebSocketConnector(BaseConnector):
57
57
  logger.debug("Already connected to MCP implementation")
58
58
  return
59
59
 
60
- logger.info(f"Connecting to MCP implementation via WebSocket: {self.url}")
60
+ logger.debug(f"Connecting to MCP implementation via WebSocket: {self.url}")
61
61
  try:
62
62
  # Create and start the connection manager
63
63
  self._connection_manager = WebSocketConnectionManager(self.url, self.headers)
@@ -70,7 +70,7 @@ class WebSocketConnector(BaseConnector):
70
70
 
71
71
  # Mark as connected
72
72
  self._connected = True
73
- logger.info(f"Successfully connected to MCP implementation via WebSocket: {self.url}")
73
+ logger.debug(f"Successfully connected to MCP implementation via WebSocket: {self.url}")
74
74
 
75
75
  except Exception as e:
76
76
  logger.error(f"Failed to connect to MCP implementation via WebSocket: {e}")
@@ -117,10 +117,10 @@ class WebSocketConnector(BaseConnector):
117
117
  logger.debug("Not connected to MCP implementation")
118
118
  return
119
119
 
120
- logger.info("Disconnecting from MCP implementation")
120
+ logger.debug("Disconnecting from MCP implementation")
121
121
  await self._cleanup_resources()
122
122
  self._connected = False
123
- logger.info("Disconnected from MCP implementation")
123
+ logger.debug("Disconnected from MCP implementation")
124
124
 
125
125
  async def _cleanup_resources(self) -> None:
126
126
  """Clean up all resources associated with this connector."""
@@ -199,14 +199,14 @@ class WebSocketConnector(BaseConnector):
199
199
 
200
200
  async def initialize(self) -> dict[str, Any]:
201
201
  """Initialize the MCP session and return session information."""
202
- logger.info("Initializing MCP session")
202
+ logger.debug("Initializing MCP session")
203
203
  result = await self._send_request("initialize")
204
204
 
205
205
  # Get available tools
206
206
  tools_result = await self.list_tools()
207
207
  self._tools = [Tool(**tool) for tool in tools_result]
208
208
 
209
- logger.info(f"MCP session initialized with {len(self._tools)} tools")
209
+ logger.debug(f"MCP session initialized with {len(self._tools)} tools")
210
210
  return result
211
211
 
212
212
  async def list_tools(self) -> list[dict[str, Any]]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-use
3
- Version: 1.1.4
3
+ Version: 1.1.5
4
4
  Summary: MCP Library for LLMs
5
5
  Author-email: Pietro Zullo <pietro.zullo@gmail.com>
6
6
  License: MIT
@@ -179,7 +179,6 @@ Example configuration file (`browser_mcp.json`):
179
179
 
180
180
  For other settings, models, and more, check out the documentation.
181
181
 
182
- # Features
183
182
 
184
183
  # Example Use Cases
185
184
 
@@ -1,24 +1,24 @@
1
1
  mcp_use/__init__.py,sha256=PSoxLAu1GPjfIDPcZiJyI3k66MMS3lcfx5kERUgFb1o,723
2
- mcp_use/client.py,sha256=0rvlJBwvPD19sjDRtXfnp15-F1VHJlXWxLQNt9cHwPA,8275
2
+ mcp_use/client.py,sha256=RoOOpCzMCjpqkkyAIEDOVc6Sn_HsET1rbn_J_J778q4,8278
3
3
  mcp_use/config.py,sha256=O9V4pa-shZ2mPokRTrd7KZQ2GpuTcYBGUslefl1fosw,1653
4
4
  mcp_use/logging.py,sha256=2-hSB7ZWcHEx_OFHNg8GIbSGCZx3MW4mZGGWxi2Ew3E,2690
5
5
  mcp_use/session.py,sha256=Z4EZTUnQUX0QyGMzkJIrMRTX4SDk6qQUoBld408LIJE,3449
6
6
  mcp_use/agents/__init__.py,sha256=ukchMTqCOID6ikvLmJ-6sldWTVFIzztGQo4BX6QeQr8,312
7
7
  mcp_use/agents/base.py,sha256=bfuldi_89AbSbNc8KeTiCArRT9V62CNxHOWYkLHWjyA,1605
8
- mcp_use/agents/langchain_agent.py,sha256=5fml081T3meLkZxA8o29eLuMmITyr5EfkKMPGy9UgHA,10165
9
- mcp_use/agents/mcpagent.py,sha256=YF-ApIGM2lM8mOdeopr-hPlMRuNRNMQpJpg4gm9u6Ns,14183
8
+ mcp_use/agents/langchain_agent.py,sha256=7gHTxZ5kIfHy0qRDMTGKiek0OOlU-7yLd8ruoJPzTyY,10168
9
+ mcp_use/agents/mcpagent.py,sha256=5n0FbLrx30dc1afH75UW2s_R0p3nSssE2BrXYNfbygo,14190
10
10
  mcp_use/agents/prompts/default.py,sha256=tnwt9vOiVBhdpu-lIHhwEJo3rvE6EobPfUgS9JURBzg,941
11
11
  mcp_use/connectors/__init__.py,sha256=jnd-7pPPJMb0UNJ6aD9lInj5Tlamc8lA_mFyG8RWJpo,385
12
- mcp_use/connectors/base.py,sha256=TCLVNJdt6qrflmphgXOZhD6xPKQQegbGqe5REmcLYg0,4813
13
- mcp_use/connectors/http.py,sha256=nkF3hcioYpglwLOTR69WhU8zzLJbZDakgtQ8MsK-cMI,2835
14
- mcp_use/connectors/stdio.py,sha256=36yEY7hbFXgM7zju5BtLJl4cKAZNCXVRrTaU6YOttBI,2606
15
- mcp_use/connectors/websocket.py,sha256=4xqxl9UncrfU6NitvKfB80Hk2g7o0Gc0G5sm6sY3RAk,9534
12
+ mcp_use/connectors/base.py,sha256=5TcXB-I5zrwPtedB6dShceNucsK3wHBeGC2yDVq8X48,4885
13
+ mcp_use/connectors/http.py,sha256=2ZG5JxcK1WZ4jkTfTir6bEQLMxXBTPHyi0s42RHGeFs,2837
14
+ mcp_use/connectors/stdio.py,sha256=MTzsqmVVihACUKngE-g5BignK3jAFds2CFv3aSzbJfs,2608
15
+ mcp_use/connectors/websocket.py,sha256=LeU53YI3zjbwKq5GzFRziqA_z9Dn5qACiNyxWDrn2ns,9540
16
16
  mcp_use/task_managers/__init__.py,sha256=4dgW5N61iiPLpwjU2rrn_uqrL8mmDJFDaF9Lukzk65A,486
17
17
  mcp_use/task_managers/base.py,sha256=ksNdxTwq8N-zqymxVoKGnWXq9iqkLYC61uB91o6Mh-4,4888
18
18
  mcp_use/task_managers/sse.py,sha256=WysmjwqRI3meXMZY_F4y9tSBMvSiUZfTJQfitM5l6jQ,2529
19
19
  mcp_use/task_managers/stdio.py,sha256=DEISpXv4mo3d5a-WT8lkWbrXJwUh7QW0nMT_IM3fHGg,2269
20
20
  mcp_use/task_managers/websocket.py,sha256=ZbCqdGgzCRtsXzRGFws-f2OzH8cPAkN4sJNDwEpRmCc,1915
21
- mcp_use-1.1.4.dist-info/METADATA,sha256=vE5PNvtxt7MIOI5EL1DRA73xzNoGjEe2Xa7WfBdV9rU,14015
22
- mcp_use-1.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
- mcp_use-1.1.4.dist-info/licenses/LICENSE,sha256=7Pw7dbwJSBw8zH-WE03JnR5uXvitRtaGTP9QWPcexcs,1068
24
- mcp_use-1.1.4.dist-info/RECORD,,
21
+ mcp_use-1.1.5.dist-info/METADATA,sha256=A-VlMFyFTy0oSs8RpWCEd7cfuo6ObqQrc4O4QdRf67Q,14004
22
+ mcp_use-1.1.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
+ mcp_use-1.1.5.dist-info/licenses/LICENSE,sha256=7Pw7dbwJSBw8zH-WE03JnR5uXvitRtaGTP9QWPcexcs,1068
24
+ mcp_use-1.1.5.dist-info/RECORD,,