mcp-use 1.3.7__tar.gz → 1.3.8__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.3.7 → mcp_use-1.3.8}/.github/workflows/tests.yml +22 -2
- {mcp_use-1.3.7 → mcp_use-1.3.8}/.github/workflows/update-readme.yml +3 -1
- {mcp_use-1.3.7 → mcp_use-1.3.8}/PKG-INFO +23 -24
- {mcp_use-1.3.7 → mcp_use-1.3.8}/README.md +21 -22
- {mcp_use-1.3.7/docs/guides → mcp_use-1.3.8/docs/advanced}/multi-server-setup.mdx +2 -2
- {mcp_use-1.3.7/docs/guides → mcp_use-1.3.8/docs/advanced}/security.mdx +1 -1
- {mcp_use-1.3.7/docs/essentials → mcp_use-1.3.8/docs/agent}/agent-configuration.mdx +1 -1
- mcp_use-1.3.8/docs/agent/server-manager.mdx +215 -0
- {mcp_use-1.3.7/docs/guides → mcp_use-1.3.8/docs/agent}/streaming.mdx +2 -2
- mcp_use-1.3.8/docs/agent/structured-output.mdx +61 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/api-reference/mcpclient.mdx +2 -2
- {mcp_use-1.3.7/docs/essentials → mcp_use-1.3.8/docs/client}/client-configuration.mdx +1 -1
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/community/showcase.mdx +2 -2
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/docs.json +17 -16
- {mcp_use-1.3.7/docs/essentials → mcp_use-1.3.8/docs/getting-started}/configuration.mdx +7 -7
- {mcp_use-1.3.7/docs → mcp_use-1.3.8/docs/getting-started}/index.mdx +14 -14
- {mcp_use-1.3.7/docs → mcp_use-1.3.8/docs/getting-started}/installation.mdx +3 -3
- {mcp_use-1.3.7/docs → mcp_use-1.3.8/docs/getting-started}/quickstart.mdx +3 -3
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/troubleshooting/performance.mdx +2 -2
- {mcp_use-1.3.7 → mcp_use-1.3.8}/examples/airbnb_use.py +10 -15
- {mcp_use-1.3.7 → mcp_use-1.3.8}/examples/stream_example.py +5 -2
- mcp_use-1.3.8/examples/structured_output.py +78 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/agents/__init__.py +2 -2
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/agents/mcpagent.py +257 -31
- mcp_use-1.3.8/mcp_use/agents/prompts/templates.py +41 -0
- mcp_use-1.3.8/mcp_use/agents/remote.py +239 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/client.py +5 -2
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/config.py +2 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/managers/__init__.py +3 -5
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/managers/server_manager.py +45 -6
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/managers/tools/__init__.py +2 -4
- {mcp_use-1.3.7 → mcp_use-1.3.8}/pyproject.toml +2 -2
- {mcp_use-1.3.7/tests/integration/transports/customStreaming → mcp_use-1.3.8/tests/integration/others}/test_custom_streaming_integration.py +1 -1
- mcp_use-1.3.7/tests/integration/transports/sse/test_sse_integration.py → mcp_use-1.3.8/tests/integration/transports/test_sse.py +1 -1
- mcp_use-1.3.7/tests/integration/transports/stdio/test_stdio_integration.py → mcp_use-1.3.8/tests/integration/transports/test_stdio.py +1 -1
- mcp_use-1.3.7/tests/integration/transports/streamableHttp/test_streamable_http_integration.py → mcp_use-1.3.8/tests/integration/transports/test_streamable_http.py +1 -1
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/unit/test_client.py +52 -0
- mcp_use-1.3.7/docs/essentials/server-manager.mdx +0 -343
- mcp_use-1.3.7/mcp_use/agents/prompts/templates.py +0 -43
- mcp_use-1.3.7/mcp_use/managers/tools/use_tool.py +0 -154
- mcp_use-1.3.7/tests/integration/transports/customStreaming/__init__.py +0 -1
- {mcp_use-1.3.7 → mcp_use-1.3.8}/.env.example +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/.github/pull_request_template.md +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/.github/release-drafter.yml +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/.github/workflows/changelog.yml +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/.github/workflows/publish.yml +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/.github/workflows/release-drafter.yml +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/.github/workflows/stale.yml +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/.gitignore +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/.pre-commit-config.yaml +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/CHANGELOG.md +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/CLAUDE.md +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/CODE_OF_CONDUCT.md +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/CONTRIBUTING.md +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/LICENSE +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/README.md +0 -0
- {mcp_use-1.3.7/docs/guides → mcp_use-1.3.8/docs/advanced}/building-custom-agents.mdx +0 -0
- {mcp_use-1.3.7/docs/guides → mcp_use-1.3.8/docs/advanced}/logging.mdx +0 -0
- {mcp_use-1.3.7/docs/essentials → mcp_use-1.3.8/docs/agent}/llm-integration.mdx +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/api-reference/adapters.mdx +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/api-reference/introduction.mdx +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/api-reference/mcpagent.mdx +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/changelog.mdx +0 -0
- {mcp_use-1.3.7/docs/essentials → mcp_use-1.3.8/docs/client}/connection-types.mdx +0 -0
- {mcp_use-1.3.7/docs/essentials → mcp_use-1.3.8/docs/client}/elicitation.mdx +0 -0
- {mcp_use-1.3.7/docs/essentials → mcp_use-1.3.8/docs/client}/sampling.mdx +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/development/observability.mdx +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/development/telemetry.mdx +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/development.mdx +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/favicon.svg +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/fonts.css +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/images/01.png +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/images/02.png +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/images/configuration-dark.png +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/images/configuration-light.png +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/images/examples-dark.png +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/images/examples-light.png +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/images/hero-dark.png +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/images/hero-light.png +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/images/installation-dark.png +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/images/installation-light.png +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/images/quickstart-dark.png +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/images/quickstart-light.png +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/logo/dark.svg +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/logo/light.svg +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/logo/react.svg +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/snippets/snippet-intro.mdx +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/snippets/youtube-embed.mdx +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/troubleshooting/common-issues.mdx +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/docs/troubleshooting/connection-errors.mdx +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/examples/airbnb_mcp.json +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/examples/blender_use.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/examples/browser_use.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/examples/chat_example.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/examples/filesystem_use.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/examples/http_example.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/examples/mcp_everything.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/examples/multi_server_example.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/examples/sandbox_everything.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/__init__.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/adapters/__init__.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/adapters/base.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/adapters/langchain_adapter.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/agents/base.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/agents/prompts/system_prompt_builder.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/connectors/__init__.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/connectors/base.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/connectors/http.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/connectors/sandbox.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/connectors/stdio.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/connectors/utils.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/connectors/websocket.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/logging.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/managers/tools/base_tool.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/managers/tools/connect_server.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/managers/tools/disconnect_server.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/managers/tools/get_active_server.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/managers/tools/list_servers_tool.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/managers/tools/search_tools.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/observability/__init__.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/observability/laminar.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/observability/langfuse.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/session.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/task_managers/__init__.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/task_managers/base.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/task_managers/sse.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/task_managers/stdio.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/task_managers/streamable_http.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/task_managers/websocket.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/telemetry/__init__.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/telemetry/events.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/telemetry/telemetry.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/telemetry/utils.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/types/sandbox.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/mcp_use/utils.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/pytest.ini +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/ruff.toml +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/static/logo_black.svg +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/static/logo_white.svg +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/conftest.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/integration/__init__.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/integration/conftest.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/integration/primitives/test_elicitation.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/integration/primitives/test_prompts.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/integration/primitives/test_resources.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/integration/primitives/test_sampling.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/integration/primitives/test_tools.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/integration/servers_for_testing/__init__.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/integration/servers_for_testing/custom_streaming_server.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/integration/servers_for_testing/primitive_server.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/integration/servers_for_testing/simple_server.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/integration/servers_for_testing/timeout_test_server.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/unit/test_config.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/unit/test_http_connector.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/unit/test_logging.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/unit/test_sandbox_connector.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/unit/test_search_tools_issue_138.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/unit/test_session.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/unit/test_stdio_connector.py +0 -0
- {mcp_use-1.3.7 → mcp_use-1.3.8}/tests/unit/test_websocket_connection_manager.py +0 -0
|
@@ -53,7 +53,7 @@ jobs:
|
|
|
53
53
|
strategy:
|
|
54
54
|
fail-fast: false
|
|
55
55
|
matrix:
|
|
56
|
-
transport: [stdio, sse,
|
|
56
|
+
transport: [stdio, sse, streamable_http]
|
|
57
57
|
steps:
|
|
58
58
|
- uses: actions/checkout@v3
|
|
59
59
|
- name: Set up Python 3.11
|
|
@@ -68,7 +68,7 @@ jobs:
|
|
|
68
68
|
uv pip install --system .[dev,anthropic,openai,search,e2b]
|
|
69
69
|
- name: Run integration tests for ${{ matrix.transport }} transport
|
|
70
70
|
run: |
|
|
71
|
-
pytest tests/integration/transports
|
|
71
|
+
pytest tests/integration/transports/test_${{ matrix.transport }}.py
|
|
72
72
|
|
|
73
73
|
primitive-tests:
|
|
74
74
|
needs: lint
|
|
@@ -93,3 +93,23 @@ jobs:
|
|
|
93
93
|
- name: Run integration tests for ${{ matrix.primitive }} primitive
|
|
94
94
|
run: |
|
|
95
95
|
pytest tests/integration/primitives/test_${{ matrix.primitive }}.py
|
|
96
|
+
|
|
97
|
+
integration-tests:
|
|
98
|
+
needs: lint
|
|
99
|
+
name: "Integration"
|
|
100
|
+
runs-on: ubuntu-latest
|
|
101
|
+
steps:
|
|
102
|
+
- uses: actions/checkout@v3
|
|
103
|
+
- name: Set up Python 3.11
|
|
104
|
+
uses: actions/setup-python@v4
|
|
105
|
+
with:
|
|
106
|
+
python-version: "3.11"
|
|
107
|
+
- name: Install uv
|
|
108
|
+
run: |
|
|
109
|
+
pip install uv
|
|
110
|
+
- name: Install dependencies
|
|
111
|
+
run: |
|
|
112
|
+
uv pip install --system .[dev,anthropic,openai,search,e2b]
|
|
113
|
+
- name: Run other integration tests
|
|
114
|
+
run: |
|
|
115
|
+
pytest tests/integration/others/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mcp-use
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.8
|
|
4
4
|
Summary: MCP Library for LLMs
|
|
5
5
|
Author-email: Pietro Zullo <pietro.zullo@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -17,7 +17,7 @@ Requires-Python: >=3.11
|
|
|
17
17
|
Requires-Dist: aiohttp>=3.9.0
|
|
18
18
|
Requires-Dist: jsonschema-pydantic>=0.1.0
|
|
19
19
|
Requires-Dist: langchain>=0.1.0
|
|
20
|
-
Requires-Dist: mcp>=1.
|
|
20
|
+
Requires-Dist: mcp>=1.10.0
|
|
21
21
|
Requires-Dist: posthog>=4.8.0
|
|
22
22
|
Requires-Dist: pydantic>=2.0.0
|
|
23
23
|
Requires-Dist: python-dotenv>=1.0.0
|
|
@@ -84,10 +84,9 @@ Description-Content-Type: text/markdown
|
|
|
84
84
|
|
|
85
85
|
💡 Let developers easily connect any LLM to tools like web browsing, file operations, and more.
|
|
86
86
|
|
|
87
|
-
-
|
|
87
|
+
- If you want to get started quickly check out [mcp-use.com website](https://mcp-use.com/) to build and deploy agents with your favorite MCP servers.
|
|
88
88
|
- Visit the [mcp-use docs](https://docs.mcp-use.com/) to get started with mcp-use library
|
|
89
|
-
|
|
90
|
-
💬 Get started quickly - chat with your servers on our <b>hosted version</b>! [Try mcp-use chat (beta)](https://chat.mcp-use.com).
|
|
89
|
+
- For the TypeScript version, visit [mcp-use-ts](https://github.com/mcp-use/mcp-use-ts)
|
|
91
90
|
|
|
92
91
|
| Supports | |
|
|
93
92
|
| :--- | :--- |
|
|
@@ -812,45 +811,45 @@ Thanks to all our amazing contributors!
|
|
|
812
811
|
<th width="400">Repository</th>
|
|
813
812
|
<th>Stars</th>
|
|
814
813
|
</tr>
|
|
814
|
+
<tr>
|
|
815
|
+
<td><img src="https://avatars.githubusercontent.com/u/38653995?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/patchy631/ai-engineering-hub"><strong>patchy631/ai-engineering-hub</strong></a></td>
|
|
816
|
+
<td>⭐ 15189</td>
|
|
817
|
+
</tr>
|
|
815
818
|
<tr>
|
|
816
819
|
<td><img src="https://avatars.githubusercontent.com/u/170207473?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/tavily-ai/meeting-prep-agent"><strong>tavily-ai/meeting-prep-agent</strong></a></td>
|
|
817
|
-
<td>⭐
|
|
820
|
+
<td>⭐ 129</td>
|
|
821
|
+
</tr>
|
|
822
|
+
<tr>
|
|
823
|
+
<td><img src="https://avatars.githubusercontent.com/u/187057607?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/hud-evals/hud-sdk"><strong>hud-evals/hud-sdk</strong></a></td>
|
|
824
|
+
<td>⭐ 75</td>
|
|
818
825
|
</tr>
|
|
819
826
|
<tr>
|
|
820
827
|
<td><img src="https://avatars.githubusercontent.com/u/20041231?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/krishnaik06/MCP-CRASH-Course"><strong>krishnaik06/MCP-CRASH-Course</strong></a></td>
|
|
821
|
-
<td>⭐
|
|
828
|
+
<td>⭐ 58</td>
|
|
829
|
+
</tr>
|
|
830
|
+
<tr>
|
|
831
|
+
<td><img src="https://avatars.githubusercontent.com/u/54944174?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/larksuite/lark-samples"><strong>larksuite/lark-samples</strong></a></td>
|
|
832
|
+
<td>⭐ 31</td>
|
|
822
833
|
</tr>
|
|
823
834
|
<tr>
|
|
824
835
|
<td><img src="https://avatars.githubusercontent.com/u/892404?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/truemagic-coder/solana-agent-app"><strong>truemagic-coder/solana-agent-app</strong></a></td>
|
|
825
|
-
<td>⭐
|
|
836
|
+
<td>⭐ 30</td>
|
|
826
837
|
</tr>
|
|
827
838
|
<tr>
|
|
828
839
|
<td><img src="https://avatars.githubusercontent.com/u/8344498?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/schogini/techietalksai"><strong>schogini/techietalksai</strong></a></td>
|
|
829
|
-
<td>⭐
|
|
840
|
+
<td>⭐ 24</td>
|
|
830
841
|
</tr>
|
|
831
842
|
<tr>
|
|
832
843
|
<td><img src="https://avatars.githubusercontent.com/u/201161342?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/autometa-dev/whatsapp-mcp-voice-agent"><strong>autometa-dev/whatsapp-mcp-voice-agent</strong></a></td>
|
|
833
|
-
<td>⭐
|
|
844
|
+
<td>⭐ 22</td>
|
|
834
845
|
</tr>
|
|
835
846
|
<tr>
|
|
836
847
|
<td><img src="https://avatars.githubusercontent.com/u/100749943?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/Deniscartin/mcp-cli"><strong>Deniscartin/mcp-cli</strong></a></td>
|
|
837
|
-
<td>⭐
|
|
838
|
-
</tr>
|
|
839
|
-
<tr>
|
|
840
|
-
<td><img src="https://avatars.githubusercontent.com/u/6764390?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/elastic/genai-workshops"><strong>elastic/genai-workshops</strong></a></td>
|
|
841
|
-
<td>⭐ 9</td>
|
|
848
|
+
<td>⭐ 18</td>
|
|
842
849
|
</tr>
|
|
843
850
|
<tr>
|
|
844
851
|
<td><img src="https://avatars.githubusercontent.com/u/6688805?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/innovaccer/Healthcare-MCP"><strong>innovaccer/Healthcare-MCP</strong></a></td>
|
|
845
|
-
<td>⭐
|
|
846
|
-
</tr>
|
|
847
|
-
<tr>
|
|
848
|
-
<td><img src="https://avatars.githubusercontent.com/u/205593730?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/Qingyon-AI/Revornix"><strong>Qingyon-AI/Revornix</strong></a></td>
|
|
849
|
-
<td>⭐ 5</td>
|
|
850
|
-
</tr>
|
|
851
|
-
<tr>
|
|
852
|
-
<td><img src="https://avatars.githubusercontent.com/u/68845761?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/entbappy/MCP-Tutorials"><strong>entbappy/MCP-Tutorials</strong></a></td>
|
|
853
|
-
<td>⭐ 5</td>
|
|
852
|
+
<td>⭐ 15</td>
|
|
854
853
|
</tr>
|
|
855
854
|
</table>
|
|
856
855
|
|
|
@@ -39,10 +39,9 @@
|
|
|
39
39
|
|
|
40
40
|
💡 Let developers easily connect any LLM to tools like web browsing, file operations, and more.
|
|
41
41
|
|
|
42
|
-
-
|
|
42
|
+
- If you want to get started quickly check out [mcp-use.com website](https://mcp-use.com/) to build and deploy agents with your favorite MCP servers.
|
|
43
43
|
- Visit the [mcp-use docs](https://docs.mcp-use.com/) to get started with mcp-use library
|
|
44
|
-
|
|
45
|
-
💬 Get started quickly - chat with your servers on our <b>hosted version</b>! [Try mcp-use chat (beta)](https://chat.mcp-use.com).
|
|
44
|
+
- For the TypeScript version, visit [mcp-use-ts](https://github.com/mcp-use/mcp-use-ts)
|
|
46
45
|
|
|
47
46
|
| Supports | |
|
|
48
47
|
| :--- | :--- |
|
|
@@ -767,45 +766,45 @@ Thanks to all our amazing contributors!
|
|
|
767
766
|
<th width="400">Repository</th>
|
|
768
767
|
<th>Stars</th>
|
|
769
768
|
</tr>
|
|
769
|
+
<tr>
|
|
770
|
+
<td><img src="https://avatars.githubusercontent.com/u/38653995?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/patchy631/ai-engineering-hub"><strong>patchy631/ai-engineering-hub</strong></a></td>
|
|
771
|
+
<td>⭐ 15189</td>
|
|
772
|
+
</tr>
|
|
770
773
|
<tr>
|
|
771
774
|
<td><img src="https://avatars.githubusercontent.com/u/170207473?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/tavily-ai/meeting-prep-agent"><strong>tavily-ai/meeting-prep-agent</strong></a></td>
|
|
772
|
-
<td>⭐
|
|
775
|
+
<td>⭐ 129</td>
|
|
776
|
+
</tr>
|
|
777
|
+
<tr>
|
|
778
|
+
<td><img src="https://avatars.githubusercontent.com/u/187057607?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/hud-evals/hud-sdk"><strong>hud-evals/hud-sdk</strong></a></td>
|
|
779
|
+
<td>⭐ 75</td>
|
|
773
780
|
</tr>
|
|
774
781
|
<tr>
|
|
775
782
|
<td><img src="https://avatars.githubusercontent.com/u/20041231?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/krishnaik06/MCP-CRASH-Course"><strong>krishnaik06/MCP-CRASH-Course</strong></a></td>
|
|
776
|
-
<td>⭐
|
|
783
|
+
<td>⭐ 58</td>
|
|
784
|
+
</tr>
|
|
785
|
+
<tr>
|
|
786
|
+
<td><img src="https://avatars.githubusercontent.com/u/54944174?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/larksuite/lark-samples"><strong>larksuite/lark-samples</strong></a></td>
|
|
787
|
+
<td>⭐ 31</td>
|
|
777
788
|
</tr>
|
|
778
789
|
<tr>
|
|
779
790
|
<td><img src="https://avatars.githubusercontent.com/u/892404?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/truemagic-coder/solana-agent-app"><strong>truemagic-coder/solana-agent-app</strong></a></td>
|
|
780
|
-
<td>⭐
|
|
791
|
+
<td>⭐ 30</td>
|
|
781
792
|
</tr>
|
|
782
793
|
<tr>
|
|
783
794
|
<td><img src="https://avatars.githubusercontent.com/u/8344498?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/schogini/techietalksai"><strong>schogini/techietalksai</strong></a></td>
|
|
784
|
-
<td>⭐
|
|
795
|
+
<td>⭐ 24</td>
|
|
785
796
|
</tr>
|
|
786
797
|
<tr>
|
|
787
798
|
<td><img src="https://avatars.githubusercontent.com/u/201161342?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/autometa-dev/whatsapp-mcp-voice-agent"><strong>autometa-dev/whatsapp-mcp-voice-agent</strong></a></td>
|
|
788
|
-
<td>⭐
|
|
799
|
+
<td>⭐ 22</td>
|
|
789
800
|
</tr>
|
|
790
801
|
<tr>
|
|
791
802
|
<td><img src="https://avatars.githubusercontent.com/u/100749943?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/Deniscartin/mcp-cli"><strong>Deniscartin/mcp-cli</strong></a></td>
|
|
792
|
-
<td>⭐
|
|
793
|
-
</tr>
|
|
794
|
-
<tr>
|
|
795
|
-
<td><img src="https://avatars.githubusercontent.com/u/6764390?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/elastic/genai-workshops"><strong>elastic/genai-workshops</strong></a></td>
|
|
796
|
-
<td>⭐ 9</td>
|
|
803
|
+
<td>⭐ 18</td>
|
|
797
804
|
</tr>
|
|
798
805
|
<tr>
|
|
799
806
|
<td><img src="https://avatars.githubusercontent.com/u/6688805?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/innovaccer/Healthcare-MCP"><strong>innovaccer/Healthcare-MCP</strong></a></td>
|
|
800
|
-
<td>⭐
|
|
801
|
-
</tr>
|
|
802
|
-
<tr>
|
|
803
|
-
<td><img src="https://avatars.githubusercontent.com/u/205593730?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/Qingyon-AI/Revornix"><strong>Qingyon-AI/Revornix</strong></a></td>
|
|
804
|
-
<td>⭐ 5</td>
|
|
805
|
-
</tr>
|
|
806
|
-
<tr>
|
|
807
|
-
<td><img src="https://avatars.githubusercontent.com/u/68845761?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/entbappy/MCP-Tutorials"><strong>entbappy/MCP-Tutorials</strong></a></td>
|
|
808
|
-
<td>⭐ 5</td>
|
|
807
|
+
<td>⭐ 15</td>
|
|
809
808
|
</tr>
|
|
810
809
|
</table>
|
|
811
810
|
|
|
@@ -439,10 +439,10 @@ agent = MCPAgent(
|
|
|
439
439
|
## Next Steps
|
|
440
440
|
|
|
441
441
|
<CardGroup cols={3}>
|
|
442
|
-
<Card title="Server Manager" icon="server" href="/
|
|
442
|
+
<Card title="Server Manager" icon="server" href="/agent/server-manager">
|
|
443
443
|
Learn more about dynamic server selection and management
|
|
444
444
|
</Card>
|
|
445
|
-
<Card title="Security Guide" icon="shield" href="/
|
|
445
|
+
<Card title="Security Guide" icon="shield" href="/advanced/security">
|
|
446
446
|
Best practices for secure multi-server configurations
|
|
447
447
|
</Card>
|
|
448
448
|
<Card title="Performance" icon="zap" href="/troubleshooting/performance">
|
|
@@ -580,7 +580,7 @@ def secure_command_args(command: str, args: List[str]) -> List[str]:
|
|
|
580
580
|
## Next Steps
|
|
581
581
|
|
|
582
582
|
<CardGroup cols={3}>
|
|
583
|
-
<Card title="Configuration Guide" icon="gear" href="/
|
|
583
|
+
<Card title="Configuration Guide" icon="gear" href="/getting-started/configuration">
|
|
584
584
|
Learn secure configuration practices for MCP servers
|
|
585
585
|
</Card>
|
|
586
586
|
<Card title="Deployment Guide" icon="rocket" href="/development">
|
|
@@ -7,7 +7,7 @@ icon: "brain"
|
|
|
7
7
|
# Agent Configuration
|
|
8
8
|
|
|
9
9
|
<Info>
|
|
10
|
-
This guide covers MCPAgent configuration options for customizing agent behavior and LLM integration. For client configuration, see the [Client Configuration](/
|
|
10
|
+
This guide covers MCPAgent configuration options for customizing agent behavior and LLM integration. For client configuration, see the [Client Configuration](/client/client-configuration) guide.
|
|
11
11
|
</Info>
|
|
12
12
|
|
|
13
13
|
## API Keys
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Server Manager'
|
|
3
|
+
description: 'Intelligent management of multiple MCP servers and dynamic tool discovery'
|
|
4
|
+
icon: 'server-cog'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Server Manager: Dynamic Multi-Server Intelligence
|
|
8
|
+
|
|
9
|
+
The Server Manager is the brain behind intelligent MCP server orchestration. It transforms your agent from a static tool user into a dynamic, adaptive assistant that can discover, connect to, and intelligently utilize tools from multiple MCP servers on-demand.
|
|
10
|
+
|
|
11
|
+
## 🎯 What Makes It Special
|
|
12
|
+
|
|
13
|
+
Instead of overwhelming your agent with hundreds of tools from all servers at once, the Server Manager:
|
|
14
|
+
|
|
15
|
+
- **Dynamically loads tools** only when needed, with full schemas
|
|
16
|
+
- **Intelligently discovers** the right server for each task
|
|
17
|
+
- **Automatically updates** available tools as connections change
|
|
18
|
+
- **Provides semantic search** across all server tools
|
|
19
|
+
- **Manages connection lifecycle** efficiently
|
|
20
|
+
|
|
21
|
+
## 🏗️ Architecture Overview
|
|
22
|
+
|
|
23
|
+
```mermaid
|
|
24
|
+
graph TB
|
|
25
|
+
Agent[MCPAgent] --> SM[ServerManager]
|
|
26
|
+
SM --> S1[Web Server]
|
|
27
|
+
SM --> S2[File Server]
|
|
28
|
+
SM --> S3[Database Server]
|
|
29
|
+
|
|
30
|
+
SM --> Tools[Dynamic Tools]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 🔄 Dynamic Tool Loading Process
|
|
34
|
+
|
|
35
|
+
```mermaid
|
|
36
|
+
sequenceDiagram
|
|
37
|
+
Agent->>ServerManager: Connect to server
|
|
38
|
+
ServerManager->>Server: Get tools
|
|
39
|
+
Server->>ServerManager: Return tools
|
|
40
|
+
ServerManager->>Agent: Tools now available
|
|
41
|
+
Agent->>Server: Use tools directly
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 🚀 Getting Started
|
|
45
|
+
|
|
46
|
+
Enable the Server Manager in your agent:
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from mcp_use import MCPClient, MCPAgent
|
|
50
|
+
from langchain_openai import ChatOpenAI
|
|
51
|
+
|
|
52
|
+
# Create client with multiple servers
|
|
53
|
+
client = MCPClient.from_dict({
|
|
54
|
+
"mcpServers": {
|
|
55
|
+
"playwright": {
|
|
56
|
+
"command": "npx",
|
|
57
|
+
"args": ["@playwright/mcp@latest"]
|
|
58
|
+
},
|
|
59
|
+
"filesystem": {
|
|
60
|
+
"command": "uvx",
|
|
61
|
+
"args": ["mcp-server-filesystem", "/tmp"]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
# 🎯 Enable Server Manager
|
|
67
|
+
agent = MCPAgent(
|
|
68
|
+
llm=ChatOpenAI(model="gpt-4"),
|
|
69
|
+
client=client,
|
|
70
|
+
use_server_manager=True # ✨ This is the magic switch!
|
|
71
|
+
)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## 🔍 Tool Discovery Flow
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## 🛠️ Management Tools Deep Dive
|
|
80
|
+
|
|
81
|
+
### Core Server Management
|
|
82
|
+
|
|
83
|
+
| Tool | Purpose | Example |
|
|
84
|
+
|------|---------|---------|
|
|
85
|
+
| `list_mcp_servers` | Discovery of available servers and their tools | "What servers do I have access to?" |
|
|
86
|
+
| `connect_to_mcp_server` | Activate a server and load its tools | "Connect to the filesystem server" |
|
|
87
|
+
| `get_active_mcp_server` | Check current connection status | "Which server am I currently using?" |
|
|
88
|
+
| `disconnect_from_mcp_server` | Deactivate server and remove its tools | "Disconnect from current server" |
|
|
89
|
+
| `search_mcp_tools` | Semantic search across all server tools | "Find tools for image processing" |
|
|
90
|
+
|
|
91
|
+
### Smart Tool Search Example
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
# Agent automatically discovers and uses the right tools
|
|
95
|
+
result = await agent.run("""
|
|
96
|
+
I need to:
|
|
97
|
+
1. Find tools for web scraping
|
|
98
|
+
2. Connect to the right server
|
|
99
|
+
3. Scrape data from https://example.com
|
|
100
|
+
4. Save it to a file
|
|
101
|
+
|
|
102
|
+
Start by searching for relevant tools.
|
|
103
|
+
""")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Agent Process:**
|
|
107
|
+
```mermaid
|
|
108
|
+
graph LR
|
|
109
|
+
Search[Search Tools] --> Connect[Connect Server]
|
|
110
|
+
Connect --> Use[Use Tools]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## 🎭 Real-World Use Cases
|
|
114
|
+
|
|
115
|
+
### 1. Multi-Server Data Pipeline
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
result = await agent.run("""
|
|
119
|
+
Create a data pipeline that:
|
|
120
|
+
1. Scrapes product data from an e-commerce site
|
|
121
|
+
2. Processes and cleans the data
|
|
122
|
+
3. Saves it to a CSV file
|
|
123
|
+
4. Loads it into a SQLite database
|
|
124
|
+
|
|
125
|
+
Figure out which servers and tools you need.
|
|
126
|
+
""")
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Server Flow:**
|
|
130
|
+
```
|
|
131
|
+
playwright → filesystem → database
|
|
132
|
+
↓ ↓ ↓
|
|
133
|
+
scraping → save CSV → load data
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### 2. Content Creation Workflow
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
result = await agent.run("""
|
|
140
|
+
I want to:
|
|
141
|
+
1. Search for trending topics online
|
|
142
|
+
2. Generate an image based on the topic
|
|
143
|
+
3. Write a blog post about it
|
|
144
|
+
4. Save everything to files
|
|
145
|
+
|
|
146
|
+
What tools do I need for this?
|
|
147
|
+
""")
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## 🚀 Performance Benefits
|
|
151
|
+
|
|
152
|
+
The Server Manager provides focused tool access:
|
|
153
|
+
|
|
154
|
+
- **Without Server Manager**: All 100+ tools from all servers loaded at once, overwhelming the model
|
|
155
|
+
- **With Server Manager**: Only 5-15 relevant tools from the active server, providing clear focus
|
|
156
|
+
|
|
157
|
+
## Core Features
|
|
158
|
+
|
|
159
|
+
The Server Manager provides these powerful capabilities:
|
|
160
|
+
|
|
161
|
+
- **🔗 Dynamic Tool Addition**: Server tools automatically added with full schemas
|
|
162
|
+
- **⚡ Real-time Updates**: Tool list updates immediately when connecting/disconnecting
|
|
163
|
+
- **🧹 Clean Architecture**: Direct tool access with proper schemas
|
|
164
|
+
- **🎯 Model Understanding**: Tools come with native schemas and validation
|
|
165
|
+
- **📊 Smart Logging**: Detailed insights into tool changes and server status
|
|
166
|
+
|
|
167
|
+
## 🏁 Complete Example
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
import asyncio
|
|
171
|
+
from mcp_use import MCPClient, MCPAgent
|
|
172
|
+
from langchain_openai import ChatOpenAI
|
|
173
|
+
|
|
174
|
+
async def demo_server_manager():
|
|
175
|
+
# Multi-server configuration
|
|
176
|
+
client = MCPClient.from_dict({
|
|
177
|
+
"mcpServers": {
|
|
178
|
+
"web": {"command": "npx", "args": ["@playwright/mcp@latest"]},
|
|
179
|
+
"files": {"command": "uvx", "args": ["mcp-server-filesystem", "/tmp"]},
|
|
180
|
+
"database": {"command": "uvx", "args": ["mcp-server-sqlite"]}
|
|
181
|
+
}
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
# Agent with Server Manager
|
|
185
|
+
agent = MCPAgent(
|
|
186
|
+
llm=ChatOpenAI(model="gpt-4"),
|
|
187
|
+
client=client,
|
|
188
|
+
use_server_manager=True,
|
|
189
|
+
verbose=True # See the magic happen!
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
# Complex multi-server task
|
|
193
|
+
result = await agent.run("""
|
|
194
|
+
I need to build a complete data collection system:
|
|
195
|
+
|
|
196
|
+
1. First, show me what servers and tools are available
|
|
197
|
+
2. Scrape product information from https://example-store.com
|
|
198
|
+
3. Clean and structure the data
|
|
199
|
+
4. Save it as both JSON and CSV files
|
|
200
|
+
5. Load the data into a SQLite database
|
|
201
|
+
6. Generate a summary report
|
|
202
|
+
|
|
203
|
+
Guide me through each step and show me how you discover and use the right tools.
|
|
204
|
+
""")
|
|
205
|
+
|
|
206
|
+
print("🎉 Task completed!")
|
|
207
|
+
print(result)
|
|
208
|
+
|
|
209
|
+
await agent.close()
|
|
210
|
+
|
|
211
|
+
if __name__ == "__main__":
|
|
212
|
+
asyncio.run(demo_server_manager())
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
The Server Manager transforms your MCP agent from a static tool user into an intelligent, adaptive assistant that can dynamically discover and utilize the perfect tools for any task! 🚀
|
|
@@ -284,10 +284,10 @@ if __name__ == "__main__":
|
|
|
284
284
|
## Next Steps
|
|
285
285
|
|
|
286
286
|
<CardGroup cols={3}>
|
|
287
|
-
<Card title="Agent Configuration" icon="gear" href="/
|
|
287
|
+
<Card title="Agent Configuration" icon="gear" href="/agent/agent-configuration">
|
|
288
288
|
Learn more about configuring agents for optimal streaming performance
|
|
289
289
|
</Card>
|
|
290
|
-
<Card title="Multi-Server Setup" icon="server" href="/
|
|
290
|
+
<Card title="Multi-Server Setup" icon="server" href="/advanced/multi-server-setup">
|
|
291
291
|
Stream output from agents using multiple MCP servers
|
|
292
292
|
</Card>
|
|
293
293
|
<Card title="Performance Optimization" icon="zap" href="/troubleshooting/performance">
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Agent Structured Output"
|
|
3
|
+
description: "Get strongly-typed Pydantic models with intelligent retry logic"
|
|
4
|
+
icon: "shapes"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Agent Structured Output
|
|
8
|
+
|
|
9
|
+
The MCPAgent supports structured output, allowing you to get strongly-typed Pydantic models instead of plain text responses. The agent becomes **schema-aware** and will intelligently retry to gather missing information until all required fields can be populated.
|
|
10
|
+
|
|
11
|
+
## How it Works
|
|
12
|
+
|
|
13
|
+
When you provide an `output_schema` parameter, the agent:
|
|
14
|
+
|
|
15
|
+
1. **Understands requirements** - The agent knows exactly what information it needs to collect
|
|
16
|
+
2. **Attempts structured output** - At completion points, tries to format the result into your schema
|
|
17
|
+
3. **Intelligently retries** - If required fields are missing, continues execution to gather the missing data
|
|
18
|
+
4. **Validates completeness** - Only finishes when all required fields can be populated
|
|
19
|
+
|
|
20
|
+
## Basic Example
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
import asyncio
|
|
24
|
+
from pydantic import BaseModel, Field
|
|
25
|
+
from langchain_openai import ChatOpenAI
|
|
26
|
+
from mcp_use import MCPAgent, MCPClient
|
|
27
|
+
|
|
28
|
+
class WeatherInfo(BaseModel):
|
|
29
|
+
"""Weather information for a location"""
|
|
30
|
+
city: str = Field(description="City name")
|
|
31
|
+
temperature: float = Field(description="Temperature in Celsius")
|
|
32
|
+
condition: str = Field(description="Weather condition")
|
|
33
|
+
humidity: int = Field(description="Humidity percentage")
|
|
34
|
+
|
|
35
|
+
async def main():
|
|
36
|
+
# Setup client and agent
|
|
37
|
+
client = MCPClient(config={"mcpServers": {...}})
|
|
38
|
+
llm = ChatOpenAI(model="gpt-4o")
|
|
39
|
+
agent = MCPAgent(llm=llm, client=client)
|
|
40
|
+
|
|
41
|
+
# Get structured output
|
|
42
|
+
weather: WeatherInfo = await agent.run(
|
|
43
|
+
"Get the current weather in San Francisco",
|
|
44
|
+
output_schema=WeatherInfo
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
print(f"Temperature in {weather.city}: {weather.temperature}°C")
|
|
48
|
+
print(f"Condition: {weather.condition}")
|
|
49
|
+
print(f"Humidity: {weather.humidity}%")
|
|
50
|
+
|
|
51
|
+
asyncio.run(main())
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Key Benefits
|
|
55
|
+
|
|
56
|
+
- **Type Safety**: Get Pydantic models with full IDE support and validation
|
|
57
|
+
- **Intelligent Gathering**: Agent knows what information is required and won't stop until it has everything
|
|
58
|
+
- **Automatic Retry**: Missing fields trigger continued execution automatically
|
|
59
|
+
- **Field Validation**: Built-in validation for required fields, data types, and constraints
|
|
60
|
+
|
|
61
|
+
The agent will continue working until all required fields in your schema can be populated, ensuring you always get complete, structured data.
|
|
@@ -488,5 +488,5 @@ async def multi_server_example():
|
|
|
488
488
|
## See Also
|
|
489
489
|
|
|
490
490
|
- [MCPAgent API Reference](/api-reference/mcpagent) - High-level agent interface
|
|
491
|
-
- [Configuration Guide](/
|
|
492
|
-
- [Connection Types](/
|
|
491
|
+
- [Configuration Guide](/getting-started/configuration) - Detailed configuration options
|
|
492
|
+
- [Connection Types](/client/connection-types) - Understanding different server types
|
|
@@ -7,7 +7,7 @@ icon: "server"
|
|
|
7
7
|
# Client Configuration
|
|
8
8
|
|
|
9
9
|
<Info>
|
|
10
|
-
This guide covers MCPClient configuration options for connecting to MCP servers. For agent configuration, see the [Agent Configuration](/
|
|
10
|
+
This guide covers MCPClient configuration options for connecting to MCP servers. For agent configuration, see the [Agent Configuration](/agent/agent-configuration) guide.
|
|
11
11
|
</Info>
|
|
12
12
|
|
|
13
13
|
|
|
@@ -191,6 +191,6 @@ We review submissions regularly and feature projects that provide value to the m
|
|
|
191
191
|
|
|
192
192
|
## Further Reading
|
|
193
193
|
|
|
194
|
-
- [Building Custom Agents](/
|
|
195
|
-
- [Multi-Server Setup](/
|
|
194
|
+
- [Building Custom Agents](/advanced/building-custom-agents) - Comprehensive guide to creating custom agents with mcp-use
|
|
195
|
+
- [Multi-Server Setup](/advanced/multi-server-setup) - Learn how to orchestrate multiple MCP servers
|
|
196
196
|
- [Examples Repository](https://github.com/mcp-use/mcp-use/tree/main/examples) - Official collection of usage examples
|
|
@@ -42,23 +42,23 @@
|
|
|
42
42
|
{
|
|
43
43
|
"group": "Getting Started",
|
|
44
44
|
"pages": [
|
|
45
|
-
"index",
|
|
46
|
-
"quickstart",
|
|
47
|
-
"installation"
|
|
45
|
+
"getting-started/index",
|
|
46
|
+
"getting-started/quickstart",
|
|
47
|
+
"getting-started/installation",
|
|
48
|
+
"getting-started/configuration"
|
|
48
49
|
]
|
|
49
50
|
},
|
|
50
51
|
{
|
|
51
52
|
"group": "Client Configuration",
|
|
52
53
|
"pages": [
|
|
53
|
-
"
|
|
54
|
-
"essentials/client-configuration",
|
|
54
|
+
"client/client-configuration",
|
|
55
55
|
{
|
|
56
56
|
"group": "Client Features",
|
|
57
57
|
"icon": "list-plus",
|
|
58
58
|
"pages": [
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
59
|
+
"client/connection-types",
|
|
60
|
+
"client/sampling",
|
|
61
|
+
"client/elicitation"
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
]
|
|
@@ -66,19 +66,20 @@
|
|
|
66
66
|
{
|
|
67
67
|
"group": "Agent Configuration",
|
|
68
68
|
"pages": [
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
69
|
+
"agent/agent-configuration",
|
|
70
|
+
"agent/llm-integration",
|
|
71
|
+
"agent/server-manager",
|
|
72
|
+
"agent/streaming",
|
|
73
|
+
"agent/structured-output"
|
|
73
74
|
]
|
|
74
75
|
},
|
|
75
76
|
{
|
|
76
77
|
"group": "Advanced Usage",
|
|
77
78
|
"pages": [
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
79
|
+
"advanced/building-custom-agents",
|
|
80
|
+
"advanced/logging",
|
|
81
|
+
"advanced/multi-server-setup",
|
|
82
|
+
"advanced/security"
|
|
82
83
|
]
|
|
83
84
|
},
|
|
84
85
|
{
|