mcp-use 1.3.11__tar.gz → 1.3.13__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.11 → mcp_use-1.3.13}/.pre-commit-config.yaml +1 -2
- {mcp_use-1.3.11 → mcp_use-1.3.13}/PKG-INFO +66 -40
- {mcp_use-1.3.11 → mcp_use-1.3.13}/README.md +60 -35
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/chat_example.py +5 -7
- mcp_use-1.3.13/examples/example_middleware.py +72 -0
- mcp_use-1.3.13/examples/limited_memory_chat.py +88 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/__init__.py +1 -1
- mcp_use-1.3.13/mcp_use/adapters/__init__.py +21 -0
- mcp_use-1.3.13/mcp_use/adapters/base.py +17 -0
- mcp_use-1.3.13/mcp_use/adapters/langchain_adapter.py +18 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/adapters/base.py +6 -3
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/adapters/langchain_adapter.py +10 -52
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/agents/base.py +1 -1
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/managers/server_manager.py +11 -4
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/managers/tools/connect_server.py +1 -2
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/managers/tools/disconnect_server.py +1 -2
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/managers/tools/get_active_server.py +1 -1
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/managers/tools/list_servers_tool.py +1 -2
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/managers/tools/search_tools.py +2 -2
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/agents/mcpagent.py +88 -47
- mcp_use-1.3.13/mcp_use/agents/remote.py +366 -0
- mcp_use-1.3.13/mcp_use/auth/__init__.py +21 -0
- mcp_use-1.3.13/mcp_use/auth/bearer.py +16 -0
- mcp_use-1.3.13/mcp_use/auth/oauth.py +16 -0
- mcp_use-1.3.13/mcp_use/auth/oauth_callback.py +23 -0
- mcp_use-1.3.13/mcp_use/client/__init__.py +1 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/auth/bearer.py +6 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/auth/oauth.py +8 -4
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/auth/oauth_callback.py +1 -1
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/client.py +35 -5
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/config.py +11 -4
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/connectors/base.py +20 -3
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/connectors/http.py +23 -12
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/connectors/sandbox.py +36 -6
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/connectors/stdio.py +14 -6
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/connectors/websocket.py +4 -4
- mcp_use-1.3.13/mcp_use/client/middleware/__init__.py +50 -0
- mcp_use-1.3.13/mcp_use/client/middleware/logging.py +31 -0
- mcp_use-1.3.13/mcp_use/client/middleware/metrics.py +314 -0
- mcp_use-1.3.13/mcp_use/client/middleware/middleware.py +266 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/session.py +9 -1
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/task_managers/base.py +1 -1
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/task_managers/sse.py +2 -2
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/task_managers/stdio.py +2 -2
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/task_managers/streamable_http.py +2 -2
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/task_managers/websocket.py +2 -2
- mcp_use-1.3.13/mcp_use/client.py +18 -0
- mcp_use-1.3.13/mcp_use/config.py +27 -0
- mcp_use-1.3.13/mcp_use/connectors/.deprecated +0 -0
- mcp_use-1.3.13/mcp_use/connectors/__init__.py +46 -0
- mcp_use-1.3.13/mcp_use/connectors/base.py +18 -0
- mcp_use-1.3.13/mcp_use/connectors/http.py +18 -0
- mcp_use-1.3.13/mcp_use/connectors/sandbox.py +18 -0
- mcp_use-1.3.13/mcp_use/connectors/stdio.py +18 -0
- mcp_use-1.3.13/mcp_use/connectors/utils.py +20 -0
- mcp_use-1.3.13/mcp_use/connectors/websocket.py +18 -0
- mcp_use-1.3.13/mcp_use/exceptions.py +46 -0
- mcp_use-1.3.13/mcp_use/managers/.deprecated +0 -0
- mcp_use-1.3.13/mcp_use/managers/__init__.py +58 -0
- mcp_use-1.3.13/mcp_use/managers/base.py +18 -0
- mcp_use-1.3.13/mcp_use/managers/server_manager.py +18 -0
- mcp_use-1.3.13/mcp_use/managers/tools/__init__.py +45 -0
- mcp_use-1.3.13/mcp_use/managers/tools/base_tool.py +8 -0
- mcp_use-1.3.13/mcp_use/managers/tools/connect_server.py +8 -0
- mcp_use-1.3.13/mcp_use/managers/tools/disconnect_server.py +8 -0
- mcp_use-1.3.13/mcp_use/managers/tools/get_active_server.py +8 -0
- mcp_use-1.3.13/mcp_use/managers/tools/list_servers_tool.py +8 -0
- mcp_use-1.3.13/mcp_use/managers/tools/search_tools.py +24 -0
- mcp_use-1.3.13/mcp_use/middleware/.deprecated +0 -0
- mcp_use-1.3.13/mcp_use/middleware/__init__.py +89 -0
- mcp_use-1.3.13/mcp_use/middleware/logging.py +19 -0
- mcp_use-1.3.13/mcp_use/middleware/metrics.py +41 -0
- mcp_use-1.3.13/mcp_use/middleware/middleware.py +55 -0
- mcp_use-1.3.13/mcp_use/session.py +18 -0
- mcp_use-1.3.13/mcp_use/task_managers/.deprecated +0 -0
- mcp_use-1.3.13/mcp_use/task_managers/__init__.py +48 -0
- mcp_use-1.3.13/mcp_use/task_managers/base.py +18 -0
- mcp_use-1.3.13/mcp_use/task_managers/sse.py +18 -0
- mcp_use-1.3.13/mcp_use/task_managers/stdio.py +18 -0
- mcp_use-1.3.13/mcp_use/task_managers/streamable_http.py +20 -0
- mcp_use-1.3.13/mcp_use/task_managers/websocket.py +18 -0
- mcp_use-1.3.13/mcp_use/telemetry/__init__.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/telemetry/events.py +58 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/telemetry/telemetry.py +71 -1
- mcp_use-1.3.13/mcp_use/types/.deprecated +0 -0
- mcp_use-1.3.13/mcp_use/types/sandbox.py +18 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/pyproject.toml +6 -3
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/conftest.py +10 -2
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/others/test_custom_streaming_integration.py +3 -1
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/primitives/test_auth.py +7 -7
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/transports/test_sse.py +3 -1
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/transports/test_streamable_http.py +3 -1
- mcp_use-1.3.13/tests/unit/backward_compatibility.py +104 -0
- mcp_use-1.3.13/tests/unit/test_agent.py +234 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/unit/test_client.py +20 -9
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/unit/test_config.py +4 -4
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/unit/test_http_connector.py +16 -15
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/unit/test_sandbox_connector.py +15 -15
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/unit/test_search_tools_issue_138.py +4 -4
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/unit/test_stdio_connector.py +13 -12
- mcp_use-1.3.11/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- mcp_use-1.3.11/.github/pull_request_template.md +0 -43
- mcp_use-1.3.11/.github/release-drafter.yml +0 -32
- mcp_use-1.3.11/.github/workflows/changelog.yml +0 -74
- mcp_use-1.3.11/.github/workflows/publish.yml +0 -81
- mcp_use-1.3.11/.github/workflows/release-drafter.yml +0 -41
- mcp_use-1.3.11/.github/workflows/stale.yml +0 -18
- mcp_use-1.3.11/.github/workflows/tests.yml +0 -115
- mcp_use-1.3.11/.github/workflows/update-readme.yml +0 -112
- mcp_use-1.3.11/CODE_OF_CONDUCT.md +0 -128
- mcp_use-1.3.11/CONTRIBUTING.md +0 -146
- mcp_use-1.3.11/LICENSE +0 -21
- mcp_use-1.3.11/docs/README.md +0 -32
- mcp_use-1.3.11/docs/advanced/building-custom-agents.mdx +0 -236
- mcp_use-1.3.11/docs/advanced/logging.mdx +0 -152
- mcp_use-1.3.11/docs/advanced/multi-server-setup.mdx +0 -451
- mcp_use-1.3.11/docs/advanced/security.mdx +0 -596
- mcp_use-1.3.11/docs/agent/agent-configuration.mdx +0 -473
- mcp_use-1.3.11/docs/agent/interactive-chat-patterns.mdx +0 -272
- mcp_use-1.3.11/docs/agent/llm-integration.mdx +0 -306
- mcp_use-1.3.11/docs/agent/server-manager.mdx +0 -267
- mcp_use-1.3.11/docs/agent/streaming.mdx +0 -296
- mcp_use-1.3.11/docs/agent/structured-output.mdx +0 -61
- mcp_use-1.3.11/docs/api-reference/adapters.mdx +0 -519
- mcp_use-1.3.11/docs/api-reference/introduction.mdx +0 -587
- mcp_use-1.3.11/docs/api-reference/mcpagent.mdx +0 -181
- mcp_use-1.3.11/docs/api-reference/mcpclient.mdx +0 -492
- mcp_use-1.3.11/docs/changelog/1_3_11.mdx +0 -73
- mcp_use-1.3.11/docs/changelog/changelog.mdx +0 -71
- mcp_use-1.3.11/docs/client/authentication.mdx +0 -417
- mcp_use-1.3.11/docs/client/client-configuration.mdx +0 -177
- mcp_use-1.3.11/docs/client/connection-types.mdx +0 -133
- mcp_use-1.3.11/docs/client/direct-tool-calls.mdx +0 -235
- mcp_use-1.3.11/docs/client/elicitation.mdx +0 -363
- mcp_use-1.3.11/docs/client/logging.mdx +0 -61
- mcp_use-1.3.11/docs/client/notifications.mdx +0 -111
- mcp_use-1.3.11/docs/client/prompts.mdx +0 -266
- mcp_use-1.3.11/docs/client/resources.mdx +0 -229
- mcp_use-1.3.11/docs/client/sampling.mdx +0 -86
- mcp_use-1.3.11/docs/client/sandbox.mdx +0 -81
- mcp_use-1.3.11/docs/client/tools.mdx +0 -160
- mcp_use-1.3.11/docs/community/showcase.mdx +0 -196
- mcp_use-1.3.11/docs/development/observability.mdx +0 -275
- mcp_use-1.3.11/docs/development/telemetry.mdx +0 -173
- mcp_use-1.3.11/docs/development.mdx +0 -115
- mcp_use-1.3.11/docs/docs.json +0 -311
- mcp_use-1.3.11/docs/favicon.svg +0 -8
- mcp_use-1.3.11/docs/fonts.css +0 -24
- mcp_use-1.3.11/docs/getting-started/configuration.mdx +0 -162
- mcp_use-1.3.11/docs/getting-started/index.mdx +0 -187
- mcp_use-1.3.11/docs/getting-started/installation.mdx +0 -303
- mcp_use-1.3.11/docs/getting-started/quickstart.mdx +0 -184
- mcp_use-1.3.11/docs/images/01.png +0 -0
- mcp_use-1.3.11/docs/images/02.png +0 -0
- mcp_use-1.3.11/docs/images/Release1.3.11.png +0 -0
- mcp_use-1.3.11/docs/images/configuration-dark.png +0 -0
- mcp_use-1.3.11/docs/images/configuration-light.png +0 -0
- mcp_use-1.3.11/docs/images/examples-dark.png +0 -0
- mcp_use-1.3.11/docs/images/examples-light.png +0 -0
- mcp_use-1.3.11/docs/images/hero-dark.png +0 -0
- mcp_use-1.3.11/docs/images/hero-light.png +0 -0
- mcp_use-1.3.11/docs/images/installation-dark.png +0 -0
- mcp_use-1.3.11/docs/images/installation-light.png +0 -0
- mcp_use-1.3.11/docs/images/quickstart-dark.png +0 -0
- mcp_use-1.3.11/docs/images/quickstart-light.png +0 -0
- mcp_use-1.3.11/docs/logo/dark.svg +0 -8
- mcp_use-1.3.11/docs/logo/light.svg +0 -8
- mcp_use-1.3.11/docs/logo/react.svg +0 -1
- mcp_use-1.3.11/docs/snippets/snippet-intro.mdx +0 -10
- mcp_use-1.3.11/docs/snippets/youtube-embed.mdx +0 -14
- mcp_use-1.3.11/docs/troubleshooting/common-issues.mdx +0 -388
- mcp_use-1.3.11/docs/troubleshooting/connection-errors.mdx +0 -667
- mcp_use-1.3.11/docs/troubleshooting/performance.mdx +0 -553
- mcp_use-1.3.11/mcp_use/agents/remote.py +0 -327
- mcp_use-1.3.11/mcp_use/types/sandbox.py +0 -23
- {mcp_use-1.3.11 → mcp_use-1.3.13}/.env.example +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/.gitignore +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/CLAUDE.md +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/airbnb_mcp.json +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/airbnb_use.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/blender_use.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/browser_use.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/direct_tool_call.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/filesystem_use.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/http_example.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/mcp_everything.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/multi_server_example.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/sandbox_everything.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/simple_oauth_example.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/simple_server_manager_use.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/stream_example.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/examples/structured_output.py +0 -0
- /mcp_use-1.3.11/CHANGELOG.md → /mcp_use-1.3.13/mcp_use/adapters/.deprecated +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/agents/__init__.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/adapters/__init__.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/managers/__init__.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/managers/base.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/managers/tools/__init__.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/managers/tools/base_tool.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/observability/__init__.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/observability/callbacks_manager.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/observability/laminar.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/agents}/observability/langfuse.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/agents/prompts/system_prompt_builder.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/agents/prompts/templates.py +0 -0
- /mcp_use-1.3.11/mcp_use/telemetry/__init__.py → /mcp_use-1.3.13/mcp_use/auth/.deprecated +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/cli.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/auth/__init__.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/connectors/__init__.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/connectors/utils.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/exceptions.py +0 -0
- {mcp_use-1.3.11/mcp_use → mcp_use-1.3.13/mcp_use/client}/task_managers/__init__.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/errors/__init__.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/errors/error_formatting.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/logging.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/telemetry/utils.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/mcp_use/utils.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/pytest.ini +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/ruff.toml +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/static/logo-gh.jpg +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/static/logo_black.svg +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/static/logo_white.svg +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/conftest.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/__init__.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/primitives/test_discovery.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/primitives/test_elicitation.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/primitives/test_logging.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/primitives/test_notifications.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/primitives/test_prompts.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/primitives/test_resources.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/primitives/test_sampling.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/primitives/test_tools.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/servers_for_testing/__init__.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/servers_for_testing/auth_server.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/servers_for_testing/custom_streaming_server.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/servers_for_testing/primitive_server.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/servers_for_testing/simple_server.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/servers_for_testing/timeout_test_server.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/integration/transports/test_stdio.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/unit/test_enum_handling.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/unit/test_session.py +0 -0
- {mcp_use-1.3.11 → mcp_use-1.3.13}/tests/unit/test_websocket_connection_manager.py +0 -0
|
@@ -4,10 +4,9 @@ repos:
|
|
|
4
4
|
rev: v0.3.2
|
|
5
5
|
hooks:
|
|
6
6
|
- id: ruff
|
|
7
|
-
args: [--fix, --exit-non-zero-on-fix
|
|
7
|
+
args: [--fix, --exit-non-zero-on-fix]
|
|
8
8
|
types: [python]
|
|
9
9
|
- id: ruff-format
|
|
10
|
-
args: [--config=ruff.toml]
|
|
11
10
|
types: [python]
|
|
12
11
|
|
|
13
12
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mcp-use
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.13
|
|
4
4
|
Summary: MCP Library for LLMs
|
|
5
|
-
Author-email: Pietro Zullo <pietro.zullo@gmail.com>
|
|
5
|
+
Author-email: "mcp-use, Inc." <dev@mcp-use.io>, Pietro Zullo <pietro.zullo@gmail.com>
|
|
6
6
|
License: MIT
|
|
7
|
-
License-File: LICENSE
|
|
8
7
|
Classifier: Development Status :: 3 - Alpha
|
|
9
8
|
Classifier: Intended Audience :: Developers
|
|
10
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -17,10 +16,12 @@ Requires-Python: >=3.11
|
|
|
17
16
|
Requires-Dist: aiohttp>=3.9.0
|
|
18
17
|
Requires-Dist: authlib>=1.6.3
|
|
19
18
|
Requires-Dist: jsonschema-pydantic>=0.1.0
|
|
20
|
-
Requires-Dist: langchain
|
|
19
|
+
Requires-Dist: langchain-core==0.3.79
|
|
20
|
+
Requires-Dist: langchain==0.3.27
|
|
21
21
|
Requires-Dist: mcp>=1.10.0
|
|
22
22
|
Requires-Dist: posthog>=4.8.0
|
|
23
|
-
Requires-Dist: pydantic
|
|
23
|
+
Requires-Dist: pydantic-core==2.33.2
|
|
24
|
+
Requires-Dist: pydantic==2.11.10
|
|
24
25
|
Requires-Dist: python-dotenv>=1.0.0
|
|
25
26
|
Requires-Dist: scarf-sdk>=0.1.0
|
|
26
27
|
Requires-Dist: websockets>=15.0
|
|
@@ -53,8 +54,7 @@ Description-Content-Type: text/markdown
|
|
|
53
54
|
</picture>
|
|
54
55
|
</div>
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
<h1 align="center">🚀 Create MCP Clients and Agents</h1>
|
|
57
|
+
<h1 align="center">🚀 MCP-Use for Python</h1>
|
|
58
58
|
<p align="center">
|
|
59
59
|
<a href="https://github.com/pietrozullo/mcp-use/stargazers" alt="GitHub stars">
|
|
60
60
|
<img src="https://img.shields.io/github/stars/pietrozullo/mcp-use?style=social" /></a>
|
|
@@ -62,37 +62,42 @@ Description-Content-Type: text/markdown
|
|
|
62
62
|
<img src="https://static.pepy.tech/badge/mcp-use" /></a>
|
|
63
63
|
<a href="https://pypi.org/project/mcp_use/" alt="PyPI Version">
|
|
64
64
|
<img src="https://img.shields.io/pypi/v/mcp_use.svg"/></a>
|
|
65
|
-
<a href="https://github.com/mcp-use/mcp-use-ts" alt="TypeScript">
|
|
66
|
-
<img src="https://img.shields.io/badge/TypeScript-mcp--use-3178C6?logo=typescript&logoColor=white" /></a>
|
|
67
65
|
<a href="https://github.com/pietrozullo/mcp-use/blob/main/LICENSE" alt="License">
|
|
68
66
|
<img src="https://img.shields.io/github/license/pietrozullo/mcp-use" /></a>
|
|
69
67
|
<a href="https://docs.mcp-use.com" alt="Documentation">
|
|
70
68
|
<img src="https://img.shields.io/badge/docs-mcp--use.com-blue" /></a>
|
|
71
|
-
<a href="https://mcp-use.com" alt="Website">
|
|
72
|
-
<img src="https://img.shields.io/badge/website-mcp--use.com-blue" /></a>
|
|
73
|
-
</p>
|
|
74
|
-
<p align="center">
|
|
75
|
-
<a href="https://x.com/pietrozullo" alt="Twitter Follow - Pietro">
|
|
76
|
-
<img src="https://img.shields.io/twitter/follow/Pietro?style=social" /></a>
|
|
77
|
-
<a href="https://x.com/pederzh" alt="Twitter Follow - Luigi">
|
|
78
|
-
<img src="https://img.shields.io/twitter/follow/Luigi?style=social" /></a>
|
|
79
69
|
<a href="https://discord.gg/XkNkSkMz3V" alt="Discord">
|
|
80
70
|
<img src="https://dcbadge.limes.pink/api/server/XkNkSkMz3V?style=flat" /></a>
|
|
81
71
|
</p>
|
|
82
72
|
</div>
|
|
83
73
|
|
|
84
|
-
|
|
74
|
+
> **📦 Part of the [MCP-Use Monorepo](../../README.md)** - This is the Python implementation. Also available in [TypeScript](../typescript/README.md).
|
|
75
|
+
|
|
76
|
+
🌐 **MCP-Use for Python** is the complete way to connect **any LLM to any MCP server** and build custom MCP agents with tool access.
|
|
77
|
+
|
|
78
|
+
💡 Let your Python applications leverage the power of the Model Context Protocol with support for agents, clients, and advanced features.
|
|
79
|
+
|
|
80
|
+
## 🏗️ What's Included
|
|
81
|
+
|
|
82
|
+
MCP-Use for Python provides three main capabilities:
|
|
83
|
+
|
|
84
|
+
- **🤖 MCP Agent** - Build AI agents that can use tools and reason across multiple steps
|
|
85
|
+
- **🔌 MCP Client** - Connect directly to MCP servers for programmatic tool access
|
|
86
|
+
- **🛠️ MCP Server** - _Coming soon!_ For now, use the [TypeScript version](../typescript/README.md#%EF%B8%8F-mcp-server-framework)
|
|
85
87
|
|
|
86
|
-
|
|
88
|
+
---
|
|
87
89
|
|
|
88
|
-
|
|
89
|
-
- Visit the [mcp-use docs](https://docs.mcp-use.com/) to get started with mcp-use library
|
|
90
|
-
- For the TypeScript version, visit [mcp-use-ts](https://github.com/mcp-use/mcp-use-ts)
|
|
90
|
+
## 📖 Quick Links
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
- **[Main Repository](../../README.md)** - Overview of the entire MCP-Use ecosystem
|
|
93
|
+
- **[TypeScript Version](../typescript/README.md)** - TypeScript implementation with server framework
|
|
94
|
+
- **[Documentation](https://docs.mcp-use.com)** - Complete online documentation
|
|
95
|
+
- **[Examples](./examples/)** - Python code examples
|
|
96
|
+
|
|
97
|
+
| Supports | |
|
|
98
|
+
| :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
94
99
|
| **Primitives** | [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) |
|
|
95
|
-
| **Transports** | [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml)
|
|
100
|
+
| **Transports** | [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) |
|
|
96
101
|
|
|
97
102
|
## Features
|
|
98
103
|
|
|
@@ -139,7 +144,13 @@ Description-Content-Type: text/markdown
|
|
|
139
144
|
</tr>
|
|
140
145
|
</table>
|
|
141
146
|
|
|
142
|
-
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
# 🤖 MCP Agent
|
|
150
|
+
|
|
151
|
+
The **MCP Agent** is an AI-powered agent that can use tools from MCP servers to accomplish complex tasks. It reasons across multiple steps, selecting and executing tools as needed.
|
|
152
|
+
|
|
153
|
+
## Quick Start
|
|
143
154
|
|
|
144
155
|
With pip:
|
|
145
156
|
|
|
@@ -674,7 +685,13 @@ The `SandboxOptions` type provides configuration for the sandbox environment:
|
|
|
674
685
|
- **Consistent environment**: Ensure consistent behavior across different systems
|
|
675
686
|
- **Resource efficiency**: Offload resource-intensive tasks to cloud infrastructure
|
|
676
687
|
|
|
677
|
-
|
|
688
|
+
---
|
|
689
|
+
|
|
690
|
+
# 🔌 MCP Client
|
|
691
|
+
|
|
692
|
+
The **MCP Client** allows you to connect directly to MCP servers and call tools programmatically without an AI agent. This is useful when you know exactly which tools to call and don't need AI reasoning.
|
|
693
|
+
|
|
694
|
+
## Direct Tool Calls (Without LLM)
|
|
678
695
|
|
|
679
696
|
You can call MCP server tools directly without an LLM when you need programmatic control:
|
|
680
697
|
|
|
@@ -751,6 +768,23 @@ if __name__ == "__main__":
|
|
|
751
768
|
|
|
752
769
|
```
|
|
753
770
|
|
|
771
|
+
---
|
|
772
|
+
|
|
773
|
+
# 🛠️ MCP Server
|
|
774
|
+
|
|
775
|
+
**Coming Soon!** Python support for creating MCP servers is under development.
|
|
776
|
+
|
|
777
|
+
In the meantime, you can create MCP servers using our [TypeScript implementation](../typescript/README.md#%EF%B8%8F-mcp-server-framework), which offers:
|
|
778
|
+
|
|
779
|
+
- Complete server framework with tools, resources, and prompts
|
|
780
|
+
- Built-in inspector for debugging
|
|
781
|
+
- React-based UI widgets for interactive experiences
|
|
782
|
+
- Hot reload development workflow
|
|
783
|
+
|
|
784
|
+
Python agents and clients can connect to TypeScript servers seamlessly - the MCP protocol is language-agnostic.
|
|
785
|
+
|
|
786
|
+
---
|
|
787
|
+
|
|
754
788
|
# Debugging
|
|
755
789
|
|
|
756
790
|
MCP-Use provides a built-in debug mode that increases log verbosity and helps diagnose issues in your agent implementation.
|
|
@@ -814,14 +848,6 @@ This is useful when you only need to see the agent's steps and decision-making p
|
|
|
814
848
|
|
|
815
849
|
We love contributions! Feel free to open issues for bugs or feature requests. Look at [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
816
850
|
|
|
817
|
-
## Contributors
|
|
818
|
-
|
|
819
|
-
Thanks to all our amazing contributors!
|
|
820
|
-
|
|
821
|
-
<a href="https://github.com/mcp-use/mcp-use/graphs/contributors">
|
|
822
|
-
<img src="https://contrib.rocks/image?repo=mcp-use/mcp-use" />
|
|
823
|
-
</a>
|
|
824
|
-
|
|
825
851
|
## Top Starred Dependents
|
|
826
852
|
|
|
827
853
|
<!-- gh-dependents-info-used-by-start -->
|
|
@@ -833,23 +859,23 @@ Thanks to all our amazing contributors!
|
|
|
833
859
|
</tr>
|
|
834
860
|
<tr>
|
|
835
861
|
<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>
|
|
836
|
-
<td>⭐
|
|
862
|
+
<td>⭐ 18021</td>
|
|
837
863
|
</tr>
|
|
838
864
|
<tr>
|
|
839
865
|
<td><img src="https://avatars.githubusercontent.com/u/164294848?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/buildfastwithai/gen-ai-experiments"><strong>buildfastwithai/gen-ai-experiments</strong></a></td>
|
|
840
|
-
<td>⭐
|
|
866
|
+
<td>⭐ 202</td>
|
|
841
867
|
</tr>
|
|
842
868
|
<tr>
|
|
843
869
|
<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-python"><strong>hud-evals/hud-python</strong></a></td>
|
|
844
|
-
<td>⭐
|
|
870
|
+
<td>⭐ 168</td>
|
|
845
871
|
</tr>
|
|
846
872
|
<tr>
|
|
847
873
|
<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>
|
|
848
|
-
<td>⭐
|
|
874
|
+
<td>⭐ 138</td>
|
|
849
875
|
</tr>
|
|
850
876
|
<tr>
|
|
851
877
|
<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>
|
|
852
|
-
<td>⭐
|
|
878
|
+
<td>⭐ 74</td>
|
|
853
879
|
</tr>
|
|
854
880
|
<tr>
|
|
855
881
|
<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>
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
</picture>
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
<h1 align="center">🚀 Create MCP Clients and Agents</h1>
|
|
10
|
+
<h1 align="center">🚀 MCP-Use for Python</h1>
|
|
12
11
|
<p align="center">
|
|
13
12
|
<a href="https://github.com/pietrozullo/mcp-use/stargazers" alt="GitHub stars">
|
|
14
13
|
<img src="https://img.shields.io/github/stars/pietrozullo/mcp-use?style=social" /></a>
|
|
@@ -16,37 +15,42 @@
|
|
|
16
15
|
<img src="https://static.pepy.tech/badge/mcp-use" /></a>
|
|
17
16
|
<a href="https://pypi.org/project/mcp_use/" alt="PyPI Version">
|
|
18
17
|
<img src="https://img.shields.io/pypi/v/mcp_use.svg"/></a>
|
|
19
|
-
<a href="https://github.com/mcp-use/mcp-use-ts" alt="TypeScript">
|
|
20
|
-
<img src="https://img.shields.io/badge/TypeScript-mcp--use-3178C6?logo=typescript&logoColor=white" /></a>
|
|
21
18
|
<a href="https://github.com/pietrozullo/mcp-use/blob/main/LICENSE" alt="License">
|
|
22
19
|
<img src="https://img.shields.io/github/license/pietrozullo/mcp-use" /></a>
|
|
23
20
|
<a href="https://docs.mcp-use.com" alt="Documentation">
|
|
24
21
|
<img src="https://img.shields.io/badge/docs-mcp--use.com-blue" /></a>
|
|
25
|
-
<a href="https://mcp-use.com" alt="Website">
|
|
26
|
-
<img src="https://img.shields.io/badge/website-mcp--use.com-blue" /></a>
|
|
27
|
-
</p>
|
|
28
|
-
<p align="center">
|
|
29
|
-
<a href="https://x.com/pietrozullo" alt="Twitter Follow - Pietro">
|
|
30
|
-
<img src="https://img.shields.io/twitter/follow/Pietro?style=social" /></a>
|
|
31
|
-
<a href="https://x.com/pederzh" alt="Twitter Follow - Luigi">
|
|
32
|
-
<img src="https://img.shields.io/twitter/follow/Luigi?style=social" /></a>
|
|
33
22
|
<a href="https://discord.gg/XkNkSkMz3V" alt="Discord">
|
|
34
23
|
<img src="https://dcbadge.limes.pink/api/server/XkNkSkMz3V?style=flat" /></a>
|
|
35
24
|
</p>
|
|
36
25
|
</div>
|
|
37
26
|
|
|
38
|
-
|
|
27
|
+
> **📦 Part of the [MCP-Use Monorepo](../../README.md)** - This is the Python implementation. Also available in [TypeScript](../typescript/README.md).
|
|
28
|
+
|
|
29
|
+
🌐 **MCP-Use for Python** is the complete way to connect **any LLM to any MCP server** and build custom MCP agents with tool access.
|
|
30
|
+
|
|
31
|
+
💡 Let your Python applications leverage the power of the Model Context Protocol with support for agents, clients, and advanced features.
|
|
32
|
+
|
|
33
|
+
## 🏗️ What's Included
|
|
34
|
+
|
|
35
|
+
MCP-Use for Python provides three main capabilities:
|
|
36
|
+
|
|
37
|
+
- **🤖 MCP Agent** - Build AI agents that can use tools and reason across multiple steps
|
|
38
|
+
- **🔌 MCP Client** - Connect directly to MCP servers for programmatic tool access
|
|
39
|
+
- **🛠️ MCP Server** - _Coming soon!_ For now, use the [TypeScript version](../typescript/README.md#%EF%B8%8F-mcp-server-framework)
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
---
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
- Visit the [mcp-use docs](https://docs.mcp-use.com/) to get started with mcp-use library
|
|
44
|
-
- For the TypeScript version, visit [mcp-use-ts](https://github.com/mcp-use/mcp-use-ts)
|
|
43
|
+
## 📖 Quick Links
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
- **[Main Repository](../../README.md)** - Overview of the entire MCP-Use ecosystem
|
|
46
|
+
- **[TypeScript Version](../typescript/README.md)** - TypeScript implementation with server framework
|
|
47
|
+
- **[Documentation](https://docs.mcp-use.com)** - Complete online documentation
|
|
48
|
+
- **[Examples](./examples/)** - Python code examples
|
|
49
|
+
|
|
50
|
+
| Supports | |
|
|
51
|
+
| :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
48
52
|
| **Primitives** | [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) |
|
|
49
|
-
| **Transports** | [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml)
|
|
53
|
+
| **Transports** | [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) |
|
|
50
54
|
|
|
51
55
|
## Features
|
|
52
56
|
|
|
@@ -93,7 +97,13 @@
|
|
|
93
97
|
</tr>
|
|
94
98
|
</table>
|
|
95
99
|
|
|
96
|
-
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
# 🤖 MCP Agent
|
|
103
|
+
|
|
104
|
+
The **MCP Agent** is an AI-powered agent that can use tools from MCP servers to accomplish complex tasks. It reasons across multiple steps, selecting and executing tools as needed.
|
|
105
|
+
|
|
106
|
+
## Quick Start
|
|
97
107
|
|
|
98
108
|
With pip:
|
|
99
109
|
|
|
@@ -628,7 +638,13 @@ The `SandboxOptions` type provides configuration for the sandbox environment:
|
|
|
628
638
|
- **Consistent environment**: Ensure consistent behavior across different systems
|
|
629
639
|
- **Resource efficiency**: Offload resource-intensive tasks to cloud infrastructure
|
|
630
640
|
|
|
631
|
-
|
|
641
|
+
---
|
|
642
|
+
|
|
643
|
+
# 🔌 MCP Client
|
|
644
|
+
|
|
645
|
+
The **MCP Client** allows you to connect directly to MCP servers and call tools programmatically without an AI agent. This is useful when you know exactly which tools to call and don't need AI reasoning.
|
|
646
|
+
|
|
647
|
+
## Direct Tool Calls (Without LLM)
|
|
632
648
|
|
|
633
649
|
You can call MCP server tools directly without an LLM when you need programmatic control:
|
|
634
650
|
|
|
@@ -705,6 +721,23 @@ if __name__ == "__main__":
|
|
|
705
721
|
|
|
706
722
|
```
|
|
707
723
|
|
|
724
|
+
---
|
|
725
|
+
|
|
726
|
+
# 🛠️ MCP Server
|
|
727
|
+
|
|
728
|
+
**Coming Soon!** Python support for creating MCP servers is under development.
|
|
729
|
+
|
|
730
|
+
In the meantime, you can create MCP servers using our [TypeScript implementation](../typescript/README.md#%EF%B8%8F-mcp-server-framework), which offers:
|
|
731
|
+
|
|
732
|
+
- Complete server framework with tools, resources, and prompts
|
|
733
|
+
- Built-in inspector for debugging
|
|
734
|
+
- React-based UI widgets for interactive experiences
|
|
735
|
+
- Hot reload development workflow
|
|
736
|
+
|
|
737
|
+
Python agents and clients can connect to TypeScript servers seamlessly - the MCP protocol is language-agnostic.
|
|
738
|
+
|
|
739
|
+
---
|
|
740
|
+
|
|
708
741
|
# Debugging
|
|
709
742
|
|
|
710
743
|
MCP-Use provides a built-in debug mode that increases log verbosity and helps diagnose issues in your agent implementation.
|
|
@@ -768,14 +801,6 @@ This is useful when you only need to see the agent's steps and decision-making p
|
|
|
768
801
|
|
|
769
802
|
We love contributions! Feel free to open issues for bugs or feature requests. Look at [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
770
803
|
|
|
771
|
-
## Contributors
|
|
772
|
-
|
|
773
|
-
Thanks to all our amazing contributors!
|
|
774
|
-
|
|
775
|
-
<a href="https://github.com/mcp-use/mcp-use/graphs/contributors">
|
|
776
|
-
<img src="https://contrib.rocks/image?repo=mcp-use/mcp-use" />
|
|
777
|
-
</a>
|
|
778
|
-
|
|
779
804
|
## Top Starred Dependents
|
|
780
805
|
|
|
781
806
|
<!-- gh-dependents-info-used-by-start -->
|
|
@@ -787,23 +812,23 @@ Thanks to all our amazing contributors!
|
|
|
787
812
|
</tr>
|
|
788
813
|
<tr>
|
|
789
814
|
<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>
|
|
790
|
-
<td>⭐
|
|
815
|
+
<td>⭐ 18021</td>
|
|
791
816
|
</tr>
|
|
792
817
|
<tr>
|
|
793
818
|
<td><img src="https://avatars.githubusercontent.com/u/164294848?s=40&v=4" width="20" height="20" style="vertical-align: middle; margin-right: 8px;"> <a href="https://github.com/buildfastwithai/gen-ai-experiments"><strong>buildfastwithai/gen-ai-experiments</strong></a></td>
|
|
794
|
-
<td>⭐
|
|
819
|
+
<td>⭐ 202</td>
|
|
795
820
|
</tr>
|
|
796
821
|
<tr>
|
|
797
822
|
<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-python"><strong>hud-evals/hud-python</strong></a></td>
|
|
798
|
-
<td>⭐
|
|
823
|
+
<td>⭐ 168</td>
|
|
799
824
|
</tr>
|
|
800
825
|
<tr>
|
|
801
826
|
<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>
|
|
802
|
-
<td>⭐
|
|
827
|
+
<td>⭐ 138</td>
|
|
803
828
|
</tr>
|
|
804
829
|
<tr>
|
|
805
830
|
<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>
|
|
806
|
-
<td>⭐
|
|
831
|
+
<td>⭐ 74</td>
|
|
807
832
|
</tr>
|
|
808
833
|
<tr>
|
|
809
834
|
<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>
|
|
@@ -20,13 +20,11 @@ async def run_memory_chat():
|
|
|
20
20
|
# Load environment variables for API keys
|
|
21
21
|
load_dotenv()
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
# Create MCP client and agent with memory enabled
|
|
29
|
-
client = MCPClient.from_config_file(config_file)
|
|
23
|
+
config = {
|
|
24
|
+
"mcpServers": {"playwright": {"command": "npx", "args": ["@playwright/mcp@latest"], "env": {"DISPLAY": ":1"}}}
|
|
25
|
+
}
|
|
26
|
+
# Create MCPClient from config file
|
|
27
|
+
client = MCPClient(config=config)
|
|
30
28
|
llm = ChatOpenAI(model="gpt-4o-mini")
|
|
31
29
|
|
|
32
30
|
# Create agent with memory_enabled=True
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Simple middleware example.
|
|
3
|
+
|
|
4
|
+
This example demonstrates:
|
|
5
|
+
1. How to use mcp_use with MCPClient and MCPAgent
|
|
6
|
+
2. Default logging middleware (uses logger.debug)
|
|
7
|
+
3. Optional custom middleware for specific use cases
|
|
8
|
+
|
|
9
|
+
Special thanks to https://github.com/microsoft/playwright-mcp for the server.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import asyncio
|
|
13
|
+
import time
|
|
14
|
+
from typing import Any
|
|
15
|
+
|
|
16
|
+
from dotenv import load_dotenv
|
|
17
|
+
from langchain_openai import ChatOpenAI
|
|
18
|
+
|
|
19
|
+
from mcp_use import MCPAgent, MCPClient
|
|
20
|
+
from mcp_use.middleware import Middleware, MiddlewareContext, NextFunctionT
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
async def main():
|
|
24
|
+
"""Run the example with default logging and optional custom middleware."""
|
|
25
|
+
# Load environment variables
|
|
26
|
+
load_dotenv()
|
|
27
|
+
|
|
28
|
+
# Create custom middleware
|
|
29
|
+
class TimingMiddleware(Middleware):
|
|
30
|
+
async def on_request(self, context: MiddlewareContext[Any], call_next: NextFunctionT) -> Any:
|
|
31
|
+
start = time.time()
|
|
32
|
+
try:
|
|
33
|
+
print("--------------------------------")
|
|
34
|
+
print(f"{context.method} started")
|
|
35
|
+
print("--------------------------------")
|
|
36
|
+
print(f"{context.params}, {context.metadata}, {context.timestamp}, {context.connection_id}")
|
|
37
|
+
print("--------------------------------")
|
|
38
|
+
result = await call_next(context)
|
|
39
|
+
return result
|
|
40
|
+
finally:
|
|
41
|
+
duration = time.time() - start
|
|
42
|
+
print("--------------------------------")
|
|
43
|
+
print(f"{context.method} took {int(1000 * duration)}ms")
|
|
44
|
+
print("--------------------------------")
|
|
45
|
+
|
|
46
|
+
config = {
|
|
47
|
+
"mcpServers": {"playwright": {"command": "npx", "args": ["@playwright/mcp@latest"], "env": {"DISPLAY": ":1"}}}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
# MCPClient includes default logging middleware automatically
|
|
51
|
+
# Add custom middleware only if needed
|
|
52
|
+
client = MCPClient(config=config, middleware=[TimingMiddleware()])
|
|
53
|
+
|
|
54
|
+
# Create LLM
|
|
55
|
+
llm = ChatOpenAI(model="gpt-4o")
|
|
56
|
+
|
|
57
|
+
# Create agent with the client
|
|
58
|
+
agent = MCPAgent(llm=llm, client=client, max_steps=30)
|
|
59
|
+
|
|
60
|
+
# Run the query
|
|
61
|
+
result = await agent.run(
|
|
62
|
+
"""
|
|
63
|
+
Navigate to https://github.com/mcp-use/mcp-use and write
|
|
64
|
+
a summary of the project.
|
|
65
|
+
""",
|
|
66
|
+
max_steps=30,
|
|
67
|
+
)
|
|
68
|
+
print(f"\nResult: {result}")
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
if __name__ == "__main__":
|
|
72
|
+
asyncio.run(main())
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Simple chat example using MCPAgent with limited conversation memory.
|
|
3
|
+
|
|
4
|
+
This example demonstrates how to use the MCPAgent with limited
|
|
5
|
+
conversation history for better contextual interactions while
|
|
6
|
+
keeping memory usage controlled.
|
|
7
|
+
|
|
8
|
+
Special thanks to https://github.com/microsoft/playwright-mcp for the server.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import asyncio
|
|
12
|
+
|
|
13
|
+
from dotenv import load_dotenv
|
|
14
|
+
from langchain_core.messages import AIMessage, HumanMessage
|
|
15
|
+
from langchain_openai import ChatOpenAI
|
|
16
|
+
|
|
17
|
+
from mcp_use import MCPAgent, MCPClient
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
async def run_limited_memory_chat():
|
|
21
|
+
"""Run a chat using MCPAgent with limited conversation memory."""
|
|
22
|
+
# Load environment variables for API keys
|
|
23
|
+
load_dotenv()
|
|
24
|
+
|
|
25
|
+
config = {
|
|
26
|
+
"mcpServers": {"playwright": {"command": "npx", "args": ["@playwright/mcp@latest"], "env": {"DISPLAY": ":1"}}}
|
|
27
|
+
}
|
|
28
|
+
# Create MCPClient from config file
|
|
29
|
+
client = MCPClient(config=config)
|
|
30
|
+
llm = ChatOpenAI(model="gpt-4o-mini")
|
|
31
|
+
# Create agent with memory_enabled=False but pass external history
|
|
32
|
+
agent = MCPAgent(
|
|
33
|
+
llm=llm,
|
|
34
|
+
client=client,
|
|
35
|
+
max_steps=15,
|
|
36
|
+
memory_enabled=True, # Disable built-in memory, use external history
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
# Configuration: Limited history mode
|
|
40
|
+
MAX_HISTORY_MESSAGES = 5
|
|
41
|
+
|
|
42
|
+
print("\n===== Interactive MCP Chat (Limited Memory) =====")
|
|
43
|
+
print("Type 'exit' or 'quit' to end the conversation")
|
|
44
|
+
print("Type 'clear' to clear conversation history")
|
|
45
|
+
print("==================================\n")
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
# Main chat loop with limited history
|
|
49
|
+
external_history = []
|
|
50
|
+
|
|
51
|
+
while True:
|
|
52
|
+
# Get user input
|
|
53
|
+
user_input = input("\nYou: ")
|
|
54
|
+
|
|
55
|
+
# Check for exit command
|
|
56
|
+
if user_input.lower() in ["exit", "quit"]:
|
|
57
|
+
print("Ending conversation...")
|
|
58
|
+
break
|
|
59
|
+
|
|
60
|
+
# Check for clear history command
|
|
61
|
+
if user_input.lower() == "clear":
|
|
62
|
+
external_history = []
|
|
63
|
+
print("Conversation history cleared.")
|
|
64
|
+
continue
|
|
65
|
+
|
|
66
|
+
# Get response from agent
|
|
67
|
+
try:
|
|
68
|
+
# Limit history to last N messages
|
|
69
|
+
limited_history = external_history[-MAX_HISTORY_MESSAGES:] if external_history else []
|
|
70
|
+
# Run the agent with the user input and limited history
|
|
71
|
+
print("\nAssistant: ", end="", flush=True)
|
|
72
|
+
response = await agent.run(user_input, external_history=limited_history)
|
|
73
|
+
print(response)
|
|
74
|
+
# Add to external history
|
|
75
|
+
external_history.append(HumanMessage(content=user_input))
|
|
76
|
+
external_history.append(AIMessage(content=response))
|
|
77
|
+
|
|
78
|
+
except Exception as e:
|
|
79
|
+
print(f"\nError: {e}")
|
|
80
|
+
|
|
81
|
+
finally:
|
|
82
|
+
# Clean up
|
|
83
|
+
if client and client.sessions:
|
|
84
|
+
await client.close_all_sessions()
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
if __name__ == "__main__":
|
|
88
|
+
asyncio.run(run_limited_memory_chat())
|
|
@@ -12,7 +12,7 @@ from importlib.metadata import version
|
|
|
12
12
|
from .logging import MCP_USE_DEBUG, Logger, logger # isort: skip
|
|
13
13
|
|
|
14
14
|
# Now import other modules - observability must come after logging
|
|
15
|
-
from . import observability # noqa: E402
|
|
15
|
+
from .agents import observability # noqa: E402
|
|
16
16
|
from .agents.mcpagent import MCPAgent
|
|
17
17
|
from .client import MCPClient
|
|
18
18
|
from .config import load_config_file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# mcp_use/adapters/__init__.py
|
|
2
|
+
import warnings
|
|
3
|
+
|
|
4
|
+
from typing_extensions import deprecated
|
|
5
|
+
|
|
6
|
+
from mcp_use.agents.adapters import BaseAdapter as _BaseAdapter
|
|
7
|
+
from mcp_use.agents.adapters import LangChainAdapter as _LangChainAdapter
|
|
8
|
+
|
|
9
|
+
warnings.warn(
|
|
10
|
+
"mcp_use.adapters is deprecated. Use mcp_use.agents.adapters. This import will be removed in version 1.4.0",
|
|
11
|
+
DeprecationWarning,
|
|
12
|
+
stacklevel=2,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@deprecated("Use mcp_use.agents.adapters.BaseAdapter")
|
|
17
|
+
class BaseAdapter(_BaseAdapter): ...
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@deprecated("Use mcp_use.agents.adapters.LangChainAdapter")
|
|
21
|
+
class LangChainAdapter(_LangChainAdapter): ...
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# mcp_use/adapters/base.py
|
|
2
|
+
import warnings
|
|
3
|
+
|
|
4
|
+
from typing_extensions import deprecated
|
|
5
|
+
|
|
6
|
+
from mcp_use.agents.adapters.base import BaseAdapter as _BaseAdapter
|
|
7
|
+
|
|
8
|
+
warnings.warn(
|
|
9
|
+
"mcp_use.adapters.base is deprecated. Use mcp_use.agents.adapters.base. "
|
|
10
|
+
"This import will be removed in version 1.4.0",
|
|
11
|
+
DeprecationWarning,
|
|
12
|
+
stacklevel=2,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@deprecated("Use mcp_use.agents.adapters.base.BaseAdapter")
|
|
17
|
+
class BaseAdapter(_BaseAdapter): ...
|