mcp-use 1.3.12__tar.gz → 1.4.0__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.12 → mcp_use-1.4.0}/.pre-commit-config.yaml +1 -2
- {mcp_use-1.3.12 → mcp_use-1.4.0}/PKG-INFO +68 -43
- {mcp_use-1.3.12 → mcp_use-1.4.0}/README.md +64 -39
- mcp_use-1.4.0/examples/anthropic_integration_example.py +114 -0
- mcp_use-1.4.0/examples/google_integration_example.py +138 -0
- mcp_use-1.4.0/examples/openai_integration_example.py +92 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/stream_example.py +14 -5
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/__init__.py +1 -1
- mcp_use-1.4.0/mcp_use/adapters/__init__.py +21 -0
- mcp_use-1.4.0/mcp_use/adapters/base.py +17 -0
- mcp_use-1.4.0/mcp_use/adapters/langchain_adapter.py +18 -0
- mcp_use-1.4.0/mcp_use/agents/adapters/__init__.py +17 -0
- mcp_use-1.4.0/mcp_use/agents/adapters/anthropic.py +93 -0
- mcp_use-1.4.0/mcp_use/agents/adapters/base.py +316 -0
- mcp_use-1.4.0/mcp_use/agents/adapters/google.py +103 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/adapters/langchain_adapter.py +12 -25
- mcp_use-1.4.0/mcp_use/agents/adapters/openai.py +111 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/agents/base.py +1 -1
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/server_manager.py +11 -4
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/connect_server.py +1 -2
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/disconnect_server.py +1 -2
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/get_active_server.py +1 -1
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/list_servers_tool.py +1 -2
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/search_tools.py +2 -2
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/agents/mcpagent.py +386 -485
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/agents/prompts/system_prompt_builder.py +1 -1
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/agents/remote.py +15 -2
- mcp_use-1.4.0/mcp_use/auth/__init__.py +21 -0
- mcp_use-1.4.0/mcp_use/auth/bearer.py +16 -0
- mcp_use-1.4.0/mcp_use/auth/oauth.py +16 -0
- mcp_use-1.4.0/mcp_use/auth/oauth_callback.py +23 -0
- mcp_use-1.4.0/mcp_use/client/__init__.py +1 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/auth/bearer.py +6 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/auth/oauth.py +8 -4
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/auth/oauth_callback.py +4 -3
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/client.py +12 -6
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/config.py +7 -5
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/base.py +13 -4
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/http.py +5 -6
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/sandbox.py +25 -4
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/stdio.py +4 -4
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/websocket.py +3 -3
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/middleware/logging.py +2 -2
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/middleware/metrics.py +1 -1
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/middleware/middleware.py +4 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/session.py +9 -1
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/task_managers/base.py +1 -1
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/task_managers/sse.py +2 -2
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/task_managers/stdio.py +2 -2
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/task_managers/streamable_http.py +2 -2
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/task_managers/websocket.py +2 -2
- mcp_use-1.4.0/mcp_use/client.py +18 -0
- mcp_use-1.4.0/mcp_use/config.py +27 -0
- mcp_use-1.4.0/mcp_use/connectors/.deprecated +0 -0
- mcp_use-1.4.0/mcp_use/connectors/__init__.py +46 -0
- mcp_use-1.4.0/mcp_use/connectors/base.py +18 -0
- mcp_use-1.4.0/mcp_use/connectors/http.py +18 -0
- mcp_use-1.4.0/mcp_use/connectors/sandbox.py +18 -0
- mcp_use-1.4.0/mcp_use/connectors/stdio.py +18 -0
- mcp_use-1.4.0/mcp_use/connectors/utils.py +20 -0
- mcp_use-1.4.0/mcp_use/connectors/websocket.py +18 -0
- mcp_use-1.4.0/mcp_use/exceptions.py +46 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/logging.py +1 -1
- mcp_use-1.4.0/mcp_use/managers/.deprecated +0 -0
- mcp_use-1.4.0/mcp_use/managers/__init__.py +58 -0
- mcp_use-1.4.0/mcp_use/managers/base.py +18 -0
- mcp_use-1.4.0/mcp_use/managers/server_manager.py +18 -0
- mcp_use-1.4.0/mcp_use/managers/tools/__init__.py +45 -0
- mcp_use-1.4.0/mcp_use/managers/tools/base_tool.py +8 -0
- mcp_use-1.4.0/mcp_use/managers/tools/connect_server.py +8 -0
- mcp_use-1.4.0/mcp_use/managers/tools/disconnect_server.py +8 -0
- mcp_use-1.4.0/mcp_use/managers/tools/get_active_server.py +8 -0
- mcp_use-1.4.0/mcp_use/managers/tools/list_servers_tool.py +8 -0
- mcp_use-1.4.0/mcp_use/managers/tools/search_tools.py +24 -0
- mcp_use-1.4.0/mcp_use/middleware/.deprecated +0 -0
- mcp_use-1.4.0/mcp_use/middleware/__init__.py +89 -0
- mcp_use-1.4.0/mcp_use/middleware/logging.py +19 -0
- mcp_use-1.4.0/mcp_use/middleware/metrics.py +41 -0
- mcp_use-1.4.0/mcp_use/middleware/middleware.py +55 -0
- mcp_use-1.4.0/mcp_use/session.py +18 -0
- mcp_use-1.4.0/mcp_use/task_managers/.deprecated +0 -0
- mcp_use-1.4.0/mcp_use/task_managers/__init__.py +48 -0
- mcp_use-1.4.0/mcp_use/task_managers/base.py +18 -0
- mcp_use-1.4.0/mcp_use/task_managers/sse.py +18 -0
- mcp_use-1.4.0/mcp_use/task_managers/stdio.py +18 -0
- mcp_use-1.4.0/mcp_use/task_managers/streamable_http.py +20 -0
- mcp_use-1.4.0/mcp_use/task_managers/websocket.py +18 -0
- mcp_use-1.4.0/mcp_use/telemetry/__init__.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/telemetry/events.py +58 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/telemetry/telemetry.py +71 -1
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/telemetry/utils.py +1 -1
- mcp_use-1.4.0/mcp_use/types/.deprecated +0 -0
- mcp_use-1.4.0/mcp_use/types/sandbox.py +18 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/pyproject.toml +4 -2
- mcp_use-1.4.0/tests/integration/agent/test_agent_run.py +47 -0
- mcp_use-1.4.0/tests/integration/agent/test_agent_stream.py +84 -0
- mcp_use-1.4.0/tests/integration/agent/test_agent_structured_output.py +63 -0
- mcp_use-1.4.0/tests/integration/agent/test_server_manager.py +118 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_auth.py +7 -7
- mcp_use-1.4.0/tests/unit/backward_compatibility.py +104 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_agent.py +20 -19
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_client.py +15 -10
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_config.py +4 -4
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_http_connector.py +15 -15
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_sandbox_connector.py +14 -15
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_search_tools_issue_138.py +4 -4
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_stdio_connector.py +12 -12
- mcp_use-1.3.12/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- mcp_use-1.3.12/.github/pull_request_template.md +0 -43
- mcp_use-1.3.12/.github/release-drafter.yml +0 -32
- mcp_use-1.3.12/.github/workflows/docs.yml +0 -108
- mcp_use-1.3.12/.github/workflows/publish.yml +0 -81
- mcp_use-1.3.12/.github/workflows/release-drafter.yml +0 -41
- mcp_use-1.3.12/.github/workflows/stale.yml +0 -18
- mcp_use-1.3.12/.github/workflows/tests.yml +0 -115
- mcp_use-1.3.12/.github/workflows/update-readme.yml +0 -112
- mcp_use-1.3.12/CODE_OF_CONDUCT.md +0 -128
- mcp_use-1.3.12/CONTRIBUTING.md +0 -146
- mcp_use-1.3.12/LICENSE +0 -21
- mcp_use-1.3.12/docs/README.md +0 -32
- mcp_use-1.3.12/docs/advanced/building-custom-agents.mdx +0 -309
- mcp_use-1.3.12/docs/advanced/logging.mdx +0 -186
- mcp_use-1.3.12/docs/advanced/multi-server-setup.mdx +0 -695
- mcp_use-1.3.12/docs/advanced/security.mdx +0 -667
- mcp_use-1.3.12/docs/agent/agent-configuration.mdx +0 -651
- mcp_use-1.3.12/docs/agent/interactive-chat-patterns.mdx +0 -569
- mcp_use-1.3.12/docs/agent/llm-integration.mdx +0 -317
- mcp_use-1.3.12/docs/agent/memory-management.mdx +0 -137
- mcp_use-1.3.12/docs/agent/server-manager.mdx +0 -385
- mcp_use-1.3.12/docs/agent/streaming.mdx +0 -376
- mcp_use-1.3.12/docs/agent/structured-output.mdx +0 -104
- mcp_use-1.3.12/docs/api-reference/mcp_use_adapters_base.mdx +0 -102
- mcp_use-1.3.12/docs/api-reference/mcp_use_adapters_langchain_adapter.mdx +0 -68
- mcp_use-1.3.12/docs/api-reference/mcp_use_agents_base.mdx +0 -109
- mcp_use-1.3.12/docs/api-reference/mcp_use_agents_mcpagent.mdx +0 -333
- mcp_use-1.3.12/docs/api-reference/mcp_use_agents_prompts_system_prompt_builder.mdx +0 -115
- mcp_use-1.3.12/docs/api-reference/mcp_use_agents_prompts_templates.mdx +0 -12
- mcp_use-1.3.12/docs/api-reference/mcp_use_agents_remote.mdx +0 -118
- mcp_use-1.3.12/docs/api-reference/mcp_use_auth_bearer.mdx +0 -57
- mcp_use-1.3.12/docs/api-reference/mcp_use_auth_oauth.mdx +0 -432
- mcp_use-1.3.12/docs/api-reference/mcp_use_auth_oauth_callback.mdx +0 -138
- mcp_use-1.3.12/docs/api-reference/mcp_use_cli.mdx +0 -322
- mcp_use-1.3.12/docs/api-reference/mcp_use_client.mdx +0 -256
- mcp_use-1.3.12/docs/api-reference/mcp_use_config.mdx +0 -84
- mcp_use-1.3.12/docs/api-reference/mcp_use_connectors_base.mdx +0 -345
- mcp_use-1.3.12/docs/api-reference/mcp_use_connectors_http.mdx +0 -61
- mcp_use-1.3.12/docs/api-reference/mcp_use_connectors_sandbox.mdx +0 -83
- mcp_use-1.3.12/docs/api-reference/mcp_use_connectors_stdio.mdx +0 -61
- mcp_use-1.3.12/docs/api-reference/mcp_use_connectors_utils.mdx +0 -37
- mcp_use-1.3.12/docs/api-reference/mcp_use_connectors_websocket.mdx +0 -54
- mcp_use-1.3.12/docs/api-reference/mcp_use_errors_error_formatting.mdx +0 -38
- mcp_use-1.3.12/docs/api-reference/mcp_use_exceptions.mdx +0 -174
- mcp_use-1.3.12/docs/api-reference/mcp_use_logging.mdx +0 -37
- mcp_use-1.3.12/docs/api-reference/mcp_use_managers_base.mdx +0 -81
- mcp_use-1.3.12/docs/api-reference/mcp_use_managers_server_manager.mdx +0 -82
- mcp_use-1.3.12/docs/api-reference/mcp_use_managers_tools_base_tool.mdx +0 -62
- mcp_use-1.3.12/docs/api-reference/mcp_use_managers_tools_connect_server.mdx +0 -95
- mcp_use-1.3.12/docs/api-reference/mcp_use_managers_tools_disconnect_server.mdx +0 -88
- mcp_use-1.3.12/docs/api-reference/mcp_use_managers_tools_get_active_server.mdx +0 -88
- mcp_use-1.3.12/docs/api-reference/mcp_use_managers_tools_list_servers_tool.mdx +0 -88
- mcp_use-1.3.12/docs/api-reference/mcp_use_managers_tools_search_tools.mdx +0 -203
- mcp_use-1.3.12/docs/api-reference/mcp_use_middleware_logging.mdx +0 -33
- mcp_use-1.3.12/docs/api-reference/mcp_use_middleware_metrics.mdx +0 -185
- mcp_use-1.3.12/docs/api-reference/mcp_use_middleware_middleware.mdx +0 -595
- mcp_use-1.3.12/docs/api-reference/mcp_use_observability_callbacks_manager.mdx +0 -180
- mcp_use-1.3.12/docs/api-reference/mcp_use_observability_laminar.mdx +0 -16
- mcp_use-1.3.12/docs/api-reference/mcp_use_observability_langfuse.mdx +0 -12
- mcp_use-1.3.12/docs/api-reference/mcp_use_session.mdx +0 -232
- mcp_use-1.3.12/docs/api-reference/mcp_use_task_managers_base.mdx +0 -95
- mcp_use-1.3.12/docs/api-reference/mcp_use_task_managers_sse.mdx +0 -57
- mcp_use-1.3.12/docs/api-reference/mcp_use_task_managers_stdio.mdx +0 -54
- mcp_use-1.3.12/docs/api-reference/mcp_use_task_managers_streamable_http.mdx +0 -57
- mcp_use-1.3.12/docs/api-reference/mcp_use_task_managers_websocket.mdx +0 -52
- mcp_use-1.3.12/docs/api-reference/mcp_use_types_sandbox.mdx +0 -58
- mcp_use-1.3.12/docs/api-reference/mcp_use_utils.mdx +0 -44
- mcp_use-1.3.12/docs/blog/middleware.mdx +0 -136
- mcp_use-1.3.12/docs/changelog/1_3_11.mdx +0 -73
- mcp_use-1.3.12/docs/changelog/1_3_12.mdx +0 -85
- mcp_use-1.3.12/docs/changelog/changelog.mdx +0 -82
- mcp_use-1.3.12/docs/client/authentication.mdx +0 -487
- mcp_use-1.3.12/docs/client/client-configuration.mdx +0 -211
- mcp_use-1.3.12/docs/client/connection-types.mdx +0 -141
- mcp_use-1.3.12/docs/client/direct-tool-calls.mdx +0 -420
- mcp_use-1.3.12/docs/client/elicitation.mdx +0 -401
- mcp_use-1.3.12/docs/client/logging.mdx +0 -96
- mcp_use-1.3.12/docs/client/middleware.mdx +0 -294
- mcp_use-1.3.12/docs/client/notifications.mdx +0 -138
- mcp_use-1.3.12/docs/client/prompts.mdx +0 -485
- mcp_use-1.3.12/docs/client/resources.mdx +0 -411
- mcp_use-1.3.12/docs/client/sampling.mdx +0 -122
- mcp_use-1.3.12/docs/client/sandbox.mdx +0 -122
- mcp_use-1.3.12/docs/client/tools.mdx +0 -276
- mcp_use-1.3.12/docs/community/showcase.mdx +0 -196
- mcp_use-1.3.12/docs/development/observability.mdx +0 -275
- mcp_use-1.3.12/docs/development/telemetry.mdx +0 -173
- mcp_use-1.3.12/docs/development.mdx +0 -115
- mcp_use-1.3.12/docs/docs.json +0 -461
- mcp_use-1.3.12/docs/favicon.svg +0 -8
- mcp_use-1.3.12/docs/fonts.css +0 -24
- mcp_use-1.3.12/docs/generate_docs.py +0 -1371
- mcp_use-1.3.12/docs/getting-started/configuration.mdx +0 -254
- mcp_use-1.3.12/docs/getting-started/index.mdx +0 -187
- mcp_use-1.3.12/docs/getting-started/installation.mdx +0 -409
- mcp_use-1.3.12/docs/getting-started/quickstart.mdx +0 -287
- mcp_use-1.3.12/docs/images/01.png +0 -0
- mcp_use-1.3.12/docs/images/02.png +0 -0
- mcp_use-1.3.12/docs/images/Middleware.jpg +0 -0
- mcp_use-1.3.12/docs/images/Release1.3.11.png +0 -0
- mcp_use-1.3.12/docs/images/Release1.3.12.png +0 -0
- mcp_use-1.3.12/docs/images/configuration-dark.png +0 -0
- mcp_use-1.3.12/docs/images/configuration-light.png +0 -0
- mcp_use-1.3.12/docs/images/examples-dark.png +0 -0
- mcp_use-1.3.12/docs/images/examples-light.png +0 -0
- mcp_use-1.3.12/docs/images/hero-dark.png +0 -0
- mcp_use-1.3.12/docs/images/hero-light.png +0 -0
- mcp_use-1.3.12/docs/images/installation-dark.png +0 -0
- mcp_use-1.3.12/docs/images/installation-light.png +0 -0
- mcp_use-1.3.12/docs/images/quickstart-dark.png +0 -0
- mcp_use-1.3.12/docs/images/quickstart-light.png +0 -0
- mcp_use-1.3.12/docs/logo/dark.svg +0 -8
- mcp_use-1.3.12/docs/logo/light.svg +0 -8
- mcp_use-1.3.12/docs/logo/react.svg +0 -1
- mcp_use-1.3.12/docs/snippets/gradient.jsx +0 -75
- mcp_use-1.3.12/docs/snippets/snippet-intro.mdx +0 -10
- mcp_use-1.3.12/docs/snippets/youtube-embed.mdx +0 -14
- mcp_use-1.3.12/docs/troubleshooting/common-issues.mdx +0 -388
- mcp_use-1.3.12/docs/troubleshooting/connection-errors.mdx +0 -674
- mcp_use-1.3.12/docs/troubleshooting/performance.mdx +0 -553
- mcp_use-1.3.12/mcp_use/adapters/__init__.py +0 -10
- mcp_use-1.3.12/mcp_use/adapters/base.py +0 -190
- mcp_use-1.3.12/mcp_use/cli.py +0 -581
- mcp_use-1.3.12/mcp_use/types/sandbox.py +0 -23
- {mcp_use-1.3.12 → mcp_use-1.4.0}/.env.example +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/.gitignore +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/CLAUDE.md +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/airbnb_mcp.json +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/airbnb_use.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/blender_use.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/browser_use.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/chat_example.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/direct_tool_call.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/example_middleware.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/filesystem_use.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/http_example.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/limited_memory_chat.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/mcp_everything.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/multi_server_example.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/sandbox_everything.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/simple_oauth_example.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/simple_server_manager_use.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/structured_output.py +0 -0
- /mcp_use-1.3.12/CHANGELOG.md → /mcp_use-1.4.0/mcp_use/adapters/.deprecated +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/agents/__init__.py +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/__init__.py +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/base.py +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/__init__.py +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/base_tool.py +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/observability/__init__.py +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/observability/callbacks_manager.py +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/observability/laminar.py +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/observability/langfuse.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/agents/prompts/templates.py +0 -0
- /mcp_use-1.3.12/mcp_use/telemetry/__init__.py → /mcp_use-1.4.0/mcp_use/auth/.deprecated +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/auth/__init__.py +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/__init__.py +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/utils.py +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/exceptions.py +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/middleware/__init__.py +0 -0
- {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/task_managers/__init__.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/errors/__init__.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/errors/error_formatting.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/utils.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/pytest.ini +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/ruff.toml +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/static/logo-gh.jpg +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/static/logo_black.svg +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/static/logo_white.svg +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/conftest.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/__init__.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/conftest.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/others/test_custom_streaming_integration.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_discovery.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_elicitation.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_logging.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_notifications.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_prompts.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_resources.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_sampling.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_tools.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/servers_for_testing/__init__.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/servers_for_testing/auth_server.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/servers_for_testing/custom_streaming_server.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/servers_for_testing/primitive_server.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/servers_for_testing/simple_server.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/servers_for_testing/timeout_test_server.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/transports/test_sse.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/transports/test_stdio.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/transports/test_streamable_http.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_enum_handling.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_session.py +0 -0
- {mcp_use-1.3.12 → mcp_use-1.4.0}/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
|
+
Version: 1.4.0
|
|
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,7 +16,8 @@ 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>=1.0.0
|
|
20
|
+
Requires-Dist: langchain>=1.0.0
|
|
21
21
|
Requires-Dist: mcp>=1.10.0
|
|
22
22
|
Requires-Dist: posthog>=4.8.0
|
|
23
23
|
Requires-Dist: pydantic-core==2.33.2
|
|
@@ -54,8 +54,7 @@ Description-Content-Type: text/markdown
|
|
|
54
54
|
</picture>
|
|
55
55
|
</div>
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
<h1 align="center">🚀 Create MCP Clients and Agents</h1>
|
|
57
|
+
<h1 align="center">🚀 mcp-use for Python</h1>
|
|
59
58
|
<p align="center">
|
|
60
59
|
<a href="https://github.com/pietrozullo/mcp-use/stargazers" alt="GitHub stars">
|
|
61
60
|
<img src="https://img.shields.io/github/stars/pietrozullo/mcp-use?style=social" /></a>
|
|
@@ -63,37 +62,42 @@ Description-Content-Type: text/markdown
|
|
|
63
62
|
<img src="https://static.pepy.tech/badge/mcp-use" /></a>
|
|
64
63
|
<a href="https://pypi.org/project/mcp_use/" alt="PyPI Version">
|
|
65
64
|
<img src="https://img.shields.io/pypi/v/mcp_use.svg"/></a>
|
|
66
|
-
<a href="https://github.com/mcp-use/mcp-use-ts" alt="TypeScript">
|
|
67
|
-
<img src="https://img.shields.io/badge/TypeScript-mcp--use-3178C6?logo=typescript&logoColor=white" /></a>
|
|
68
65
|
<a href="https://github.com/pietrozullo/mcp-use/blob/main/LICENSE" alt="License">
|
|
69
66
|
<img src="https://img.shields.io/github/license/pietrozullo/mcp-use" /></a>
|
|
70
67
|
<a href="https://docs.mcp-use.com" alt="Documentation">
|
|
71
68
|
<img src="https://img.shields.io/badge/docs-mcp--use.com-blue" /></a>
|
|
72
|
-
<a href="https://mcp-use.com" alt="Website">
|
|
73
|
-
<img src="https://img.shields.io/badge/website-mcp--use.com-blue" /></a>
|
|
74
|
-
</p>
|
|
75
|
-
<p align="center">
|
|
76
|
-
<a href="https://x.com/pietrozullo" alt="Twitter Follow - Pietro">
|
|
77
|
-
<img src="https://img.shields.io/twitter/follow/Pietro?style=social" /></a>
|
|
78
|
-
<a href="https://x.com/pederzh" alt="Twitter Follow - Luigi">
|
|
79
|
-
<img src="https://img.shields.io/twitter/follow/Luigi?style=social" /></a>
|
|
80
69
|
<a href="https://discord.gg/XkNkSkMz3V" alt="Discord">
|
|
81
70
|
<img src="https://dcbadge.limes.pink/api/server/XkNkSkMz3V?style=flat" /></a>
|
|
82
71
|
</p>
|
|
83
72
|
</div>
|
|
84
73
|
|
|
85
|
-
|
|
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)
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
---
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
- Visit the [mcp-use docs](https://docs.mcp-use.com/) to get started with mcp-use library
|
|
91
|
-
- For the TypeScript version, visit [mcp-use-ts](https://github.com/mcp-use/mcp-use-ts)
|
|
90
|
+
## 📖 Quick Links
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
+
| :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
99
|
+
| **Primitives** | [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) |
|
|
100
|
+
| **Transports** | [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) |
|
|
97
101
|
|
|
98
102
|
## Features
|
|
99
103
|
|
|
@@ -140,7 +144,13 @@ Description-Content-Type: text/markdown
|
|
|
140
144
|
</tr>
|
|
141
145
|
</table>
|
|
142
146
|
|
|
143
|
-
|
|
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
|
|
144
154
|
|
|
145
155
|
With pip:
|
|
146
156
|
|
|
@@ -250,7 +260,7 @@ For other settings, models, and more, check out the documentation.
|
|
|
250
260
|
|
|
251
261
|
## Streaming Agent Output
|
|
252
262
|
|
|
253
|
-
|
|
263
|
+
mcp-use supports asynchronous streaming of agent output using the `stream` method on `MCPAgent`. This allows you to receive incremental results, tool actions, and intermediate steps as they are generated by the agent, enabling real-time feedback and progress reporting.
|
|
254
264
|
|
|
255
265
|
### How to use
|
|
256
266
|
|
|
@@ -423,7 +433,7 @@ if __name__ == "__main__":
|
|
|
423
433
|
|
|
424
434
|
## HTTP Connection Example
|
|
425
435
|
|
|
426
|
-
|
|
436
|
+
mcp-use supports HTTP connections, allowing you to connect to MCP servers running on specific HTTP ports. This feature is particularly useful for integrating with web-based MCP servers.
|
|
427
437
|
|
|
428
438
|
Here's an example of how to use the HTTP connection feature:
|
|
429
439
|
|
|
@@ -472,7 +482,7 @@ This example demonstrates how to connect to an MCP server running on a specific
|
|
|
472
482
|
|
|
473
483
|
# Multi-Server Support
|
|
474
484
|
|
|
475
|
-
|
|
485
|
+
mcp-use allows configuring and connecting to multiple MCP servers simultaneously using the `MCPClient`. This enables complex workflows that require tools from different servers, such as web browsing combined with file operations or 3D modeling.
|
|
476
486
|
|
|
477
487
|
## Configuration
|
|
478
488
|
|
|
@@ -554,7 +564,7 @@ if __name__ == "__main__":
|
|
|
554
564
|
|
|
555
565
|
# Tool Access Control
|
|
556
566
|
|
|
557
|
-
|
|
567
|
+
mcp-use allows you to restrict which tools are available to the agent, providing better security and control over agent capabilities:
|
|
558
568
|
|
|
559
569
|
```python
|
|
560
570
|
import asyncio
|
|
@@ -587,7 +597,7 @@ if __name__ == "__main__":
|
|
|
587
597
|
|
|
588
598
|
# Sandboxed Execution
|
|
589
599
|
|
|
590
|
-
|
|
600
|
+
mcp-use supports running MCP servers in a sandboxed environment using E2B's cloud infrastructure. This allows you to run MCP servers without having to install dependencies locally, making it easier to use tools that might have complex setups or system requirements.
|
|
591
601
|
|
|
592
602
|
## Installation
|
|
593
603
|
|
|
@@ -675,7 +685,13 @@ The `SandboxOptions` type provides configuration for the sandbox environment:
|
|
|
675
685
|
- **Consistent environment**: Ensure consistent behavior across different systems
|
|
676
686
|
- **Resource efficiency**: Offload resource-intensive tasks to cloud infrastructure
|
|
677
687
|
|
|
678
|
-
|
|
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)
|
|
679
695
|
|
|
680
696
|
You can call MCP server tools directly without an LLM when you need programmatic control:
|
|
681
697
|
|
|
@@ -752,9 +768,26 @@ if __name__ == "__main__":
|
|
|
752
768
|
|
|
753
769
|
```
|
|
754
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
|
+
|
|
755
788
|
# Debugging
|
|
756
789
|
|
|
757
|
-
|
|
790
|
+
mcp-use provides a built-in debug mode that increases log verbosity and helps diagnose issues in your agent implementation.
|
|
758
791
|
|
|
759
792
|
## Enabling Debug Mode
|
|
760
793
|
|
|
@@ -815,14 +848,6 @@ This is useful when you only need to see the agent's steps and decision-making p
|
|
|
815
848
|
|
|
816
849
|
We love contributions! Feel free to open issues for bugs or feature requests. Look at [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
817
850
|
|
|
818
|
-
## Contributors
|
|
819
|
-
|
|
820
|
-
Thanks to all our amazing contributors!
|
|
821
|
-
|
|
822
|
-
<a href="https://github.com/mcp-use/mcp-use/graphs/contributors">
|
|
823
|
-
<img src="https://contrib.rocks/image?repo=mcp-use/mcp-use" />
|
|
824
|
-
</a>
|
|
825
|
-
|
|
826
851
|
## Top Starred Dependents
|
|
827
852
|
|
|
828
853
|
<!-- gh-dependents-info-used-by-start -->
|
|
@@ -888,12 +913,12 @@ MIT
|
|
|
888
913
|
|
|
889
914
|
# Citation
|
|
890
915
|
|
|
891
|
-
If you use
|
|
916
|
+
If you use mcp-use in your research or project, please cite:
|
|
892
917
|
|
|
893
918
|
```bibtex
|
|
894
919
|
@software{mcp_use2025,
|
|
895
920
|
author = {Zullo, Pietro},
|
|
896
|
-
title = {
|
|
921
|
+
title = {mcp-use: MCP Library for Python},
|
|
897
922
|
year = {2025},
|
|
898
923
|
publisher = {GitHub},
|
|
899
924
|
url = {https://github.com/pietrozullo/mcp-use}
|
|
@@ -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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
+
| :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
52
|
+
| **Primitives** | [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) |
|
|
53
|
+
| **Transports** | [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.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
|
|
|
@@ -203,7 +213,7 @@ For other settings, models, and more, check out the documentation.
|
|
|
203
213
|
|
|
204
214
|
## Streaming Agent Output
|
|
205
215
|
|
|
206
|
-
|
|
216
|
+
mcp-use supports asynchronous streaming of agent output using the `stream` method on `MCPAgent`. This allows you to receive incremental results, tool actions, and intermediate steps as they are generated by the agent, enabling real-time feedback and progress reporting.
|
|
207
217
|
|
|
208
218
|
### How to use
|
|
209
219
|
|
|
@@ -376,7 +386,7 @@ if __name__ == "__main__":
|
|
|
376
386
|
|
|
377
387
|
## HTTP Connection Example
|
|
378
388
|
|
|
379
|
-
|
|
389
|
+
mcp-use supports HTTP connections, allowing you to connect to MCP servers running on specific HTTP ports. This feature is particularly useful for integrating with web-based MCP servers.
|
|
380
390
|
|
|
381
391
|
Here's an example of how to use the HTTP connection feature:
|
|
382
392
|
|
|
@@ -425,7 +435,7 @@ This example demonstrates how to connect to an MCP server running on a specific
|
|
|
425
435
|
|
|
426
436
|
# Multi-Server Support
|
|
427
437
|
|
|
428
|
-
|
|
438
|
+
mcp-use allows configuring and connecting to multiple MCP servers simultaneously using the `MCPClient`. This enables complex workflows that require tools from different servers, such as web browsing combined with file operations or 3D modeling.
|
|
429
439
|
|
|
430
440
|
## Configuration
|
|
431
441
|
|
|
@@ -507,7 +517,7 @@ if __name__ == "__main__":
|
|
|
507
517
|
|
|
508
518
|
# Tool Access Control
|
|
509
519
|
|
|
510
|
-
|
|
520
|
+
mcp-use allows you to restrict which tools are available to the agent, providing better security and control over agent capabilities:
|
|
511
521
|
|
|
512
522
|
```python
|
|
513
523
|
import asyncio
|
|
@@ -540,7 +550,7 @@ if __name__ == "__main__":
|
|
|
540
550
|
|
|
541
551
|
# Sandboxed Execution
|
|
542
552
|
|
|
543
|
-
|
|
553
|
+
mcp-use supports running MCP servers in a sandboxed environment using E2B's cloud infrastructure. This allows you to run MCP servers without having to install dependencies locally, making it easier to use tools that might have complex setups or system requirements.
|
|
544
554
|
|
|
545
555
|
## Installation
|
|
546
556
|
|
|
@@ -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,9 +721,26 @@ 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.
|
|
711
744
|
|
|
712
745
|
## Enabling Debug Mode
|
|
713
746
|
|
|
@@ -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 -->
|
|
@@ -841,12 +866,12 @@ MIT
|
|
|
841
866
|
|
|
842
867
|
# Citation
|
|
843
868
|
|
|
844
|
-
If you use
|
|
869
|
+
If you use mcp-use in your research or project, please cite:
|
|
845
870
|
|
|
846
871
|
```bibtex
|
|
847
872
|
@software{mcp_use2025,
|
|
848
873
|
author = {Zullo, Pietro},
|
|
849
|
-
title = {
|
|
874
|
+
title = {mcp-use: MCP Library for Python},
|
|
850
875
|
year = {2025},
|
|
851
876
|
publisher = {GitHub},
|
|
852
877
|
url = {https://github.com/pietrozullo/mcp-use}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
|
|
3
|
+
from anthropic import Anthropic
|
|
4
|
+
from dotenv import load_dotenv
|
|
5
|
+
|
|
6
|
+
from mcp_use import MCPClient
|
|
7
|
+
from mcp_use.agents.adapters import AnthropicMCPAdapter
|
|
8
|
+
|
|
9
|
+
# This example demonstrates how to use our integration
|
|
10
|
+
# adapters to use MCP tools and convert to the right format.
|
|
11
|
+
# In particularly, this example uses the AnthropicMCPAdapter.
|
|
12
|
+
|
|
13
|
+
load_dotenv()
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
async def main():
|
|
17
|
+
config = {
|
|
18
|
+
"mcpServers": {
|
|
19
|
+
"airbnb": {"command": "npx", "args": ["-y", "@openbnb/mcp-server-airbnb", "--ignore-robots-txt"]},
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
try:
|
|
24
|
+
client = MCPClient(config=config)
|
|
25
|
+
|
|
26
|
+
# Creates the adapter for Anthropic's format
|
|
27
|
+
adapter = AnthropicMCPAdapter()
|
|
28
|
+
|
|
29
|
+
# Convert tools from active connectors to the Anthropic's format
|
|
30
|
+
await adapter.create_all(client)
|
|
31
|
+
|
|
32
|
+
# List concatenation (if you loaded all tools)
|
|
33
|
+
anthropic_tools = adapter.tools + adapter.resources + adapter.prompts
|
|
34
|
+
|
|
35
|
+
# If you don't want to create all tools, you can call single functions
|
|
36
|
+
# await adapter.create_tools(client)
|
|
37
|
+
# await adapter.create_resources(client)
|
|
38
|
+
# await adapter.create_prompts(client)
|
|
39
|
+
|
|
40
|
+
# Use tools with Anthropic's SDK (not agent in this case)
|
|
41
|
+
anthropic = Anthropic()
|
|
42
|
+
|
|
43
|
+
# Initial request
|
|
44
|
+
messages = [{"role": "user", "content": "Please tell me the cheapest hotel for two people in Trapani."}]
|
|
45
|
+
response = anthropic.messages.create(
|
|
46
|
+
model="claude-sonnet-4-5", tools=anthropic_tools, max_tokens=1024, messages=messages
|
|
47
|
+
)
|
|
48
|
+
messages.append({"role": response.role, "content": response.content})
|
|
49
|
+
|
|
50
|
+
print("Claude wants to use tools:", response.stop_reason == "tool_use")
|
|
51
|
+
print("Number of tool calls:", len([c for c in response.content if c.type == "tool_use"]))
|
|
52
|
+
|
|
53
|
+
if response.stop_reason == "tool_use":
|
|
54
|
+
tool_results = []
|
|
55
|
+
for c in response.content:
|
|
56
|
+
if c.type != "tool_use":
|
|
57
|
+
continue
|
|
58
|
+
|
|
59
|
+
tool_name = c.name
|
|
60
|
+
arguments = c.input
|
|
61
|
+
|
|
62
|
+
# Use the adapter's map to get the correct executor
|
|
63
|
+
executor = adapter.tool_executors.get(tool_name)
|
|
64
|
+
|
|
65
|
+
if not executor:
|
|
66
|
+
print(f"Error: Unknown tool '{tool_name}' requested by model.")
|
|
67
|
+
content = f"Error: Tool '{tool_name}' not found."
|
|
68
|
+
else:
|
|
69
|
+
try:
|
|
70
|
+
# Execute the tool using the retrieved function
|
|
71
|
+
print(f"Executing tool: {tool_name}({arguments})")
|
|
72
|
+
tool_result = await executor(**arguments)
|
|
73
|
+
|
|
74
|
+
# Use the adapter's universal parser
|
|
75
|
+
content = adapter.parse_result(tool_result)
|
|
76
|
+
except Exception as e:
|
|
77
|
+
print(f"An unexpected error occurred while executing tool {tool_name}: {e}")
|
|
78
|
+
content = f"Error executing tool: {e}"
|
|
79
|
+
|
|
80
|
+
# Append the result for this specific tool call
|
|
81
|
+
tool_results.append(
|
|
82
|
+
{
|
|
83
|
+
"type": "tool_result",
|
|
84
|
+
"tool_use_id": c.id,
|
|
85
|
+
"content": content,
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
if tool_results:
|
|
90
|
+
messages.append(
|
|
91
|
+
{
|
|
92
|
+
"role": "user",
|
|
93
|
+
"content": tool_results,
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
# Get final response
|
|
97
|
+
final_response = anthropic.messages.create(
|
|
98
|
+
model="claude-sonnet-4-5", max_tokens=1024, tools=anthropic_tools, messages=messages
|
|
99
|
+
)
|
|
100
|
+
print("\n--- Final response from the model ---")
|
|
101
|
+
print(final_response.content[0].text)
|
|
102
|
+
else:
|
|
103
|
+
final_response = response
|
|
104
|
+
print("\n--- Final response from the model ---")
|
|
105
|
+
if final_response.content:
|
|
106
|
+
print(final_response.content[0].text)
|
|
107
|
+
|
|
108
|
+
except Exception as e:
|
|
109
|
+
print(f"Error: {e}")
|
|
110
|
+
raise e
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
if __name__ == "__main__":
|
|
114
|
+
asyncio.run(main())
|