mcp-use 1.2.9__tar.gz → 1.2.11__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.

Potentially problematic release.


This version of mcp-use might be problematic. Click here for more details.

Files changed (83) hide show
  1. {mcp_use-1.2.9 → mcp_use-1.2.11}/PKG-INFO +1 -1
  2. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/agents/mcpagent.py +3 -2
  3. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/client.py +4 -2
  4. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/search_tools.py +12 -2
  5. {mcp_use-1.2.9 → mcp_use-1.2.11}/pyproject.toml +1 -1
  6. {mcp_use-1.2.9 → mcp_use-1.2.11}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  7. {mcp_use-1.2.9 → mcp_use-1.2.11}/.github/pull_request_template.md +0 -0
  8. {mcp_use-1.2.9 → mcp_use-1.2.11}/.github/workflows/publish.yml +0 -0
  9. {mcp_use-1.2.9 → mcp_use-1.2.11}/.github/workflows/tests.yml +0 -0
  10. {mcp_use-1.2.9 → mcp_use-1.2.11}/.gitignore +0 -0
  11. {mcp_use-1.2.9 → mcp_use-1.2.11}/.pre-commit-config.yaml +0 -0
  12. {mcp_use-1.2.9 → mcp_use-1.2.11}/CONTRIBUTING.md +0 -0
  13. {mcp_use-1.2.9 → mcp_use-1.2.11}/LICENSE +0 -0
  14. {mcp_use-1.2.9 → mcp_use-1.2.11}/README.md +0 -0
  15. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/README.md +0 -0
  16. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/api-reference/introduction.mdx +0 -0
  17. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/api-reference/mcpagent.mdx +0 -0
  18. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/building-custom-agents.mdx +0 -0
  19. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/development.mdx +0 -0
  20. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/docs.json +0 -0
  21. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/essentials/configuration.mdx +0 -0
  22. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/essentials/connection-types.mdx +0 -0
  23. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/essentials/debugging.mdx +0 -0
  24. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/essentials/llm-integration.mdx +0 -0
  25. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/essentials/server-manager.mdx +0 -0
  26. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/favicon.svg +0 -0
  27. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/images/hero-dark.png +0 -0
  28. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/images/hero-light.png +0 -0
  29. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/introduction.mdx +0 -0
  30. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/logo/dark.svg +0 -0
  31. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/logo/light.svg +0 -0
  32. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/quickstart.mdx +0 -0
  33. {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/snippets/snippet-intro.mdx +0 -0
  34. {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/airbnb_mcp.json +0 -0
  35. {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/airbnb_use.py +0 -0
  36. {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/blender_use.py +0 -0
  37. {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/browser_mcp.json +0 -0
  38. {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/browser_use.py +0 -0
  39. {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/chat_example.py +0 -0
  40. {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/filesystem_use.py +0 -0
  41. {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/http_example.py +0 -0
  42. {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/mcp_everything.py +0 -0
  43. {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/multi_server_example.py +0 -0
  44. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/__init__.py +0 -0
  45. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/adapters/__init__.py +0 -0
  46. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/adapters/base.py +0 -0
  47. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/adapters/langchain_adapter.py +0 -0
  48. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/agents/__init__.py +0 -0
  49. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/agents/base.py +0 -0
  50. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/agents/prompts/system_prompt_builder.py +0 -0
  51. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/agents/prompts/templates.py +0 -0
  52. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/config.py +0 -0
  53. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/connectors/__init__.py +0 -0
  54. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/connectors/base.py +0 -0
  55. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/connectors/http.py +0 -0
  56. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/connectors/stdio.py +0 -0
  57. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/connectors/websocket.py +0 -0
  58. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/logging.py +0 -0
  59. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/__init__.py +0 -0
  60. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/server_manager.py +0 -0
  61. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/__init__.py +0 -0
  62. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/base_tool.py +0 -0
  63. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/connect_server.py +0 -0
  64. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/disconnect_server.py +0 -0
  65. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/get_active_server.py +0 -0
  66. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/list_servers_tool.py +0 -0
  67. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/use_tool.py +0 -0
  68. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/session.py +0 -0
  69. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/task_managers/__init__.py +0 -0
  70. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/task_managers/base.py +0 -0
  71. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/task_managers/sse.py +0 -0
  72. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/task_managers/stdio.py +0 -0
  73. {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/task_managers/websocket.py +0 -0
  74. {mcp_use-1.2.9 → mcp_use-1.2.11}/pytest.ini +0 -0
  75. {mcp_use-1.2.9 → mcp_use-1.2.11}/ruff.toml +0 -0
  76. {mcp_use-1.2.9 → mcp_use-1.2.11}/static/image.jpg +0 -0
  77. {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/conftest.py +0 -0
  78. {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/unit/test_client.py +0 -0
  79. {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/unit/test_config.py +0 -0
  80. {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/unit/test_http_connector.py +0 -0
  81. {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/unit/test_logging.py +0 -0
  82. {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/unit/test_session.py +0 -0
  83. {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/unit/test_stdio_connector.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-use
3
- Version: 1.2.9
3
+ Version: 1.2.11
4
4
  Summary: MCP Library for LLMs
5
5
  Author-email: Pietro Zullo <pietro.zullo@gmail.com>
6
6
  License: MIT
@@ -15,6 +15,7 @@ from langchain.schema import AIMessage, BaseMessage, HumanMessage, SystemMessage
15
15
  from langchain.schema.language_model import BaseLanguageModel
16
16
  from langchain_core.agents import AgentAction, AgentFinish
17
17
  from langchain_core.exceptions import OutputParserException
18
+ from langchain_core.runnables.schema import StreamEvent
18
19
  from langchain_core.tools import BaseTool
19
20
  from langchain_core.utils.input import get_color_mapping
20
21
 
@@ -311,7 +312,7 @@ class MCPAgent:
311
312
  max_steps: int | None = None,
312
313
  manage_connector: bool = True,
313
314
  external_history: list[BaseMessage] | None = None,
314
- ) -> AsyncIterator[str]:
315
+ ) -> AsyncIterator[StreamEvent]:
315
316
  """Internal async generator yielding response chunks.
316
317
 
317
318
  The implementation purposefully keeps the logic compact:
@@ -352,7 +353,7 @@ class MCPAgent:
352
353
 
353
354
  # 3. Stream & diff -------------------------------------------------------
354
355
  accumulated = ""
355
- async for event in self._agent_executor.astream(inputs):
356
+ async for event in self._agent_executor.astream_events(inputs):
356
357
  yield event
357
358
 
358
359
  # 4. Persist assistant message ------------------------------------------
@@ -120,7 +120,8 @@ class MCPClient:
120
120
  # Get server config
121
121
  servers = self.config.get("mcpServers", {})
122
122
  if not servers:
123
- raise ValueError("No MCP servers defined in config")
123
+ logger.warning("No MCP servers defined in config")
124
+ return None
124
125
 
125
126
  if server_name not in servers:
126
127
  raise ValueError(f"Server '{server_name}' not found in config")
@@ -158,7 +159,8 @@ class MCPClient:
158
159
  # Get server config
159
160
  servers = self.config.get("mcpServers", {})
160
161
  if not servers:
161
- raise ValueError("No MCP servers defined in config")
162
+ logger.warning("No MCP servers defined in config")
163
+ return {}
162
164
 
163
165
  # Create sessions for all servers
164
166
  for name in servers:
@@ -3,7 +3,6 @@ import time
3
3
  from typing import ClassVar
4
4
 
5
5
  import numpy as np
6
- from fastembed import TextEmbedding
7
6
  from langchain_core.tools import BaseTool
8
7
  from pydantic import BaseModel, Field
9
8
 
@@ -114,11 +113,22 @@ class ToolSearchEngine:
114
113
  if self.model is not None:
115
114
  return True
116
115
 
116
+ try:
117
+ from fastembed import TextEmbedding # optional dependency install with [search]
118
+ except ImportError:
119
+ logger.error(
120
+ "The 'fastembed' library is not installed. "
121
+ "To use the search functionality, please install it by running: "
122
+ "pip install mcp-use[search]"
123
+ )
124
+ return False
125
+
117
126
  try:
118
127
  self.model = TextEmbedding(model_name="BAAI/bge-small-en-v1.5")
119
128
  self.embedding_function = lambda texts: list(self.model.embed(texts))
120
129
  return True
121
- except Exception:
130
+ except Exception as e:
131
+ logger.error(f"Failed to load the embedding model: {e}")
122
132
  return False
123
133
 
124
134
  async def start_indexing(self) -> None:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mcp-use"
3
- version = "1.2.9"
3
+ version = "1.2.11"
4
4
  description = "MCP Library for LLMs"
5
5
  authors = [
6
6
  {name = "Pietro Zullo", email = "pietro.zullo@gmail.com"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes