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.
- {mcp_use-1.2.9 → mcp_use-1.2.11}/PKG-INFO +1 -1
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/agents/mcpagent.py +3 -2
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/client.py +4 -2
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/search_tools.py +12 -2
- {mcp_use-1.2.9 → mcp_use-1.2.11}/pyproject.toml +1 -1
- {mcp_use-1.2.9 → mcp_use-1.2.11}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/.github/pull_request_template.md +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/.github/workflows/publish.yml +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/.github/workflows/tests.yml +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/.gitignore +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/.pre-commit-config.yaml +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/CONTRIBUTING.md +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/LICENSE +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/README.md +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/README.md +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/api-reference/introduction.mdx +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/api-reference/mcpagent.mdx +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/building-custom-agents.mdx +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/development.mdx +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/docs.json +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/essentials/configuration.mdx +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/essentials/connection-types.mdx +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/essentials/debugging.mdx +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/essentials/llm-integration.mdx +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/essentials/server-manager.mdx +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/favicon.svg +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/images/hero-dark.png +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/images/hero-light.png +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/introduction.mdx +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/logo/dark.svg +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/logo/light.svg +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/quickstart.mdx +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/docs/snippets/snippet-intro.mdx +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/airbnb_mcp.json +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/airbnb_use.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/blender_use.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/browser_mcp.json +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/browser_use.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/chat_example.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/filesystem_use.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/http_example.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/mcp_everything.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/examples/multi_server_example.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/__init__.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/adapters/__init__.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/adapters/base.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/adapters/langchain_adapter.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/agents/__init__.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/agents/base.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/agents/prompts/system_prompt_builder.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/agents/prompts/templates.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/config.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/connectors/__init__.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/connectors/base.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/connectors/http.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/connectors/stdio.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/connectors/websocket.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/logging.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/__init__.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/server_manager.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/__init__.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/base_tool.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/connect_server.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/disconnect_server.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/get_active_server.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/list_servers_tool.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/managers/tools/use_tool.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/session.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/task_managers/__init__.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/task_managers/base.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/task_managers/sse.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/task_managers/stdio.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/mcp_use/task_managers/websocket.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/pytest.ini +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/ruff.toml +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/static/image.jpg +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/conftest.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/unit/test_client.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/unit/test_config.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/unit/test_http_connector.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/unit/test_logging.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/unit/test_session.py +0 -0
- {mcp_use-1.2.9 → mcp_use-1.2.11}/tests/unit/test_stdio_connector.py +0 -0
|
@@ -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[
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
|
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
|
|
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
|
|
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
|