mcp-use 1.3.0__tar.gz → 1.3.2__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 (160) hide show
  1. mcp_use-1.3.2/.env.example +61 -0
  2. mcp_use-1.3.2/.github/release-drafter.yml +32 -0
  3. mcp_use-1.3.2/.github/workflows/changelog.yml +74 -0
  4. mcp_use-1.3.2/.github/workflows/claude.yml +36 -0
  5. {mcp_use-1.3.0 → mcp_use-1.3.2}/.github/workflows/publish.yml +5 -6
  6. mcp_use-1.3.2/.github/workflows/release-drafter.yml +41 -0
  7. mcp_use-1.3.2/.github/workflows/transportstests.yml +41 -0
  8. mcp_use-1.3.2/.github/workflows/update-readme.yml +110 -0
  9. {mcp_use-1.3.0 → mcp_use-1.3.2}/.gitignore +4 -0
  10. mcp_use-1.3.2/CHANGELOG.md +0 -0
  11. mcp_use-1.3.2/CLAUDE.md +228 -0
  12. mcp_use-1.3.2/CODE_OF_CONDUCT.md +128 -0
  13. mcp_use-1.3.0/README.md → mcp_use-1.3.2/PKG-INFO +121 -22
  14. mcp_use-1.3.0/PKG-INFO → mcp_use-1.3.2/README.md +70 -65
  15. mcp_use-1.3.2/docs/api-reference/adapters.mdx +519 -0
  16. {mcp_use-1.3.0 → mcp_use-1.3.2}/docs/api-reference/introduction.mdx +3 -19
  17. {mcp_use-1.3.0 → mcp_use-1.3.2}/docs/api-reference/mcpagent.mdx +8 -0
  18. mcp_use-1.3.2/docs/api-reference/mcpclient.mdx +492 -0
  19. mcp_use-1.3.2/docs/changelog.mdx +43 -0
  20. mcp_use-1.3.2/docs/community/showcase.mdx +196 -0
  21. mcp_use-1.3.2/docs/development/observability.mdx +274 -0
  22. mcp_use-1.3.2/docs/development/telemetry.mdx +173 -0
  23. {mcp_use-1.3.0 → mcp_use-1.3.2}/docs/development.mdx +2 -1
  24. mcp_use-1.3.2/docs/docs.json +259 -0
  25. mcp_use-1.3.2/docs/essentials/agent-configuration.mdx +473 -0
  26. mcp_use-1.3.2/docs/essentials/client-configuration.mdx +270 -0
  27. mcp_use-1.3.2/docs/essentials/configuration.mdx +162 -0
  28. {mcp_use-1.3.0 → mcp_use-1.3.2}/docs/essentials/connection-types.mdx +6 -17
  29. mcp_use-1.3.2/docs/essentials/llm-integration.mdx +306 -0
  30. {mcp_use-1.3.0 → mcp_use-1.3.2}/docs/essentials/server-manager.mdx +1 -0
  31. mcp_use-1.3.2/docs/fonts.css +24 -0
  32. {mcp_use-1.3.0/docs → mcp_use-1.3.2/docs/guides}/building-custom-agents.mdx +85 -24
  33. mcp_use-1.3.2/docs/guides/logging.mdx +152 -0
  34. mcp_use-1.3.2/docs/guides/multi-server-setup.mdx +451 -0
  35. mcp_use-1.3.2/docs/guides/security.mdx +596 -0
  36. mcp_use-1.3.2/docs/guides/streaming.mdx +453 -0
  37. mcp_use-1.3.2/docs/images/01.png +0 -0
  38. mcp_use-1.3.2/docs/images/02.png +0 -0
  39. mcp_use-1.3.2/docs/images/configuration-dark.png +0 -0
  40. mcp_use-1.3.2/docs/images/configuration-light.png +0 -0
  41. mcp_use-1.3.2/docs/images/examples-dark.png +0 -0
  42. mcp_use-1.3.2/docs/images/examples-light.png +0 -0
  43. mcp_use-1.3.2/docs/images/installation-dark.png +0 -0
  44. mcp_use-1.3.2/docs/images/installation-light.png +0 -0
  45. mcp_use-1.3.2/docs/images/quickstart-dark.png +0 -0
  46. mcp_use-1.3.2/docs/images/quickstart-light.png +0 -0
  47. mcp_use-1.3.2/docs/index.mdx +187 -0
  48. mcp_use-1.3.2/docs/installation.mdx +303 -0
  49. mcp_use-1.3.2/docs/logo/light.svg +8 -0
  50. mcp_use-1.3.2/docs/logo/react.svg +1 -0
  51. mcp_use-1.3.2/docs/quickstart.mdx +184 -0
  52. {mcp_use-1.3.0 → mcp_use-1.3.2}/docs/snippets/snippet-intro.mdx +6 -0
  53. mcp_use-1.3.2/docs/snippets/youtube-embed.mdx +14 -0
  54. mcp_use-1.3.2/docs/troubleshooting/common-issues.mdx +388 -0
  55. mcp_use-1.3.2/docs/troubleshooting/connection-errors.mdx +667 -0
  56. mcp_use-1.3.2/docs/troubleshooting/performance.mdx +553 -0
  57. {mcp_use-1.3.0 → mcp_use-1.3.2}/examples/mcp_everything.py +1 -3
  58. {mcp_use-1.3.0 → mcp_use-1.3.2}/examples/sandbox_everything.py +1 -4
  59. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/__init__.py +2 -0
  60. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/adapters/base.py +2 -6
  61. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/adapters/langchain_adapter.py +4 -11
  62. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/agents/base.py +1 -3
  63. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/agents/mcpagent.py +121 -45
  64. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/agents/prompts/system_prompt_builder.py +1 -3
  65. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/client.py +26 -11
  66. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/config.py +9 -9
  67. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/connectors/base.py +136 -32
  68. mcp_use-1.3.2/mcp_use/connectors/http.py +152 -0
  69. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/connectors/sandbox.py +11 -16
  70. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/connectors/stdio.py +8 -5
  71. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/connectors/websocket.py +8 -5
  72. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/logging.py +1 -1
  73. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/managers/server_manager.py +5 -16
  74. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/managers/tools/disconnect_server.py +1 -3
  75. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/managers/tools/get_active_server.py +1 -4
  76. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/managers/tools/search_tools.py +29 -36
  77. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/managers/tools/use_tool.py +5 -18
  78. mcp_use-1.3.2/mcp_use/observability/__init__.py +8 -0
  79. mcp_use-1.3.2/mcp_use/observability/laminar.py +21 -0
  80. mcp_use-1.3.2/mcp_use/observability/langfuse.py +35 -0
  81. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/session.py +1 -4
  82. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/task_managers/__init__.py +2 -1
  83. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/task_managers/base.py +10 -4
  84. mcp_use-1.3.2/mcp_use/task_managers/streamable_http.py +81 -0
  85. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/task_managers/websocket.py +5 -0
  86. mcp_use-1.3.2/mcp_use/telemetry/__init__.py +0 -0
  87. mcp_use-1.3.2/mcp_use/telemetry/events.py +93 -0
  88. mcp_use-1.3.2/mcp_use/telemetry/telemetry.py +306 -0
  89. mcp_use-1.3.2/mcp_use/telemetry/utils.py +48 -0
  90. mcp_use-1.3.2/mcp_use/utils.py +27 -0
  91. {mcp_use-1.3.0 → mcp_use-1.3.2}/pyproject.toml +12 -4
  92. {mcp_use-1.3.0 → mcp_use-1.3.2}/ruff.toml +1 -1
  93. mcp_use-1.3.2/static/logo_white.svg +8 -0
  94. mcp_use-1.3.2/tests/integration/__init__.py +1 -0
  95. mcp_use-1.3.2/tests/integration/servers_for_testing/__init__.py +1 -0
  96. mcp_use-1.3.2/tests/integration/servers_for_testing/custom_streaming_server.py +224 -0
  97. mcp_use-1.3.2/tests/integration/servers_for_testing/long_timeout_test_server.py +171 -0
  98. mcp_use-1.3.2/tests/integration/servers_for_testing/simple_server.py +32 -0
  99. mcp_use-1.3.2/tests/integration/servers_for_testing/timeout_test_server.py +151 -0
  100. mcp_use-1.3.2/tests/integration/transports/customStreaming/__init__.py +1 -0
  101. mcp_use-1.3.2/tests/integration/transports/customStreaming/test_custom_streaming_integration.py +307 -0
  102. mcp_use-1.3.2/tests/integration/transports/sse/test_connection_state_tracking.py +401 -0
  103. mcp_use-1.3.2/tests/integration/transports/sse/test_sse_integration.py +71 -0
  104. mcp_use-1.3.2/tests/integration/transports/stdio/test_stdio_integration.py +53 -0
  105. mcp_use-1.3.2/tests/integration/transports/streamableHttp/test_streamable_http_integration.py +74 -0
  106. {mcp_use-1.3.0 → mcp_use-1.3.2}/tests/unit/test_client.py +7 -5
  107. {mcp_use-1.3.0 → mcp_use-1.3.2}/tests/unit/test_config.py +23 -11
  108. {mcp_use-1.3.0 → mcp_use-1.3.2}/tests/unit/test_http_connector.py +131 -67
  109. {mcp_use-1.3.0 → mcp_use-1.3.2}/tests/unit/test_sandbox_connector.py +3 -9
  110. mcp_use-1.3.2/tests/unit/test_search_tools_issue_138.py +185 -0
  111. {mcp_use-1.3.0 → mcp_use-1.3.2}/tests/unit/test_session.py +7 -9
  112. {mcp_use-1.3.0 → mcp_use-1.3.2}/tests/unit/test_stdio_connector.py +38 -25
  113. mcp_use-1.3.2/tests/unit/test_websocket_connection_manager.py +81 -0
  114. mcp_use-1.3.0/docs/docs.json +0 -88
  115. mcp_use-1.3.0/docs/essentials/configuration.mdx +0 -293
  116. mcp_use-1.3.0/docs/essentials/debugging.mdx +0 -103
  117. mcp_use-1.3.0/docs/essentials/llm-integration.mdx +0 -26
  118. mcp_use-1.3.0/docs/introduction.mdx +0 -62
  119. mcp_use-1.3.0/docs/logo/dark.svg +0 -7
  120. mcp_use-1.3.0/docs/logo/light.svg +0 -7
  121. mcp_use-1.3.0/docs/quickstart.mdx +0 -424
  122. mcp_use-1.3.0/mcp_use/connectors/http.py +0 -82
  123. mcp_use-1.3.0/mcp_use/types/clientoptions.py +0 -23
  124. {mcp_use-1.3.0 → mcp_use-1.3.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  125. {mcp_use-1.3.0 → mcp_use-1.3.2}/.github/pull_request_template.md +0 -0
  126. {mcp_use-1.3.0 → mcp_use-1.3.2}/.github/workflows/unittests.yml +0 -0
  127. {mcp_use-1.3.0 → mcp_use-1.3.2}/.pre-commit-config.yaml +0 -0
  128. {mcp_use-1.3.0 → mcp_use-1.3.2}/CONTRIBUTING.md +0 -0
  129. {mcp_use-1.3.0 → mcp_use-1.3.2}/LICENSE +0 -0
  130. {mcp_use-1.3.0 → mcp_use-1.3.2}/docs/README.md +0 -0
  131. {mcp_use-1.3.0 → mcp_use-1.3.2}/docs/favicon.svg +0 -0
  132. {mcp_use-1.3.0 → mcp_use-1.3.2}/docs/images/hero-dark.png +0 -0
  133. {mcp_use-1.3.0 → mcp_use-1.3.2}/docs/images/hero-light.png +0 -0
  134. /mcp_use-1.3.0/static/logo_white.svg → /mcp_use-1.3.2/docs/logo/dark.svg +0 -0
  135. {mcp_use-1.3.0 → mcp_use-1.3.2}/examples/airbnb_mcp.json +0 -0
  136. {mcp_use-1.3.0 → mcp_use-1.3.2}/examples/airbnb_use.py +0 -0
  137. {mcp_use-1.3.0 → mcp_use-1.3.2}/examples/blender_use.py +0 -0
  138. {mcp_use-1.3.0 → mcp_use-1.3.2}/examples/browser_mcp.json +0 -0
  139. {mcp_use-1.3.0 → mcp_use-1.3.2}/examples/browser_use.py +0 -0
  140. {mcp_use-1.3.0 → mcp_use-1.3.2}/examples/chat_example.py +0 -0
  141. {mcp_use-1.3.0 → mcp_use-1.3.2}/examples/filesystem_use.py +0 -0
  142. {mcp_use-1.3.0 → mcp_use-1.3.2}/examples/http_example.py +0 -0
  143. {mcp_use-1.3.0 → mcp_use-1.3.2}/examples/multi_server_example.py +0 -0
  144. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/adapters/__init__.py +0 -0
  145. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/agents/__init__.py +0 -0
  146. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/agents/prompts/templates.py +0 -0
  147. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/connectors/__init__.py +0 -0
  148. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/connectors/utils.py +0 -0
  149. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/managers/__init__.py +0 -0
  150. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/managers/tools/__init__.py +0 -0
  151. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/managers/tools/base_tool.py +0 -0
  152. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/managers/tools/connect_server.py +0 -0
  153. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/managers/tools/list_servers_tool.py +0 -0
  154. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/task_managers/sse.py +0 -0
  155. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/task_managers/stdio.py +0 -0
  156. {mcp_use-1.3.0 → mcp_use-1.3.2}/mcp_use/types/sandbox.py +0 -0
  157. {mcp_use-1.3.0 → mcp_use-1.3.2}/pytest.ini +0 -0
  158. {mcp_use-1.3.0 → mcp_use-1.3.2}/static/logo_black.svg +0 -0
  159. {mcp_use-1.3.0 → mcp_use-1.3.2}/tests/conftest.py +0 -0
  160. {mcp_use-1.3.0 → mcp_use-1.3.2}/tests/unit/test_logging.py +0 -0
@@ -0,0 +1,61 @@
1
+ # =============================================================================
2
+ # MCP-Use Environment Configuration
3
+ # =============================================================================
4
+ # Copy this file to .env and fill in your actual values
5
+ # The .env file is already in .gitignore and won't be committed
6
+
7
+ # =============================================================================
8
+ # Observability - Optional but recommended for debugging and monitoring
9
+ # =============================================================================
10
+
11
+ # Langfuse Configuration (https://langfuse.com)
12
+ # Sign up at https://cloud.langfuse.com or self-host
13
+ LANGFUSE_PUBLIC_KEY=pk-lf-your-public-key-here
14
+ LANGFUSE_SECRET_KEY=sk-lf-your-secret-key-here
15
+ # LANGFUSE_HOST=https://cloud.langfuse.com # Default, uncomment for self-hosted
16
+
17
+ # Laminar Configuration (https://www.lmnr.ai)
18
+ # Sign up at https://www.lmnr.ai and get your project API key
19
+ LAMINAR_PROJECT_API_KEY=your-laminar-project-api-key-here
20
+
21
+ # =============================================================================
22
+ # LLM Provider API Keys
23
+ # =============================================================================
24
+
25
+ # OpenAI
26
+ OPENAI_API_KEY=sk-your-openai-api-key-here
27
+
28
+ # Anthropic
29
+ ANTHROPIC_API_KEY=sk-ant-your-anthropic-api-key-here
30
+
31
+ # Google (for Gemini)
32
+ GOOGLE_API_KEY=your-google-api-key-here
33
+
34
+ # Azure OpenAI
35
+ AZURE_OPENAI_API_KEY=your-azure-openai-key-here
36
+ AZURE_OPENAI_ENDPOINT=https://your-resource-name.openai.azure.com/
37
+
38
+ # =============================================================================
39
+ # Debug and Development
40
+ # =============================================================================
41
+
42
+ # MCP-Use Debug Level (1=INFO, 2=DEBUG)
43
+ DEBUG=1
44
+ # Alternative debug variable
45
+ MCP_USE_DEBUG=1
46
+
47
+ # Disable specific features (set to 'false' to disable)
48
+ # MCP_USE_LANGFUSE=false
49
+ # MCP_USE_LAMINAR=false
50
+ # MCP_USE_TELEMETRY=false
51
+
52
+ # =============================================================================
53
+ # MCP Server Specific Configuration
54
+ # =============================================================================
55
+
56
+ # E2B Sandbox (for sandboxed execution)
57
+ E2B_API_KEY=your-e2b-api-key-here
58
+
59
+ # Custom MCP server endpoints (if using HTTP/WebSocket servers)
60
+ # MCP_SERVER_URL=http://localhost:8080
61
+ # MCP_WEBSOCKET_URL=ws://localhost:8081
@@ -0,0 +1,32 @@
1
+ name-template: 'v$RESOLVED_VERSION 🌈'
2
+ tag-template: 'v$RESOLVED_VERSION'
3
+ categories:
4
+ - title: '🚀 Features'
5
+ labels:
6
+ - 'feature'
7
+ - 'feat'
8
+ - 'enhancement'
9
+ - title: '🐛 Bug Fixes'
10
+ labels:
11
+ - 'fix'
12
+ - 'bugfix'
13
+ - 'bug'
14
+ - title: '🧰 Maintenance'
15
+ label: 'chore'
16
+ change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
17
+ change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
18
+ version-resolver:
19
+ major:
20
+ labels:
21
+ - 'major'
22
+ minor:
23
+ labels:
24
+ - 'minor'
25
+ patch:
26
+ labels:
27
+ - 'patch'
28
+ default: patch
29
+ template: |
30
+ ## Changes
31
+
32
+ $CHANGES
@@ -0,0 +1,74 @@
1
+ name: "Update Changelogs"
2
+
3
+ on:
4
+ release:
5
+ types: [released]
6
+
7
+ jobs:
8
+ update:
9
+ runs-on: ubuntu-latest
10
+
11
+ permissions:
12
+ # Give the default GITHUB_TOKEN write permission to commit and push the
13
+ # updated CHANGELOG back to the repository.
14
+ # https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
15
+ contents: write
16
+
17
+ steps:
18
+ - name: Checkout code
19
+ uses: actions/checkout@v4
20
+ with:
21
+ ref: ${{ github.event.release.target_commitish }}
22
+ fetch-depth: 0
23
+ token: ${{ secrets.GITHUB_TOKEN }}
24
+
25
+ - name: Update Changelog
26
+ uses: stefanzweifel/changelog-updater-action@v1
27
+ with:
28
+ latest-version: ${{ github.event.release.tag_name }}
29
+ release-notes: ${{ github.event.release.body }}
30
+
31
+ - name: Update Docs Changelog
32
+ run: |
33
+ # Get current date in the required format
34
+ CURRENT_DATE=$(date +"%Y‑%m‑%d")
35
+
36
+ # Create the new changelog entry
37
+ NEW_ENTRY="<Update label=\"$CURRENT_DATE\">
38
+ ## ${{ github.event.release.tag_name }}
39
+ ${{ github.event.release.body }}
40
+ </Update>
41
+
42
+ "
43
+
44
+ # Read the current changelog and insert the new entry after the front matter
45
+ python -c "
46
+ import re
47
+
48
+ # Read the current changelog
49
+ with open('docs/changelog.mdx', 'r') as f:
50
+ content = f.read()
51
+
52
+ # Find the end of the front matter
53
+ front_matter_end = content.find('---', content.find('---') + 1) + 3
54
+
55
+ # Split content into front matter and body
56
+ front_matter = content[:front_matter_end]
57
+ body = content[front_matter_end:]
58
+
59
+ # Create new entry
60
+ new_entry = '''$NEW_ENTRY'''
61
+
62
+ # Combine and write back
63
+ new_content = front_matter + '\n\n' + new_entry + body.lstrip()
64
+
65
+ with open('docs/changelog.mdx', 'w') as f:
66
+ f.write(new_content)
67
+ "
68
+
69
+ - name: Commit updated CHANGELOG
70
+ uses: stefanzweifel/git-auto-commit-action@v5
71
+ with:
72
+ branch: ${{ github.event.release.target_commitish }}
73
+ commit_message: Update CHANGELOG and docs changelog
74
+ file_pattern: CHANGELOG.md docs/changelog.mdx
@@ -0,0 +1,36 @@
1
+ name: Claude PR Assistant
2
+
3
+ on:
4
+ issue_comment:
5
+ types: [created]
6
+ pull_request_review_comment:
7
+ types: [created]
8
+ issues:
9
+ types: [opened, assigned]
10
+ pull_request_review:
11
+ types: [submitted]
12
+
13
+ jobs:
14
+ claude-code-action:
15
+ if: |
16
+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17
+ (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18
+ (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19
+ (github.event_name == 'issues' && contains(github.event.issue.body, '@claude'))
20
+ runs-on: ubuntu-latest
21
+ permissions:
22
+ contents: read
23
+ pull-requests: read
24
+ issues: read
25
+ id-token: write
26
+ steps:
27
+ - name: Checkout repository
28
+ uses: actions/checkout@v4
29
+ with:
30
+ fetch-depth: 1
31
+
32
+ - name: Run Claude PR Action
33
+ uses: anthropics/claude-code-action@beta
34
+ with:
35
+ anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
36
+ timeout_minutes: "60"
@@ -1,4 +1,4 @@
1
- name: Check Version Bump and Publish to PyPI
1
+ name: Release
2
2
 
3
3
  on:
4
4
  workflow_run:
@@ -66,14 +66,13 @@ jobs:
66
66
  - name: Create Release
67
67
  if: steps.check-version.outputs.is_new_version == 'true'
68
68
  id: create_release
69
- uses: actions/create-release@v1
70
- env:
71
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69
+ uses: ncipollo/release-action@v1
72
70
  with:
73
- tag_name: v${{ steps.check-version.outputs.new_version }}
74
- release_name: Release v${{ steps.check-version.outputs.new_version }}
71
+ tag: v${{ steps.check-version.outputs.new_version }}
72
+ name: Release v${{ steps.check-version.outputs.new_version }}
75
73
  draft: false
76
74
  prerelease: false
75
+ generateReleaseNotes: false
77
76
 
78
77
  - name: Publish to PyPI
79
78
  if: steps.check-version.outputs.is_new_version == 'true'
@@ -0,0 +1,41 @@
1
+ name: Release Drafter
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ # pull_request event is required only for autolabeler
9
+ pull_request:
10
+ # Only following types are handled by the action, but one can default to all as well
11
+ types: [opened, reopened, synchronize]
12
+ # pull_request_target event is required for autolabeler to support PRs from forks
13
+ # pull_request_target:
14
+ # types: [opened, reopened, synchronize]
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ update_release_draft:
21
+ permissions:
22
+ # write permission is required to create a github release
23
+ contents: write
24
+ # write permission is required for autolabeler
25
+ # otherwise, read permission is required at least
26
+ pull-requests: write
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ # (Optional) GitHub Enterprise requires GHE_HOST variable set
30
+ #- name: Set GHE_HOST
31
+ # run: |
32
+ # echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
33
+
34
+ # Drafts your next Release notes as Pull Requests are merged into "master"
35
+ - uses: release-drafter/release-drafter@v6
36
+ # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
37
+ # with:
38
+ # config-name: my-config.yml
39
+ # disable-autolabeler: true
40
+ env:
41
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,41 @@
1
+ name: Transports
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ branches: [main]
7
+
8
+ jobs:
9
+ transports:
10
+ name: "${{ matrix.transport }}"
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ transport: [stdio, sse, streamableHttp]
16
+ python-version: ["3.11"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v4
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install uv
27
+ run: |
28
+ pip install uv
29
+
30
+ - name: Install dependencies
31
+ run: |
32
+ # Install project with dev and optional extras similar to unit tests environment
33
+ uv pip install --system .[dev,anthropic,openai,search,e2b]
34
+
35
+ - name: Lint with ruff
36
+ run: |
37
+ ruff check .
38
+
39
+ - name: Run integration tests for ${{ matrix.transport }} transport
40
+ run: |
41
+ pytest tests/integration/transports/${{ matrix.transport }}
@@ -0,0 +1,110 @@
1
+ name: Update README
2
+
3
+ on:
4
+ # On manual launch
5
+ workflow_dispatch:
6
+ # Scheduled interval: Use CRON format https://crontab.guru/
7
+ schedule:
8
+ - cron: "0 0 * * 0" # Every sunday at midnight
9
+
10
+ permissions: read-all
11
+
12
+ concurrency:
13
+ group: ${{ github.ref }}-${{ github.workflow }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ update-dependents:
18
+ name: Update GitHub Dependents Info
19
+ runs-on: ubuntu-latest
20
+ permissions:
21
+ contents: write
22
+ pull-requests: write
23
+ steps:
24
+ # Git Checkout
25
+ - name: Checkout Code
26
+ uses: actions/checkout@v4
27
+ with:
28
+ token: ${{ secrets.GITHUB_TOKEN }}
29
+ fetch-depth: 0
30
+
31
+ # Setup Python
32
+ - name: Setup Python
33
+ uses: actions/setup-python@v4
34
+ with:
35
+ python-version: '3.11'
36
+
37
+ # Install github-dependents-info
38
+ - name: Install github-dependents-info
39
+ run: pip install -U github-dependents-info
40
+
41
+ # Generate dependents info
42
+ - name: Generate GitHub Dependents Info
43
+ run: |
44
+ # Get dependents data in JSON format
45
+ github-dependents-info --repo ${{ github.repository }} --sort stars --minstars 1 --json > dependents.json
46
+
47
+ # Extract total count and stars
48
+ TOTAL_REPOS=$(jq -r '.total_dependents_number' dependents.json)
49
+ PUBLIC_REPOS=$(jq -r '.public_dependents_number' dependents.json)
50
+ TOTAL_STARS=$(jq -r '[.all_public_dependent_repos[].stars] | add' dependents.json)
51
+
52
+ # Create the dependents table using HTML for full width
53
+ cat > dependents_table.md << 'EOF'
54
+ <table>
55
+ <tr>
56
+ <th width="400">Repository</th>
57
+ <th>Stars</th>
58
+ </tr>
59
+ EOF
60
+
61
+ # Add top repositories to the table (limit to top 10) with avatars
62
+ jq -r '.all_public_dependent_repos[:10] | .[] | " <tr>\n <td><img src=\"\(.img)\" width=\"20\" height=\"20\" style=\"vertical-align: middle; margin-right: 8px;\"> <a href=\"https://github.com/\(.name)\"><strong>\(.owner)/\(.repo_name)</strong></a></td>\n <td>⭐ \(.stars)</td>\n </tr>"' dependents.json >> dependents_table.md
63
+
64
+ # Close the table
65
+ echo "</table>" >> dependents_table.md
66
+
67
+ # Update README by replacing content between tags
68
+ awk '
69
+ BEGIN { in_section = 0 }
70
+ /<!-- gh-dependents-info-used-by-start -->/ {
71
+ print $0
72
+ print ""
73
+ system("cat dependents_table.md")
74
+ print ""
75
+ in_section = 1
76
+ next
77
+ }
78
+ /<!-- gh-dependents-info-used-by-end -->/ {
79
+ in_section = 0
80
+ print $0
81
+ next
82
+ }
83
+ !in_section { print }
84
+ ' README.md > README_updated.md
85
+
86
+ mv README_updated.md README.md
87
+ rm dependents_table.md dependents.json
88
+ env:
89
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90
+
91
+ # Check for changes and commit directly
92
+ - name: Check for changes
93
+ id: changes
94
+ run: |
95
+ if git diff --quiet README.md; then
96
+ echo "has_changes=false" >> $GITHUB_OUTPUT
97
+ else
98
+ echo "has_changes=true" >> $GITHUB_OUTPUT
99
+ fi
100
+
101
+ - name: Create Pull Request
102
+ if: steps.changes.outputs.has_changes == 'true'
103
+ uses: peter-evans/create-pull-request@v6
104
+ with:
105
+ token: ${{ secrets.GITHUB_TOKEN }}
106
+ commit-message: "chore: update dependents info (automated)"
107
+ title: "chore: update dependents info (automated)"
108
+ body: "This PR updates the README with the latest dependents information."
109
+ branch: chore/update-dependents-info-${{ github.run_id }}
110
+ delete-branch: true
@@ -122,3 +122,7 @@ dmypy.json
122
122
 
123
123
  # macOS
124
124
  .DS_Store
125
+
126
+ # AI
127
+ .cursor
128
+ .claude
File without changes
@@ -0,0 +1,228 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ **mcp-use** is a unified MCP (Model Context Protocol) client library that enables any LLM to connect to MCP servers and build custom agents with tool access. The library provides a high-level Python interface for connecting LangChain-compatible LLMs to MCP tools like web browsing, file operations, and more.
8
+
9
+ ## Development Commands
10
+
11
+ ### Setup
12
+
13
+ ```bash
14
+ # Activate virtual environment (if it exists)
15
+ source env/bin/activate
16
+
17
+ # Create virtual environment if it doesn't exist
18
+ # python -m venv env && source env/bin/activate
19
+
20
+ # Install for development
21
+ pip install -e ".[dev,search]"
22
+
23
+ # Install with optional dependencies
24
+ pip install -e ".[dev,anthropic,openai,e2b,search]"
25
+ ```
26
+
27
+ ### Code Quality
28
+
29
+ ```bash
30
+ # Run linting and formatting
31
+ ruff check --fix
32
+ ruff format
33
+
34
+ # Run type checking
35
+ mypy mcp_use/
36
+
37
+ # Run pre-commit hooks
38
+ pre-commit run --all-files
39
+ ```
40
+
41
+ ### Testing
42
+
43
+ ```bash
44
+ # Run all tests
45
+ pytest
46
+
47
+ # Run specific test types
48
+ pytest tests/unit/ # Unit tests only
49
+ pytest tests/integration/ # Integration tests only
50
+
51
+ # Run with coverage
52
+ pytest --cov=mcp_use --cov-report=html
53
+
54
+ # Run specific test file
55
+ pytest tests/unit/test_client.py
56
+
57
+ # Run with debug output
58
+ DEBUG=2 pytest tests/unit/test_client.py -v -s
59
+ ```
60
+
61
+ ### Local Development
62
+
63
+ ```bash
64
+ # Debug mode environment variable
65
+ export DEBUG=1 # INFO level
66
+ export DEBUG=2 # DEBUG level (full verbose)
67
+
68
+ # Or set MCP_USE_DEBUG
69
+ export MCP_USE_DEBUG=2
70
+ ```
71
+
72
+ ## Architecture Overview
73
+
74
+ ### Core Components
75
+
76
+ **MCPClient** (`mcp_use/client.py`)
77
+
78
+ - Main entry point for MCP server management
79
+ - Handles configuration loading from files or dictionaries
80
+ - Manages multiple MCP server sessions
81
+ - Supports sandboxed execution via E2B
82
+
83
+ **MCPAgent** (`mcp_use/agents/mcpagent.py`)
84
+
85
+ - High-level agent interface using LangChain's agent framework
86
+ - Integrates LLMs with MCP tools
87
+ - Supports streaming responses and conversation memory
88
+ - Can use ServerManager for dynamic server selection
89
+
90
+ **MCPSession** (`mcp_use/session.py`)
91
+
92
+ - Manages individual MCP server connections
93
+ - Handles tool discovery and resource management
94
+ - Maintains connection state and lifecycle
95
+
96
+ **Connectors** (`mcp_use/connectors/`)
97
+
98
+ - Abstraction layer for different MCP transport protocols
99
+ - `StdioConnector`: Process-based MCP servers
100
+ - `HttpConnector`: HTTP-based MCP servers
101
+ - `WebSocketConnector`: WebSocket-based MCP servers
102
+ - `SandboxConnector`: E2B sandboxed execution
103
+
104
+ **ServerManager** (`mcp_use/managers/server_manager.py`)
105
+
106
+ - Provides dynamic server selection capabilities
107
+ - Allows agents to choose appropriate servers for tasks
108
+ - Manages server tool discovery and activation
109
+
110
+ ### Key Patterns
111
+
112
+ **Configuration-Driven Design**: Servers are configured via JSON files or dictionaries with `mcpServers` key containing server definitions.
113
+
114
+ **Async/Await**: All I/O operations are asynchronous using asyncio patterns.
115
+
116
+ **LangChain Integration**: Tools are converted to LangChain format via adapters, enabling use with any LangChain-compatible LLM.
117
+
118
+ **Multi-Transport Support**: Supports stdio, HTTP, WebSocket, and sandboxed connections to MCP servers.
119
+
120
+ **Telemetry**: Built-in telemetry using PostHog and Scarf.sh for usage analytics (can be disabled).
121
+
122
+ ## Configuration Examples
123
+
124
+ ### Basic Server Configuration
125
+
126
+ ```json
127
+ {
128
+ "mcpServers": {
129
+ "playwright": {
130
+ "command": "npx",
131
+ "args": ["@playwright/mcp@latest"],
132
+ "env": { "DISPLAY": ":1" }
133
+ }
134
+ }
135
+ }
136
+ ```
137
+
138
+ ### HTTP Server Configuration
139
+
140
+ ```json
141
+ {
142
+ "mcpServers": {
143
+ "http_server": {
144
+ "url": "http://localhost:8931/sse"
145
+ }
146
+ }
147
+ }
148
+ ```
149
+
150
+ ### Multi-Server Configuration
151
+
152
+ ```json
153
+ {
154
+ "mcpServers": {
155
+ "playwright": {
156
+ "command": "npx",
157
+ "args": ["@playwright/mcp@latest"]
158
+ },
159
+ "airbnb": {
160
+ "command": "npx",
161
+ "args": ["-y", "@openbnb/mcp-server-airbnb"]
162
+ }
163
+ }
164
+ }
165
+ ```
166
+
167
+ ## Code Style and Standards
168
+
169
+ - **Line Length**: 200 characters (configured in ruff.toml)
170
+ - **Python Version**: 3.11+ required
171
+ - **Formatting**: Use Ruff for formatting and linting
172
+ - **Type Hints**: All public APIs should have type hints
173
+ - **Async Patterns**: Use async/await consistently for I/O operations
174
+ - **Error Handling**: Proper exception handling with logging
175
+ - **Documentation**: Docstrings follow Google style
176
+
177
+ ## Testing Strategy
178
+
179
+ ### Unit Tests (`tests/unit/`)
180
+
181
+ - Test individual components in isolation
182
+ - Mock external dependencies
183
+ - Focus on business logic and edge cases
184
+
185
+ ### Integration Tests (`tests/integration/`)
186
+
187
+ - Test component interactions
188
+ - Include real MCP server integrations
189
+ - Organized by transport type (stdio, sse, websocket, etc.)
190
+ - Custom test servers in `tests/integration/servers_for_testing/`
191
+
192
+ ### Test Configuration
193
+
194
+ - Uses pytest with asyncio mode
195
+ - Fixtures defined in `conftest.py`
196
+ - Test servers provide controlled MCP environments
197
+
198
+ ## Important Development Notes
199
+
200
+ - **Environment Setup**: Requires Python 3.11+ and appropriate LangChain provider packages
201
+ - **MCP Protocol**: Built on Model Context Protocol specification
202
+ - **LangChain Compatibility**: Only models with tool calling capabilities are supported
203
+ - **Resource Management**: Always properly close sessions to avoid resource leaks
204
+ - **Debugging**: Use DEBUG environment variable or `mcp_use.set_debug()` for verbose logging
205
+ - **Memory Management**: MCPAgent supports conversation memory for context retention
206
+ - **Security**: Tool access can be restricted via `disallowed_tools` parameter
207
+
208
+ ## Common Development Tasks
209
+
210
+ ### Adding a New Connector
211
+
212
+ 1. Extend `BaseConnector` in `mcp_use/connectors/`
213
+ 2. Implement required async methods
214
+ 3. Add connector to factory in `config.py`
215
+ 4. Write integration tests
216
+
217
+ ### Adding New Agent Features
218
+
219
+ 1. Modify `MCPAgent` class in `mcp_use/agents/mcpagent.py`
220
+ 2. Update system prompt templates if needed
221
+ 3. Add comprehensive tests
222
+ 4. Update documentation
223
+
224
+ ### Testing with Custom MCP Servers
225
+
226
+ 1. Create test server in `tests/integration/servers_for_testing/`
227
+ 2. Add integration test in appropriate transport directory
228
+ 3. Use custom servers for controlled testing scenarios