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.

Files changed (301) hide show
  1. {mcp_use-1.3.12 → mcp_use-1.4.0}/.pre-commit-config.yaml +1 -2
  2. {mcp_use-1.3.12 → mcp_use-1.4.0}/PKG-INFO +68 -43
  3. {mcp_use-1.3.12 → mcp_use-1.4.0}/README.md +64 -39
  4. mcp_use-1.4.0/examples/anthropic_integration_example.py +114 -0
  5. mcp_use-1.4.0/examples/google_integration_example.py +138 -0
  6. mcp_use-1.4.0/examples/openai_integration_example.py +92 -0
  7. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/stream_example.py +14 -5
  8. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/__init__.py +1 -1
  9. mcp_use-1.4.0/mcp_use/adapters/__init__.py +21 -0
  10. mcp_use-1.4.0/mcp_use/adapters/base.py +17 -0
  11. mcp_use-1.4.0/mcp_use/adapters/langchain_adapter.py +18 -0
  12. mcp_use-1.4.0/mcp_use/agents/adapters/__init__.py +17 -0
  13. mcp_use-1.4.0/mcp_use/agents/adapters/anthropic.py +93 -0
  14. mcp_use-1.4.0/mcp_use/agents/adapters/base.py +316 -0
  15. mcp_use-1.4.0/mcp_use/agents/adapters/google.py +103 -0
  16. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/adapters/langchain_adapter.py +12 -25
  17. mcp_use-1.4.0/mcp_use/agents/adapters/openai.py +111 -0
  18. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/agents/base.py +1 -1
  19. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/server_manager.py +11 -4
  20. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/connect_server.py +1 -2
  21. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/disconnect_server.py +1 -2
  22. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/get_active_server.py +1 -1
  23. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/list_servers_tool.py +1 -2
  24. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/search_tools.py +2 -2
  25. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/agents/mcpagent.py +386 -485
  26. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/agents/prompts/system_prompt_builder.py +1 -1
  27. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/agents/remote.py +15 -2
  28. mcp_use-1.4.0/mcp_use/auth/__init__.py +21 -0
  29. mcp_use-1.4.0/mcp_use/auth/bearer.py +16 -0
  30. mcp_use-1.4.0/mcp_use/auth/oauth.py +16 -0
  31. mcp_use-1.4.0/mcp_use/auth/oauth_callback.py +23 -0
  32. mcp_use-1.4.0/mcp_use/client/__init__.py +1 -0
  33. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/auth/bearer.py +6 -0
  34. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/auth/oauth.py +8 -4
  35. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/auth/oauth_callback.py +4 -3
  36. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/client.py +12 -6
  37. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/config.py +7 -5
  38. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/base.py +13 -4
  39. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/http.py +5 -6
  40. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/sandbox.py +25 -4
  41. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/stdio.py +4 -4
  42. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/websocket.py +3 -3
  43. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/middleware/logging.py +2 -2
  44. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/middleware/metrics.py +1 -1
  45. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/middleware/middleware.py +4 -0
  46. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/session.py +9 -1
  47. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/task_managers/base.py +1 -1
  48. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/task_managers/sse.py +2 -2
  49. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/task_managers/stdio.py +2 -2
  50. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/task_managers/streamable_http.py +2 -2
  51. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/task_managers/websocket.py +2 -2
  52. mcp_use-1.4.0/mcp_use/client.py +18 -0
  53. mcp_use-1.4.0/mcp_use/config.py +27 -0
  54. mcp_use-1.4.0/mcp_use/connectors/.deprecated +0 -0
  55. mcp_use-1.4.0/mcp_use/connectors/__init__.py +46 -0
  56. mcp_use-1.4.0/mcp_use/connectors/base.py +18 -0
  57. mcp_use-1.4.0/mcp_use/connectors/http.py +18 -0
  58. mcp_use-1.4.0/mcp_use/connectors/sandbox.py +18 -0
  59. mcp_use-1.4.0/mcp_use/connectors/stdio.py +18 -0
  60. mcp_use-1.4.0/mcp_use/connectors/utils.py +20 -0
  61. mcp_use-1.4.0/mcp_use/connectors/websocket.py +18 -0
  62. mcp_use-1.4.0/mcp_use/exceptions.py +46 -0
  63. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/logging.py +1 -1
  64. mcp_use-1.4.0/mcp_use/managers/.deprecated +0 -0
  65. mcp_use-1.4.0/mcp_use/managers/__init__.py +58 -0
  66. mcp_use-1.4.0/mcp_use/managers/base.py +18 -0
  67. mcp_use-1.4.0/mcp_use/managers/server_manager.py +18 -0
  68. mcp_use-1.4.0/mcp_use/managers/tools/__init__.py +45 -0
  69. mcp_use-1.4.0/mcp_use/managers/tools/base_tool.py +8 -0
  70. mcp_use-1.4.0/mcp_use/managers/tools/connect_server.py +8 -0
  71. mcp_use-1.4.0/mcp_use/managers/tools/disconnect_server.py +8 -0
  72. mcp_use-1.4.0/mcp_use/managers/tools/get_active_server.py +8 -0
  73. mcp_use-1.4.0/mcp_use/managers/tools/list_servers_tool.py +8 -0
  74. mcp_use-1.4.0/mcp_use/managers/tools/search_tools.py +24 -0
  75. mcp_use-1.4.0/mcp_use/middleware/.deprecated +0 -0
  76. mcp_use-1.4.0/mcp_use/middleware/__init__.py +89 -0
  77. mcp_use-1.4.0/mcp_use/middleware/logging.py +19 -0
  78. mcp_use-1.4.0/mcp_use/middleware/metrics.py +41 -0
  79. mcp_use-1.4.0/mcp_use/middleware/middleware.py +55 -0
  80. mcp_use-1.4.0/mcp_use/session.py +18 -0
  81. mcp_use-1.4.0/mcp_use/task_managers/.deprecated +0 -0
  82. mcp_use-1.4.0/mcp_use/task_managers/__init__.py +48 -0
  83. mcp_use-1.4.0/mcp_use/task_managers/base.py +18 -0
  84. mcp_use-1.4.0/mcp_use/task_managers/sse.py +18 -0
  85. mcp_use-1.4.0/mcp_use/task_managers/stdio.py +18 -0
  86. mcp_use-1.4.0/mcp_use/task_managers/streamable_http.py +20 -0
  87. mcp_use-1.4.0/mcp_use/task_managers/websocket.py +18 -0
  88. mcp_use-1.4.0/mcp_use/telemetry/__init__.py +0 -0
  89. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/telemetry/events.py +58 -0
  90. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/telemetry/telemetry.py +71 -1
  91. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/telemetry/utils.py +1 -1
  92. mcp_use-1.4.0/mcp_use/types/.deprecated +0 -0
  93. mcp_use-1.4.0/mcp_use/types/sandbox.py +18 -0
  94. {mcp_use-1.3.12 → mcp_use-1.4.0}/pyproject.toml +4 -2
  95. mcp_use-1.4.0/tests/integration/agent/test_agent_run.py +47 -0
  96. mcp_use-1.4.0/tests/integration/agent/test_agent_stream.py +84 -0
  97. mcp_use-1.4.0/tests/integration/agent/test_agent_structured_output.py +63 -0
  98. mcp_use-1.4.0/tests/integration/agent/test_server_manager.py +118 -0
  99. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_auth.py +7 -7
  100. mcp_use-1.4.0/tests/unit/backward_compatibility.py +104 -0
  101. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_agent.py +20 -19
  102. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_client.py +15 -10
  103. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_config.py +4 -4
  104. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_http_connector.py +15 -15
  105. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_sandbox_connector.py +14 -15
  106. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_search_tools_issue_138.py +4 -4
  107. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_stdio_connector.py +12 -12
  108. mcp_use-1.3.12/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  109. mcp_use-1.3.12/.github/pull_request_template.md +0 -43
  110. mcp_use-1.3.12/.github/release-drafter.yml +0 -32
  111. mcp_use-1.3.12/.github/workflows/docs.yml +0 -108
  112. mcp_use-1.3.12/.github/workflows/publish.yml +0 -81
  113. mcp_use-1.3.12/.github/workflows/release-drafter.yml +0 -41
  114. mcp_use-1.3.12/.github/workflows/stale.yml +0 -18
  115. mcp_use-1.3.12/.github/workflows/tests.yml +0 -115
  116. mcp_use-1.3.12/.github/workflows/update-readme.yml +0 -112
  117. mcp_use-1.3.12/CODE_OF_CONDUCT.md +0 -128
  118. mcp_use-1.3.12/CONTRIBUTING.md +0 -146
  119. mcp_use-1.3.12/LICENSE +0 -21
  120. mcp_use-1.3.12/docs/README.md +0 -32
  121. mcp_use-1.3.12/docs/advanced/building-custom-agents.mdx +0 -309
  122. mcp_use-1.3.12/docs/advanced/logging.mdx +0 -186
  123. mcp_use-1.3.12/docs/advanced/multi-server-setup.mdx +0 -695
  124. mcp_use-1.3.12/docs/advanced/security.mdx +0 -667
  125. mcp_use-1.3.12/docs/agent/agent-configuration.mdx +0 -651
  126. mcp_use-1.3.12/docs/agent/interactive-chat-patterns.mdx +0 -569
  127. mcp_use-1.3.12/docs/agent/llm-integration.mdx +0 -317
  128. mcp_use-1.3.12/docs/agent/memory-management.mdx +0 -137
  129. mcp_use-1.3.12/docs/agent/server-manager.mdx +0 -385
  130. mcp_use-1.3.12/docs/agent/streaming.mdx +0 -376
  131. mcp_use-1.3.12/docs/agent/structured-output.mdx +0 -104
  132. mcp_use-1.3.12/docs/api-reference/mcp_use_adapters_base.mdx +0 -102
  133. mcp_use-1.3.12/docs/api-reference/mcp_use_adapters_langchain_adapter.mdx +0 -68
  134. mcp_use-1.3.12/docs/api-reference/mcp_use_agents_base.mdx +0 -109
  135. mcp_use-1.3.12/docs/api-reference/mcp_use_agents_mcpagent.mdx +0 -333
  136. mcp_use-1.3.12/docs/api-reference/mcp_use_agents_prompts_system_prompt_builder.mdx +0 -115
  137. mcp_use-1.3.12/docs/api-reference/mcp_use_agents_prompts_templates.mdx +0 -12
  138. mcp_use-1.3.12/docs/api-reference/mcp_use_agents_remote.mdx +0 -118
  139. mcp_use-1.3.12/docs/api-reference/mcp_use_auth_bearer.mdx +0 -57
  140. mcp_use-1.3.12/docs/api-reference/mcp_use_auth_oauth.mdx +0 -432
  141. mcp_use-1.3.12/docs/api-reference/mcp_use_auth_oauth_callback.mdx +0 -138
  142. mcp_use-1.3.12/docs/api-reference/mcp_use_cli.mdx +0 -322
  143. mcp_use-1.3.12/docs/api-reference/mcp_use_client.mdx +0 -256
  144. mcp_use-1.3.12/docs/api-reference/mcp_use_config.mdx +0 -84
  145. mcp_use-1.3.12/docs/api-reference/mcp_use_connectors_base.mdx +0 -345
  146. mcp_use-1.3.12/docs/api-reference/mcp_use_connectors_http.mdx +0 -61
  147. mcp_use-1.3.12/docs/api-reference/mcp_use_connectors_sandbox.mdx +0 -83
  148. mcp_use-1.3.12/docs/api-reference/mcp_use_connectors_stdio.mdx +0 -61
  149. mcp_use-1.3.12/docs/api-reference/mcp_use_connectors_utils.mdx +0 -37
  150. mcp_use-1.3.12/docs/api-reference/mcp_use_connectors_websocket.mdx +0 -54
  151. mcp_use-1.3.12/docs/api-reference/mcp_use_errors_error_formatting.mdx +0 -38
  152. mcp_use-1.3.12/docs/api-reference/mcp_use_exceptions.mdx +0 -174
  153. mcp_use-1.3.12/docs/api-reference/mcp_use_logging.mdx +0 -37
  154. mcp_use-1.3.12/docs/api-reference/mcp_use_managers_base.mdx +0 -81
  155. mcp_use-1.3.12/docs/api-reference/mcp_use_managers_server_manager.mdx +0 -82
  156. mcp_use-1.3.12/docs/api-reference/mcp_use_managers_tools_base_tool.mdx +0 -62
  157. mcp_use-1.3.12/docs/api-reference/mcp_use_managers_tools_connect_server.mdx +0 -95
  158. mcp_use-1.3.12/docs/api-reference/mcp_use_managers_tools_disconnect_server.mdx +0 -88
  159. mcp_use-1.3.12/docs/api-reference/mcp_use_managers_tools_get_active_server.mdx +0 -88
  160. mcp_use-1.3.12/docs/api-reference/mcp_use_managers_tools_list_servers_tool.mdx +0 -88
  161. mcp_use-1.3.12/docs/api-reference/mcp_use_managers_tools_search_tools.mdx +0 -203
  162. mcp_use-1.3.12/docs/api-reference/mcp_use_middleware_logging.mdx +0 -33
  163. mcp_use-1.3.12/docs/api-reference/mcp_use_middleware_metrics.mdx +0 -185
  164. mcp_use-1.3.12/docs/api-reference/mcp_use_middleware_middleware.mdx +0 -595
  165. mcp_use-1.3.12/docs/api-reference/mcp_use_observability_callbacks_manager.mdx +0 -180
  166. mcp_use-1.3.12/docs/api-reference/mcp_use_observability_laminar.mdx +0 -16
  167. mcp_use-1.3.12/docs/api-reference/mcp_use_observability_langfuse.mdx +0 -12
  168. mcp_use-1.3.12/docs/api-reference/mcp_use_session.mdx +0 -232
  169. mcp_use-1.3.12/docs/api-reference/mcp_use_task_managers_base.mdx +0 -95
  170. mcp_use-1.3.12/docs/api-reference/mcp_use_task_managers_sse.mdx +0 -57
  171. mcp_use-1.3.12/docs/api-reference/mcp_use_task_managers_stdio.mdx +0 -54
  172. mcp_use-1.3.12/docs/api-reference/mcp_use_task_managers_streamable_http.mdx +0 -57
  173. mcp_use-1.3.12/docs/api-reference/mcp_use_task_managers_websocket.mdx +0 -52
  174. mcp_use-1.3.12/docs/api-reference/mcp_use_types_sandbox.mdx +0 -58
  175. mcp_use-1.3.12/docs/api-reference/mcp_use_utils.mdx +0 -44
  176. mcp_use-1.3.12/docs/blog/middleware.mdx +0 -136
  177. mcp_use-1.3.12/docs/changelog/1_3_11.mdx +0 -73
  178. mcp_use-1.3.12/docs/changelog/1_3_12.mdx +0 -85
  179. mcp_use-1.3.12/docs/changelog/changelog.mdx +0 -82
  180. mcp_use-1.3.12/docs/client/authentication.mdx +0 -487
  181. mcp_use-1.3.12/docs/client/client-configuration.mdx +0 -211
  182. mcp_use-1.3.12/docs/client/connection-types.mdx +0 -141
  183. mcp_use-1.3.12/docs/client/direct-tool-calls.mdx +0 -420
  184. mcp_use-1.3.12/docs/client/elicitation.mdx +0 -401
  185. mcp_use-1.3.12/docs/client/logging.mdx +0 -96
  186. mcp_use-1.3.12/docs/client/middleware.mdx +0 -294
  187. mcp_use-1.3.12/docs/client/notifications.mdx +0 -138
  188. mcp_use-1.3.12/docs/client/prompts.mdx +0 -485
  189. mcp_use-1.3.12/docs/client/resources.mdx +0 -411
  190. mcp_use-1.3.12/docs/client/sampling.mdx +0 -122
  191. mcp_use-1.3.12/docs/client/sandbox.mdx +0 -122
  192. mcp_use-1.3.12/docs/client/tools.mdx +0 -276
  193. mcp_use-1.3.12/docs/community/showcase.mdx +0 -196
  194. mcp_use-1.3.12/docs/development/observability.mdx +0 -275
  195. mcp_use-1.3.12/docs/development/telemetry.mdx +0 -173
  196. mcp_use-1.3.12/docs/development.mdx +0 -115
  197. mcp_use-1.3.12/docs/docs.json +0 -461
  198. mcp_use-1.3.12/docs/favicon.svg +0 -8
  199. mcp_use-1.3.12/docs/fonts.css +0 -24
  200. mcp_use-1.3.12/docs/generate_docs.py +0 -1371
  201. mcp_use-1.3.12/docs/getting-started/configuration.mdx +0 -254
  202. mcp_use-1.3.12/docs/getting-started/index.mdx +0 -187
  203. mcp_use-1.3.12/docs/getting-started/installation.mdx +0 -409
  204. mcp_use-1.3.12/docs/getting-started/quickstart.mdx +0 -287
  205. mcp_use-1.3.12/docs/images/01.png +0 -0
  206. mcp_use-1.3.12/docs/images/02.png +0 -0
  207. mcp_use-1.3.12/docs/images/Middleware.jpg +0 -0
  208. mcp_use-1.3.12/docs/images/Release1.3.11.png +0 -0
  209. mcp_use-1.3.12/docs/images/Release1.3.12.png +0 -0
  210. mcp_use-1.3.12/docs/images/configuration-dark.png +0 -0
  211. mcp_use-1.3.12/docs/images/configuration-light.png +0 -0
  212. mcp_use-1.3.12/docs/images/examples-dark.png +0 -0
  213. mcp_use-1.3.12/docs/images/examples-light.png +0 -0
  214. mcp_use-1.3.12/docs/images/hero-dark.png +0 -0
  215. mcp_use-1.3.12/docs/images/hero-light.png +0 -0
  216. mcp_use-1.3.12/docs/images/installation-dark.png +0 -0
  217. mcp_use-1.3.12/docs/images/installation-light.png +0 -0
  218. mcp_use-1.3.12/docs/images/quickstart-dark.png +0 -0
  219. mcp_use-1.3.12/docs/images/quickstart-light.png +0 -0
  220. mcp_use-1.3.12/docs/logo/dark.svg +0 -8
  221. mcp_use-1.3.12/docs/logo/light.svg +0 -8
  222. mcp_use-1.3.12/docs/logo/react.svg +0 -1
  223. mcp_use-1.3.12/docs/snippets/gradient.jsx +0 -75
  224. mcp_use-1.3.12/docs/snippets/snippet-intro.mdx +0 -10
  225. mcp_use-1.3.12/docs/snippets/youtube-embed.mdx +0 -14
  226. mcp_use-1.3.12/docs/troubleshooting/common-issues.mdx +0 -388
  227. mcp_use-1.3.12/docs/troubleshooting/connection-errors.mdx +0 -674
  228. mcp_use-1.3.12/docs/troubleshooting/performance.mdx +0 -553
  229. mcp_use-1.3.12/mcp_use/adapters/__init__.py +0 -10
  230. mcp_use-1.3.12/mcp_use/adapters/base.py +0 -190
  231. mcp_use-1.3.12/mcp_use/cli.py +0 -581
  232. mcp_use-1.3.12/mcp_use/types/sandbox.py +0 -23
  233. {mcp_use-1.3.12 → mcp_use-1.4.0}/.env.example +0 -0
  234. {mcp_use-1.3.12 → mcp_use-1.4.0}/.gitignore +0 -0
  235. {mcp_use-1.3.12 → mcp_use-1.4.0}/CLAUDE.md +0 -0
  236. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/airbnb_mcp.json +0 -0
  237. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/airbnb_use.py +0 -0
  238. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/blender_use.py +0 -0
  239. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/browser_use.py +0 -0
  240. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/chat_example.py +0 -0
  241. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/direct_tool_call.py +0 -0
  242. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/example_middleware.py +0 -0
  243. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/filesystem_use.py +0 -0
  244. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/http_example.py +0 -0
  245. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/limited_memory_chat.py +0 -0
  246. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/mcp_everything.py +0 -0
  247. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/multi_server_example.py +0 -0
  248. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/sandbox_everything.py +0 -0
  249. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/simple_oauth_example.py +0 -0
  250. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/simple_server_manager_use.py +0 -0
  251. {mcp_use-1.3.12 → mcp_use-1.4.0}/examples/structured_output.py +0 -0
  252. /mcp_use-1.3.12/CHANGELOG.md → /mcp_use-1.4.0/mcp_use/adapters/.deprecated +0 -0
  253. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/agents/__init__.py +0 -0
  254. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/__init__.py +0 -0
  255. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/base.py +0 -0
  256. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/__init__.py +0 -0
  257. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/managers/tools/base_tool.py +0 -0
  258. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/observability/__init__.py +0 -0
  259. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/observability/callbacks_manager.py +0 -0
  260. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/observability/laminar.py +0 -0
  261. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/agents}/observability/langfuse.py +0 -0
  262. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/agents/prompts/templates.py +0 -0
  263. /mcp_use-1.3.12/mcp_use/telemetry/__init__.py → /mcp_use-1.4.0/mcp_use/auth/.deprecated +0 -0
  264. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/auth/__init__.py +0 -0
  265. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/__init__.py +0 -0
  266. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/connectors/utils.py +0 -0
  267. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/exceptions.py +0 -0
  268. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/middleware/__init__.py +0 -0
  269. {mcp_use-1.3.12/mcp_use → mcp_use-1.4.0/mcp_use/client}/task_managers/__init__.py +0 -0
  270. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/errors/__init__.py +0 -0
  271. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/errors/error_formatting.py +0 -0
  272. {mcp_use-1.3.12 → mcp_use-1.4.0}/mcp_use/utils.py +0 -0
  273. {mcp_use-1.3.12 → mcp_use-1.4.0}/pytest.ini +0 -0
  274. {mcp_use-1.3.12 → mcp_use-1.4.0}/ruff.toml +0 -0
  275. {mcp_use-1.3.12 → mcp_use-1.4.0}/static/logo-gh.jpg +0 -0
  276. {mcp_use-1.3.12 → mcp_use-1.4.0}/static/logo_black.svg +0 -0
  277. {mcp_use-1.3.12 → mcp_use-1.4.0}/static/logo_white.svg +0 -0
  278. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/conftest.py +0 -0
  279. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/__init__.py +0 -0
  280. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/conftest.py +0 -0
  281. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/others/test_custom_streaming_integration.py +0 -0
  282. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_discovery.py +0 -0
  283. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_elicitation.py +0 -0
  284. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_logging.py +0 -0
  285. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_notifications.py +0 -0
  286. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_prompts.py +0 -0
  287. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_resources.py +0 -0
  288. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_sampling.py +0 -0
  289. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/primitives/test_tools.py +0 -0
  290. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/servers_for_testing/__init__.py +0 -0
  291. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/servers_for_testing/auth_server.py +0 -0
  292. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/servers_for_testing/custom_streaming_server.py +0 -0
  293. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/servers_for_testing/primitive_server.py +0 -0
  294. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/servers_for_testing/simple_server.py +0 -0
  295. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/servers_for_testing/timeout_test_server.py +0 -0
  296. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/transports/test_sse.py +0 -0
  297. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/transports/test_stdio.py +0 -0
  298. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/integration/transports/test_streamable_http.py +0 -0
  299. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_enum_handling.py +0 -0
  300. {mcp_use-1.3.12 → mcp_use-1.4.0}/tests/unit/test_session.py +0 -0
  301. {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, --config=ruff.toml]
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.12
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>=0.1.0
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
- 🌐 MCP-Use is the open source way to connect **any LLM to any MCP server** and build custom MCP agents that have tool access, without using closed source or application clients.
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
- 💡 Let developers easily connect any LLM to tools like web browsing, file operations, and more.
88
+ ---
88
89
 
89
- - If you want to get started quickly check out [mcp-use.com website](https://mcp-use.com/) to build and deploy agents with your favorite MCP servers.
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
- | Supports | |
94
- | :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
95
- | **Primitives** | [![Tools](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=primitive-tools&label=Tools&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![Resources](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=primitive-resources&label=Resources&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![Prompts](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=primitive-prompts&label=Prompts&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![Sampling](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=primitive-sampling&label=Sampling&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![Elicitation](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=primitive-elicitation&label=Elicitation&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![Authentication](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=primitive-authentication&label=Authentication&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) |
96
- | **Transports** | [![Stdio](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=transport-stdio&label=Stdio&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![SSE](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=transport-sse&label=SSE&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![Streamable HTTP](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=transport-streamableHttp&label=Streamable%20HTTP&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) |
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** | [![Tools](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-primitive/tools&label=Tools&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![Resources](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-primitive/resources&label=Resources&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![Prompts](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-primitive/prompts&label=Prompts&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![Sampling](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-primitive/sampling&label=Sampling&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![Elicitation](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-primitive/elicitation&label=Elicitation&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![Authentication](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-primitive/authentication&label=Authentication&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) |
100
+ | **Transports** | [![Stdio](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-transport/stdio&label=Stdio&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![SSE](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-transport/sse&label=SSE&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![Streamable HTTP](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-transport/streamable_http&label=Streamable%20HTTP&style=flat)](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
- # Quick start
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
- 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.
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
- 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.
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
- 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.
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
- MCP-Use allows you to restrict which tools are available to the agent, providing better security and control over agent capabilities:
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
- 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.
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
- # Direct Tool Calls (Without LLM)
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
- MCP-Use provides a built-in debug mode that increases log verbosity and helps diagnose issues in your agent implementation.
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 MCP-Use in your research or project, please cite:
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 = {MCP-Use: MCP Library for Python},
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
- 🌐 MCP-Use is the open source way to connect **any LLM to any MCP server** and build custom MCP agents that have tool access, without using closed source or application clients.
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
- 💡 Let developers easily connect any LLM to tools like web browsing, file operations, and more.
41
+ ---
41
42
 
42
- - If you want to get started quickly check out [mcp-use.com website](https://mcp-use.com/) to build and deploy agents with your favorite MCP servers.
43
- - 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
- | Supports | |
47
- | :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
48
- | **Primitives** | [![Tools](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=primitive-tools&label=Tools&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![Resources](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=primitive-resources&label=Resources&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![Prompts](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=primitive-prompts&label=Prompts&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![Sampling](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=primitive-sampling&label=Sampling&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![Elicitation](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=primitive-elicitation&label=Elicitation&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![Authentication](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=primitive-authentication&label=Authentication&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) |
49
- | **Transports** | [![Stdio](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=transport-stdio&label=Stdio&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![SSE](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=transport-sse&label=SSE&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) [![Streamable HTTP](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/tests.yml?job=transport-streamableHttp&label=Streamable%20HTTP&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/tests.yml) |
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** | [![Tools](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-primitive/tools&label=Tools&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![Resources](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-primitive/resources&label=Resources&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![Prompts](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-primitive/prompts&label=Prompts&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![Sampling](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-primitive/sampling&label=Sampling&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![Elicitation](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-primitive/elicitation&label=Elicitation&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![Authentication](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-primitive/authentication&label=Authentication&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) |
53
+ | **Transports** | [![Stdio](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-transport/stdio&label=Stdio&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![SSE](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-transport/sse&label=SSE&style=flat)](https://github.com/pietrozullo/mcp-use/actions/workflows/ci.yml) [![Streamable HTTP](https://img.shields.io/github/actions/workflow/status/pietrozullo/mcp-use/ci.yml?job=python-transport/streamable_http&label=Streamable%20HTTP&style=flat)](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
- # Quick start
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
- 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.
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
- 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.
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
- 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.
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
- MCP-Use allows you to restrict which tools are available to the agent, providing better security and control over agent capabilities:
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
- 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.
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
- # Direct Tool Calls (Without LLM)
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
- MCP-Use provides a built-in debug mode that increases log verbosity and helps diagnose issues in your agent implementation.
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 MCP-Use in your research or project, please cite:
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 = {MCP-Use: MCP Library for Python},
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())