mcp-use 1.2.10__tar.gz → 1.2.12__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.10 → mcp_use-1.2.12}/.github/workflows/publish.yml +8 -4
- {mcp_use-1.2.10 → mcp_use-1.2.12}/PKG-INFO +1 -1
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/agents/mcpagent.py +3 -2
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/client.py +8 -5
- {mcp_use-1.2.10 → mcp_use-1.2.12}/pyproject.toml +1 -1
- {mcp_use-1.2.10 → mcp_use-1.2.12}/tests/unit/test_client.py +3 -3
- {mcp_use-1.2.10 → mcp_use-1.2.12}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/.github/pull_request_template.md +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/.github/workflows/tests.yml +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/.gitignore +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/.pre-commit-config.yaml +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/CONTRIBUTING.md +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/LICENSE +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/README.md +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/README.md +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/api-reference/introduction.mdx +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/api-reference/mcpagent.mdx +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/building-custom-agents.mdx +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/development.mdx +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/docs.json +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/essentials/configuration.mdx +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/essentials/connection-types.mdx +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/essentials/debugging.mdx +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/essentials/llm-integration.mdx +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/essentials/server-manager.mdx +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/favicon.svg +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/images/hero-dark.png +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/images/hero-light.png +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/introduction.mdx +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/logo/dark.svg +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/logo/light.svg +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/quickstart.mdx +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/docs/snippets/snippet-intro.mdx +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/examples/airbnb_mcp.json +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/examples/airbnb_use.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/examples/blender_use.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/examples/browser_mcp.json +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/examples/browser_use.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/examples/chat_example.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/examples/filesystem_use.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/examples/http_example.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/examples/mcp_everything.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/examples/multi_server_example.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/__init__.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/adapters/__init__.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/adapters/base.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/adapters/langchain_adapter.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/agents/__init__.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/agents/base.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/agents/prompts/system_prompt_builder.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/agents/prompts/templates.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/config.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/connectors/__init__.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/connectors/base.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/connectors/http.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/connectors/stdio.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/connectors/websocket.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/logging.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/managers/__init__.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/managers/server_manager.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/managers/tools/__init__.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/managers/tools/base_tool.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/managers/tools/connect_server.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/managers/tools/disconnect_server.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/managers/tools/get_active_server.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/managers/tools/list_servers_tool.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/managers/tools/search_tools.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/managers/tools/use_tool.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/session.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/task_managers/__init__.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/task_managers/base.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/task_managers/sse.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/task_managers/stdio.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/mcp_use/task_managers/websocket.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/pytest.ini +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/ruff.toml +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/static/image.jpg +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/tests/conftest.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/tests/unit/test_config.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/tests/unit/test_http_connector.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/tests/unit/test_logging.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/tests/unit/test_session.py +0 -0
- {mcp_use-1.2.10 → mcp_use-1.2.12}/tests/unit/test_stdio_connector.py +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
name: Check Version Bump and Publish to PyPI
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: ["Python Tests"]
|
|
5
6
|
branches:
|
|
6
7
|
- main
|
|
7
|
-
|
|
8
|
-
-
|
|
8
|
+
types:
|
|
9
|
+
- completed
|
|
9
10
|
|
|
10
11
|
# Required for PyPI trusted publishing
|
|
11
12
|
permissions:
|
|
@@ -14,11 +15,14 @@ permissions:
|
|
|
14
15
|
|
|
15
16
|
jobs:
|
|
16
17
|
check-version-and-publish:
|
|
18
|
+
# Only proceed if the referenced workflow completed successfully
|
|
19
|
+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
17
20
|
runs-on: ubuntu-latest
|
|
18
21
|
steps:
|
|
19
22
|
- uses: actions/checkout@v3
|
|
20
23
|
with:
|
|
21
|
-
fetch-depth: 0
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
ref: ${{ github.event.workflow_run.head_sha }}
|
|
22
26
|
|
|
23
27
|
- name: Set up Python
|
|
24
28
|
uses: actions/setup-python@v4
|
|
@@ -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 ------------------------------------------
|
|
@@ -6,6 +6,7 @@ and sessions from configuration.
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
import json
|
|
9
|
+
import warnings
|
|
9
10
|
from typing import Any
|
|
10
11
|
|
|
11
12
|
from .config import create_connector_from_config, load_config_file
|
|
@@ -115,12 +116,13 @@ class MCPClient:
|
|
|
115
116
|
The created MCPSession.
|
|
116
117
|
|
|
117
118
|
Raises:
|
|
118
|
-
ValueError: If
|
|
119
|
+
ValueError: If the specified server doesn't exist.
|
|
119
120
|
"""
|
|
120
121
|
# Get server config
|
|
121
122
|
servers = self.config.get("mcpServers", {})
|
|
122
123
|
if not servers:
|
|
123
|
-
|
|
124
|
+
warnings.warn("No MCP servers defined in config", UserWarning, stacklevel=2)
|
|
125
|
+
return None
|
|
124
126
|
|
|
125
127
|
if server_name not in servers:
|
|
126
128
|
raise ValueError(f"Server '{server_name}' not found in config")
|
|
@@ -152,13 +154,14 @@ class MCPClient:
|
|
|
152
154
|
Returns:
|
|
153
155
|
The created MCPSession. If server_name is None, returns the first created session.
|
|
154
156
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
+
Warns:
|
|
158
|
+
Warning: If no servers are configured.
|
|
157
159
|
"""
|
|
158
160
|
# Get server config
|
|
159
161
|
servers = self.config.get("mcpServers", {})
|
|
160
162
|
if not servers:
|
|
161
|
-
|
|
163
|
+
warnings.warn("No MCP servers defined in config", UserWarning, stacklevel=2)
|
|
164
|
+
return {}
|
|
162
165
|
|
|
163
166
|
# Create sessions for all servers
|
|
164
167
|
for name in servers:
|
|
@@ -231,11 +231,11 @@ class TestMCPClientSessionManagement:
|
|
|
231
231
|
"""Test creating a session when no servers are configured."""
|
|
232
232
|
client = MCPClient()
|
|
233
233
|
|
|
234
|
-
#
|
|
235
|
-
with pytest.
|
|
234
|
+
# Expect a UserWarning when no servers are configured
|
|
235
|
+
with pytest.warns(UserWarning) as exc_info:
|
|
236
236
|
await client.create_session("server1")
|
|
237
237
|
|
|
238
|
-
assert "No MCP servers defined in config" in str(exc_info.
|
|
238
|
+
assert "No MCP servers defined in config" in str(exc_info[0].message)
|
|
239
239
|
|
|
240
240
|
@pytest.mark.asyncio
|
|
241
241
|
async def test_create_session_nonexistent_server(self):
|
|
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
|