mcp-use 0.0.5__py3-none-any.whl → 0.0.6__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/__init__.py CHANGED
@@ -9,7 +9,7 @@ from importlib.metadata import version
9
9
 
10
10
  from .agents.mcpagent import MCPAgent
11
11
  from .client import MCPClient
12
- from .config import create_session_from_config, load_config_file
12
+ from .config import load_config_file
13
13
  from .connectors import BaseConnector, HttpConnector, StdioConnector, WebSocketConnector
14
14
  from .logging import logger
15
15
  from .session import MCPSession
@@ -3,9 +3,20 @@ DEFAULT_SYSTEM_PROMPT_TEMPLATE = """You are an assistant with access to these to
3
3
  {tool_descriptions}
4
4
 
5
5
  Proactively use these tools to:
6
- - Find real-time information (weather, news, prices)
7
- - Perform web searches and extract relevant data
8
- - Execute multi-step tasks by combining tools
6
+ - Retrieve and analyze information relevant to user requests
7
+ - Process and transform data in various formats
8
+ - Perform computations and generate insights
9
+ - Execute multi-step workflows by combining tools as needed
10
+ - Interact with external systems when authorized
9
11
 
10
- You CAN access current information using your tools. Never claim you lack access to real-time data.
12
+ When appropriate, use available tools rather than relying on your built-in knowledge alone.
13
+ Your tools enable you to perform tasks that would otherwise be beyond your capabilities.
14
+
15
+ For optimal assistance:
16
+ 1. Identify when a tool can help address the user's request
17
+ 2. Select the most appropriate tool(s) for the task
18
+ 3. Apply tools in the correct sequence when multiple tools are needed
19
+ 4. Clearly communicate your process and findings
20
+
21
+ Remember that you have real capabilities through your tools - use them confidently when needed.
11
22
  """
mcp_use/config.py CHANGED
@@ -8,7 +8,6 @@ import json
8
8
  from typing import Any
9
9
 
10
10
  from .connectors import BaseConnector, HttpConnector, StdioConnector, WebSocketConnector
11
- from .session import MCPSession
12
11
 
13
12
 
14
13
  def load_config_file(filepath: str) -> dict[str, Any]:
@@ -58,36 +57,3 @@ def create_connector_from_config(server_config: dict[str, Any]) -> BaseConnector
58
57
  )
59
58
 
60
59
  raise ValueError("Cannot determine connector type from config")
61
-
62
-
63
- def create_session_from_config(
64
- filepath: str,
65
- server_name: str | None = None,
66
- ) -> MCPSession:
67
- """Create an MCPSession from a configuration file.
68
-
69
- Args:
70
- filepath: Path to the configuration file
71
- server_name: Name of the server to use from config, uses first if None
72
-
73
- Returns:
74
- Configured MCPSession instance
75
- """
76
- config = load_config_file(filepath)
77
-
78
- # Get server config
79
- servers = config.get("mcpServers", {})
80
- if not servers:
81
- raise ValueError("No MCP servers defined in config")
82
-
83
- # If server_name not specified, use the first one
84
- if not server_name:
85
- server_name = next(iter(servers.keys()))
86
-
87
- if server_name not in servers:
88
- raise ValueError(f"Server '{server_name}' not found in config")
89
-
90
- server_config = servers[server_name]
91
- connector = create_connector_from_config(server_config)
92
-
93
- return MCPSession(connector)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-use
3
- Version: 0.0.5
3
+ Version: 0.0.6
4
4
  Summary: MCP Library for LLMs
5
5
  Author-email: Pietro Zullo <pietro.zullo@gmail.com>
6
6
  License: MIT
@@ -38,7 +38,7 @@ Requires-Dist: openai>=1.10.0; extra == 'openai'
38
38
  Description-Content-Type: text/markdown
39
39
 
40
40
  <picture>
41
- <img alt="" src="./static/ghibli.png" width="full">
41
+ <img alt="" src="./static/mcpusegrass.png" width="full">
42
42
  </picture>
43
43
 
44
44
  <h1 align="center">Open Source MCP CLient Library </h1>
@@ -285,51 +285,12 @@ if __name__ == "__main__":
285
285
  asyncio.run(main())
286
286
  ```
287
287
 
288
- # MCPClient for Managing Multiple Servers
289
-
290
- The `MCPClient` class provides a higher-level abstraction for managing multiple MCP servers from a single client:
291
-
292
- ```python
293
- import asyncio
294
- from langchain_anthropic import ChatAnthropic
295
- from mcp_use import MCPAgent, MCPClient
296
-
297
- async def main():
298
- # Create a client from a config file
299
- client = MCPClient.from_config_file("mcp-config.json")
300
-
301
- # Or initialize with a config file path
302
- # client = MCPClient("mcp-config.json")
303
-
304
- # Or programmatically add servers
305
- client.add_server(
306
- "local-ws",
307
- {
308
- "command": "npx",
309
- "args": ["@playwright/mcp@latest", "headless"]
310
- }
311
- )
312
-
313
- # Create an LLM
314
- llm = ChatAnthropic(model="claude-3-5-sonnet-20240620")
315
-
316
- # Create an agent using the client
317
- agent = MCPAgent(
318
- llm=llm,
319
- client=client,
320
- server_name="playwright", # Optional, uses first server if not specified
321
- max_steps=30
322
- )
323
-
324
- # Run a query
325
- result = await agent.run("Your query here")
326
-
327
- # Close all sessions
328
- await client.close_all_sessions()
329
-
330
- if __name__ == "__main__":
331
- asyncio.run(main())
332
- ```
288
+ ## Roadmap
289
+ <ul>
290
+ <li>[ ] Multiple Servers at once </li>
291
+ <li>[ ] Test remote connectors (http, ws)</li>
292
+ <li>[ ] ... </li>
293
+ </ul>
333
294
 
334
295
  ## Contributing
335
296
 
@@ -346,10 +307,10 @@ We love contributions! Feel free to open issues for bugs or feature requests.
346
307
  If you use MCP-Use in your research or project, please cite:
347
308
 
348
309
  ```bibtex
349
- @software{mcp_use2024,
310
+ @software{mcp_use2025,
350
311
  author = {Zullo, Pietro},
351
312
  title = {MCP-Use: MCP Library for Python},
352
- year = {2024},
313
+ year = {2025},
353
314
  publisher = {GitHub},
354
315
  url = {https://github.com/pietrozullo/mcp-use}
355
316
  }
@@ -1,13 +1,13 @@
1
- mcp_use/__init__.py,sha256=fa-pzSVKzlR2W3UQ2C7DbbrSSLjPPc6DbkUBTUpI39s,751
1
+ mcp_use/__init__.py,sha256=PSoxLAu1GPjfIDPcZiJyI3k66MMS3lcfx5kERUgFb1o,723
2
2
  mcp_use/client.py,sha256=7dBjkRPqyUlp-8NuLcYbW-4ctLDp329DsAvRM1HlVus,7807
3
- mcp_use/config.py,sha256=ZoOdKX6qVR5SD7PfO-iqzKxXOb4NMcnpHpZquGgMas4,2578
3
+ mcp_use/config.py,sha256=D9LuCuT1mFUSBiO2DUGa5Pnd-yjNcvM9u_v11N5UmK8,1624
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
8
  mcp_use/agents/langchain_agent.py,sha256=RaQEo-tm3b4SBeu3DxE9YYdTuTAHBqEd5vSZ6Qi3g5Q,10320
9
9
  mcp_use/agents/mcpagent.py,sha256=0iDbqmzKtj0k1Ge8bsddiwgNEN-YAUdpLItB7ldLYrE,12444
10
- mcp_use/agents/prompts/default.py,sha256=msFRqH5ZPlcpVh5lzT9Bq5gu5m9wH819KO-xYiFs01g,392
10
+ mcp_use/agents/prompts/default.py,sha256=tnwt9vOiVBhdpu-lIHhwEJo3rvE6EobPfUgS9JURBzg,941
11
11
  mcp_use/connectors/__init__.py,sha256=jnd-7pPPJMb0UNJ6aD9lInj5Tlamc8lA_mFyG8RWJpo,385
12
12
  mcp_use/connectors/base.py,sha256=caUaTfsODUOik8JF9mPtcZDyZhoIz2X12I_BhAfZK10,1616
13
13
  mcp_use/connectors/http.py,sha256=KqVf0HXouFoeQ_bBUr6KQifiUjTo7K6EOCRkqVpFx4Q,7763
@@ -18,7 +18,7 @@ mcp_use/task_managers/base.py,sha256=ksNdxTwq8N-zqymxVoKGnWXq9iqkLYC61uB91o6Mh-4
18
18
  mcp_use/task_managers/http.py,sha256=XhrF73RGRnVctBVW2FlFrFTJR2pIGXhtNvfJFiW0Olw,1881
19
19
  mcp_use/task_managers/stdio.py,sha256=DEISpXv4mo3d5a-WT8lkWbrXJwUh7QW0nMT_IM3fHGg,2269
20
20
  mcp_use/task_managers/websocket.py,sha256=SVgTLFogiynb48eyi6ZioWIKLLWiVBCNE59rXi6GrCM,1943
21
- mcp_use-0.0.5.dist-info/METADATA,sha256=HmKqoj40OTDnhtswXP5-uNd0dayj1P_aAuzGbXrDyJE,9550
22
- mcp_use-0.0.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
- mcp_use-0.0.5.dist-info/licenses/LICENSE,sha256=7Pw7dbwJSBw8zH-WE03JnR5uXvitRtaGTP9QWPcexcs,1068
24
- mcp_use-0.0.5.dist-info/RECORD,,
21
+ mcp_use-0.0.6.dist-info/METADATA,sha256=o4EFi3L21-zAhNssvaRK0y1HFz95FOJYKAHzqXanhIw,8528
22
+ mcp_use-0.0.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
+ mcp_use-0.0.6.dist-info/licenses/LICENSE,sha256=7Pw7dbwJSBw8zH-WE03JnR5uXvitRtaGTP9QWPcexcs,1068
24
+ mcp_use-0.0.6.dist-info/RECORD,,