mcphub-server 3.7.0__tar.gz → 3.9.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.
Files changed (249) hide show
  1. {mcphub_server-3.7.0/mcphub_server.egg-info → mcphub_server-3.9.0}/PKG-INFO +6 -9
  2. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/README.md +5 -8
  3. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/dashboard/routes.py +315 -3
  4. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/database.py +161 -1
  5. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/base.html +2 -2
  6. mcphub_server-3.9.0/core/templates/dashboard/keys/list.html +493 -0
  7. mcphub_server-3.9.0/core/templates/dashboard/sites/edit.html +370 -0
  8. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/sites/list.html +4 -0
  9. mcphub_server-3.9.0/core/templates/dashboard/sites/view.html +134 -0
  10. mcphub_server-3.9.0/core/tool_access.py +326 -0
  11. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/tool_generator.py +5 -0
  12. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/tool_registry.py +12 -0
  13. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/user_endpoints.py +61 -21
  14. {mcphub_server-3.7.0 → mcphub_server-3.9.0/mcphub_server.egg-info}/PKG-INFO +6 -9
  15. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/mcphub_server.egg-info/SOURCES.txt +13 -0
  16. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/coolify/client.py +160 -0
  17. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/coolify/handlers/__init__.py +4 -1
  18. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/coolify/handlers/applications.py +23 -0
  19. mcphub_server-3.9.0/plugins/coolify/handlers/databases.py +420 -0
  20. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/coolify/handlers/deployments.py +5 -0
  21. mcphub_server-3.9.0/plugins/coolify/handlers/projects.py +273 -0
  22. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/coolify/handlers/servers.py +8 -0
  23. mcphub_server-3.9.0/plugins/coolify/handlers/services.py +501 -0
  24. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/coolify/plugin.py +9 -0
  25. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/pyproject.toml +1 -1
  26. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/server.py +43 -7
  27. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_coolify.py +1 -1
  28. mcphub_server-3.9.0/tests/test_coolify_databases.py +237 -0
  29. mcphub_server-3.9.0/tests/test_coolify_projects.py +214 -0
  30. mcphub_server-3.9.0/tests/test_coolify_services.py +240 -0
  31. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_dashboard.py +5 -27
  32. mcphub_server-3.9.0/tests/test_dashboard_keys_unified.py +81 -0
  33. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_database.py +66 -0
  34. mcphub_server-3.9.0/tests/test_site_tools_api.py +264 -0
  35. mcphub_server-3.9.0/tests/test_sites_tool_access_ui.py +110 -0
  36. mcphub_server-3.9.0/tests/test_tool_access.py +364 -0
  37. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_user_endpoints.py +4 -4
  38. mcphub_server-3.7.0/core/templates/dashboard/sites/edit.html +0 -172
  39. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/LICENSE +0 -0
  40. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/__init__.py +0 -0
  41. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/admin_utils.py +0 -0
  42. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/api_keys.py +0 -0
  43. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/audit_log.py +0 -0
  44. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/auth.py +0 -0
  45. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/config_snippets.py +0 -0
  46. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/context.py +0 -0
  47. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/dashboard/__init__.py +0 -0
  48. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/dashboard/auth.py +0 -0
  49. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/encryption.py +0 -0
  50. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/endpoints/__init__.py +0 -0
  51. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/endpoints/config.py +0 -0
  52. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/endpoints/factory.py +0 -0
  53. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/endpoints/middleware.py +0 -0
  54. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/endpoints/registry.py +0 -0
  55. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/health.py +0 -0
  56. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/i18n.py +0 -0
  57. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/middleware/__init__.py +0 -0
  58. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/oauth/__init__.py +0 -0
  59. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/oauth/client_registry.py +0 -0
  60. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/oauth/csrf.py +0 -0
  61. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/oauth/pkce.py +0 -0
  62. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/oauth/schemas.py +0 -0
  63. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/oauth/server.py +0 -0
  64. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/oauth/storage.py +0 -0
  65. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/oauth/token_manager.py +0 -0
  66. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/plugin_visibility.py +0 -0
  67. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/rate_limiter.py +0 -0
  68. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/settings.py +0 -0
  69. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/site_api.py +0 -0
  70. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/site_manager.py +0 -0
  71. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/base.html +0 -0
  72. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/404.html +0 -0
  73. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/api-keys/list.html +0 -0
  74. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/audit-logs/list.html +0 -0
  75. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/auth-login.html +0 -0
  76. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/connect.html +0 -0
  77. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/health/index.html +0 -0
  78. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/health/projects-partial.html +0 -0
  79. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/index.html +0 -0
  80. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/login.html +0 -0
  81. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/oauth-clients/list.html +0 -0
  82. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/partials/head_assets.html +0 -0
  83. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/profile.html +0 -0
  84. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/projects/detail.html +0 -0
  85. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/projects/list.html +0 -0
  86. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/service.html +0 -0
  87. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/services_list.html +0 -0
  88. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/settings/index.html +0 -0
  89. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/sites/add.html +0 -0
  90. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/dashboard/user-oauth-clients.html +0 -0
  91. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/oauth/authorize.html +0 -0
  92. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/templates/oauth/error.html +0 -0
  93. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/user_auth.py +0 -0
  94. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/core/user_keys.py +0 -0
  95. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/mcphub_server.egg-info/dependency_links.txt +0 -0
  96. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/mcphub_server.egg-info/entry_points.txt +0 -0
  97. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/mcphub_server.egg-info/requires.txt +0 -0
  98. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/mcphub_server.egg-info/top_level.txt +0 -0
  99. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/__init__.py +0 -0
  100. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/appwrite/__init__.py +0 -0
  101. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/appwrite/client.py +0 -0
  102. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/appwrite/handlers/__init__.py +0 -0
  103. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/appwrite/handlers/databases.py +0 -0
  104. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/appwrite/handlers/documents.py +0 -0
  105. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/appwrite/handlers/functions.py +0 -0
  106. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/appwrite/handlers/messaging.py +0 -0
  107. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/appwrite/handlers/storage.py +0 -0
  108. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/appwrite/handlers/system.py +0 -0
  109. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/appwrite/handlers/teams.py +0 -0
  110. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/appwrite/handlers/users.py +0 -0
  111. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/appwrite/plugin.py +0 -0
  112. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/base.py +0 -0
  113. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/coolify/__init__.py +0 -0
  114. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/coolify/schemas/__init__.py +0 -0
  115. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/coolify/schemas/common.py +0 -0
  116. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/directus/__init__.py +0 -0
  117. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/directus/client.py +0 -0
  118. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/directus/handlers/__init__.py +0 -0
  119. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/directus/handlers/access.py +0 -0
  120. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/directus/handlers/automation.py +0 -0
  121. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/directus/handlers/collections.py +0 -0
  122. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/directus/handlers/content.py +0 -0
  123. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/directus/handlers/dashboards.py +0 -0
  124. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/directus/handlers/files.py +0 -0
  125. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/directus/handlers/items.py +0 -0
  126. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/directus/handlers/system.py +0 -0
  127. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/directus/handlers/users.py +0 -0
  128. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/directus/plugin.py +0 -0
  129. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/__init__.py +0 -0
  130. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/client.py +0 -0
  131. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/handlers/__init__.py +0 -0
  132. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/handlers/issues.py +0 -0
  133. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/handlers/pull_requests.py +0 -0
  134. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/handlers/repositories.py +0 -0
  135. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/handlers/users.py +0 -0
  136. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/handlers/webhooks.py +0 -0
  137. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/plugin.py +0 -0
  138. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/schemas/__init__.py +0 -0
  139. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/schemas/common.py +0 -0
  140. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/schemas/issue.py +0 -0
  141. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/schemas/pull_request.py +0 -0
  142. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/schemas/repository.py +0 -0
  143. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/schemas/user.py +0 -0
  144. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/gitea/schemas/webhook.py +0 -0
  145. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/n8n/__init__.py +0 -0
  146. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/n8n/client.py +0 -0
  147. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/n8n/handlers/__init__.py +0 -0
  148. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/n8n/handlers/credentials.py +0 -0
  149. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/n8n/handlers/executions.py +0 -0
  150. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/n8n/handlers/projects.py +0 -0
  151. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/n8n/handlers/system.py +0 -0
  152. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/n8n/handlers/tags.py +0 -0
  153. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/n8n/handlers/users.py +0 -0
  154. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/n8n/handlers/variables.py +0 -0
  155. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/n8n/handlers/workflows.py +0 -0
  156. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/n8n/plugin.py +0 -0
  157. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/openpanel/__init__.py +0 -0
  158. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/openpanel/client.py +0 -0
  159. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/openpanel/handlers/__init__.py +0 -0
  160. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/openpanel/handlers/clients.py +0 -0
  161. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/openpanel/handlers/events.py +0 -0
  162. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/openpanel/handlers/export.py +0 -0
  163. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/openpanel/handlers/profiles.py +0 -0
  164. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/openpanel/handlers/projects.py +0 -0
  165. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/openpanel/handlers/reports.py +0 -0
  166. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/openpanel/handlers/system.py +0 -0
  167. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/openpanel/handlers/utils.py +0 -0
  168. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/openpanel/plugin.py +0 -0
  169. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/supabase/__init__.py +0 -0
  170. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/supabase/client.py +0 -0
  171. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/supabase/handlers/__init__.py +0 -0
  172. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/supabase/handlers/admin.py +0 -0
  173. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/supabase/handlers/auth.py +0 -0
  174. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/supabase/handlers/database.py +0 -0
  175. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/supabase/handlers/functions.py +0 -0
  176. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/supabase/handlers/storage.py +0 -0
  177. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/supabase/handlers/system.py +0 -0
  178. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/supabase/plugin.py +0 -0
  179. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/woocommerce/__init__.py +0 -0
  180. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/woocommerce/plugin.py +0 -0
  181. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/__init__.py +0 -0
  182. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/client.py +0 -0
  183. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/__init__.py +0 -0
  184. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/comments.py +0 -0
  185. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/coupons.py +0 -0
  186. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/customers.py +0 -0
  187. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/media.py +0 -0
  188. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/menus.py +0 -0
  189. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/orders.py +0 -0
  190. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/posts.py +0 -0
  191. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/products.py +0 -0
  192. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/reports.py +0 -0
  193. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/seo.py +0 -0
  194. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/site.py +0 -0
  195. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/taxonomy.py +0 -0
  196. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/users.py +0 -0
  197. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/handlers/wp_cli.py +0 -0
  198. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/plugin.py +0 -0
  199. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/plugin_old_backup.py +0 -0
  200. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/schemas/__init__.py +0 -0
  201. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/schemas/common.py +0 -0
  202. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/schemas/media.py +0 -0
  203. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/schemas/order.py +0 -0
  204. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/schemas/post.py +0 -0
  205. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/schemas/product.py +0 -0
  206. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/schemas/seo.py +0 -0
  207. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress/wp_cli.py +0 -0
  208. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress_advanced/__init__.py +0 -0
  209. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress_advanced/handlers/__init__.py +0 -0
  210. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress_advanced/handlers/bulk.py +0 -0
  211. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress_advanced/handlers/database.py +0 -0
  212. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress_advanced/handlers/system.py +0 -0
  213. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress_advanced/plugin.py +0 -0
  214. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress_advanced/schemas/__init__.py +0 -0
  215. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress_advanced/schemas/bulk.py +0 -0
  216. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress_advanced/schemas/database.py +0 -0
  217. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/plugins/wordpress_advanced/schemas/system.py +0 -0
  218. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/setup.cfg +0 -0
  219. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_admin_system.py +0 -0
  220. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_api_keys.py +0 -0
  221. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_auth.py +0 -0
  222. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_auth_logic.py +0 -0
  223. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_config_snippets.py +0 -0
  224. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_dynamic_endpoints_integration.py +0 -0
  225. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_encryption.py +0 -0
  226. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_f3_admin_stats.py +0 -0
  227. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_f3_last_tested.py +0 -0
  228. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_f3_service_pages.py +0 -0
  229. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_gitea_plugin.py +0 -0
  230. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_oauth_basic_auth.py +0 -0
  231. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_oauth_client_registry.py +0 -0
  232. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_oauth_integration.py +0 -0
  233. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_oauth_pkce.py +0 -0
  234. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_oauth_resource.py +0 -0
  235. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_oauth_revoke.py +0 -0
  236. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_oauth_schemas.py +0 -0
  237. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_oauth_storage.py +0 -0
  238. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_oauth_token_manager.py +0 -0
  239. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_openpanel_plugin.py +0 -0
  240. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_plugin_visibility.py +0 -0
  241. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_rate_limiter.py +0 -0
  242. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_site_api.py +0 -0
  243. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_site_manager.py +0 -0
  244. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_tenant_isolation.py +0 -0
  245. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_tool_registry.py +0 -0
  246. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_user_auth.py +0 -0
  247. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_user_keys.py +0 -0
  248. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_woocommerce_plugin.py +0 -0
  249. {mcphub_server-3.7.0 → mcphub_server-3.9.0}/tests/test_wordpress_plugin.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcphub-server
3
- Version: 3.7.0
3
+ Version: 3.9.0
4
4
  Summary: AI-native management hub for WordPress, WooCommerce, and self-hosted services via Model Context Protocol (MCP)
5
5
  Author-email: MCP Hub <contact@mcphub.dev>
6
6
  License-Expression: MIT
@@ -62,8 +62,8 @@ Connect your sites, stores, repos, and databases — manage them all through Cla
62
62
  [![Python 3.11+](https://img.shields.io/badge/python-3.11+-3776ab.svg)](https://www.python.org/)
63
63
  [![PyPI](https://img.shields.io/pypi/v/mcphub-server.svg)](https://pypi.org/project/mcphub-server/)
64
64
  [![Docker](https://img.shields.io/docker/v/airano/mcphub?label=docker)](https://hub.docker.com/r/airano/mcphub)
65
- [![Tests: 686 passing](https://img.shields.io/badge/tests-686%20passing-brightgreen.svg)]()
66
- [![Tools: 596](https://img.shields.io/badge/tools-596-orange.svg)]()
65
+ [![Tests: 481 passing](https://img.shields.io/badge/tests-481%20passing-brightgreen.svg)]()
66
+ [![Tools: 565](https://img.shields.io/badge/tools-565-orange.svg)]()
67
67
  [![CI](https://github.com/airano-ir/mcphub/actions/workflows/ci.yml/badge.svg)](https://github.com/airano-ir/mcphub/actions/workflows/ci.yml)
68
68
 
69
69
  </div>
@@ -74,7 +74,7 @@ Connect your sites, stores, repos, and databases — manage them all through Cla
74
74
 
75
75
  WordPress powers 43% of the web. WooCommerce runs 36% of online stores. Yet **no MCP server existed** for managing them through AI — until now.
76
76
 
77
- MCP Hub is the first MCP server that lets you manage WordPress, WooCommerce, and 8 other self-hosted services through any AI assistant. Instead of clicking through dashboards, just tell your AI what to do:
77
+ MCP Hub is the first MCP server that lets you manage WordPress, WooCommerce, and 7 other self-hosted services through any AI assistant. Instead of clicking through dashboards, just tell your AI what to do:
78
78
 
79
79
  > *"Update the SEO meta description for all WooCommerce products that don't have one"*
80
80
  >
@@ -111,9 +111,8 @@ MCP Hub is the first MCP server that lets you manage WordPress, WooCommerce, and
111
111
  | **OpenPanel** | 42 | Events, export, insights, profiles, projects, system |
112
112
  | **Appwrite** | 100 | Databases, auth, storage, functions, teams, messaging |
113
113
  | **Directus** | 100 | Collections, items, users, files, flows, permissions |
114
- | **Coolify** | 30 | Applications, deployments, servers, env vars, logs |
115
114
  | **System** | 24 | Health monitoring, API keys, OAuth management, audit |
116
- | **Total** | **596** | Constant count — scales to unlimited sites |
115
+ | **Total** | **565** | Constant count — scales to unlimited sites |
117
116
 
118
117
  ---
119
118
 
@@ -214,7 +213,6 @@ MASTER_API_KEY=your-secure-key-here
214
213
  | OpenPanel | URL, Client ID, Client Secret | OpenPanel Dashboard → Project Settings |
215
214
  | Appwrite | URL, API Key, Project ID | Appwrite Console → Settings → API Keys |
216
215
  | Directus | URL, Static Token | Directus Admin → Settings |
217
- | Coolify | URL, API Token | Coolify → Keys & Tokens → API tokens |
218
216
 
219
217
  </details>
220
218
 
@@ -327,12 +325,11 @@ MCP Hub supports **Open Dynamic Client Registration** (RFC 7591). ChatGPT can au
327
325
  /openpanel/mcp → OpenPanel tools (42 tools)
328
326
  /appwrite/mcp → Appwrite tools (100 tools)
329
327
  /directus/mcp → Directus tools (100 tools)
330
- /coolify/mcp → Coolify tools (30 tools)
331
328
  /project/{alias}/mcp → Per-project endpoint (auto-injects site)
332
329
  /u/{user_id}/{alias}/mcp → Per-user endpoint (hosted/OAuth users)
333
330
  ```
334
331
 
335
- **Recommendation**: Use plugin-specific endpoints instead of `/mcp` (596 tools) to minimize token usage.
332
+ **Recommendation**: Use plugin-specific endpoints instead of `/mcp` (565 tools) to minimize token usage.
336
333
 
337
334
  | Endpoint | Use Case | Tools |
338
335
  |----------|----------|------:|
@@ -13,8 +13,8 @@ Connect your sites, stores, repos, and databases — manage them all through Cla
13
13
  [![Python 3.11+](https://img.shields.io/badge/python-3.11+-3776ab.svg)](https://www.python.org/)
14
14
  [![PyPI](https://img.shields.io/pypi/v/mcphub-server.svg)](https://pypi.org/project/mcphub-server/)
15
15
  [![Docker](https://img.shields.io/docker/v/airano/mcphub?label=docker)](https://hub.docker.com/r/airano/mcphub)
16
- [![Tests: 686 passing](https://img.shields.io/badge/tests-686%20passing-brightgreen.svg)]()
17
- [![Tools: 596](https://img.shields.io/badge/tools-596-orange.svg)]()
16
+ [![Tests: 481 passing](https://img.shields.io/badge/tests-481%20passing-brightgreen.svg)]()
17
+ [![Tools: 565](https://img.shields.io/badge/tools-565-orange.svg)]()
18
18
  [![CI](https://github.com/airano-ir/mcphub/actions/workflows/ci.yml/badge.svg)](https://github.com/airano-ir/mcphub/actions/workflows/ci.yml)
19
19
 
20
20
  </div>
@@ -25,7 +25,7 @@ Connect your sites, stores, repos, and databases — manage them all through Cla
25
25
 
26
26
  WordPress powers 43% of the web. WooCommerce runs 36% of online stores. Yet **no MCP server existed** for managing them through AI — until now.
27
27
 
28
- MCP Hub is the first MCP server that lets you manage WordPress, WooCommerce, and 8 other self-hosted services through any AI assistant. Instead of clicking through dashboards, just tell your AI what to do:
28
+ MCP Hub is the first MCP server that lets you manage WordPress, WooCommerce, and 7 other self-hosted services through any AI assistant. Instead of clicking through dashboards, just tell your AI what to do:
29
29
 
30
30
  > *"Update the SEO meta description for all WooCommerce products that don't have one"*
31
31
  >
@@ -62,9 +62,8 @@ MCP Hub is the first MCP server that lets you manage WordPress, WooCommerce, and
62
62
  | **OpenPanel** | 42 | Events, export, insights, profiles, projects, system |
63
63
  | **Appwrite** | 100 | Databases, auth, storage, functions, teams, messaging |
64
64
  | **Directus** | 100 | Collections, items, users, files, flows, permissions |
65
- | **Coolify** | 30 | Applications, deployments, servers, env vars, logs |
66
65
  | **System** | 24 | Health monitoring, API keys, OAuth management, audit |
67
- | **Total** | **596** | Constant count — scales to unlimited sites |
66
+ | **Total** | **565** | Constant count — scales to unlimited sites |
68
67
 
69
68
  ---
70
69
 
@@ -165,7 +164,6 @@ MASTER_API_KEY=your-secure-key-here
165
164
  | OpenPanel | URL, Client ID, Client Secret | OpenPanel Dashboard → Project Settings |
166
165
  | Appwrite | URL, API Key, Project ID | Appwrite Console → Settings → API Keys |
167
166
  | Directus | URL, Static Token | Directus Admin → Settings |
168
- | Coolify | URL, API Token | Coolify → Keys & Tokens → API tokens |
169
167
 
170
168
  </details>
171
169
 
@@ -278,12 +276,11 @@ MCP Hub supports **Open Dynamic Client Registration** (RFC 7591). ChatGPT can au
278
276
  /openpanel/mcp → OpenPanel tools (42 tools)
279
277
  /appwrite/mcp → Appwrite tools (100 tools)
280
278
  /directus/mcp → Directus tools (100 tools)
281
- /coolify/mcp → Coolify tools (30 tools)
282
279
  /project/{alias}/mcp → Per-project endpoint (auto-injects site)
283
280
  /u/{user_id}/{alias}/mcp → Per-user endpoint (hosted/OAuth users)
284
281
  ```
285
282
 
286
- **Recommendation**: Use plugin-specific endpoints instead of `/mcp` (596 tools) to minimize token usage.
283
+ **Recommendation**: Use plugin-specific endpoints instead of `/mcp` (565 tools) to minimize token usage.
287
284
 
288
285
  | Endpoint | Use Case | Tools |
289
286
  |----------|----------|------:|
@@ -160,6 +160,7 @@ DASHBOARD_TRANSLATIONS = {
160
160
  "admin_login": "Admin Login with API Key",
161
161
  "profile": "Profile",
162
162
  "admin_badge": "Admin",
163
+ "keys": "API Keys",
163
164
  },
164
165
  "fa": {
165
166
  # Navigation
@@ -265,6 +266,7 @@ DASHBOARD_TRANSLATIONS = {
265
266
  "admin_login": "ورود مدیر با کلید API",
266
267
  "profile": "پروفایل",
267
268
  "admin_badge": "مدیر",
269
+ "keys": "کلیدهای API",
268
270
  },
269
271
  }
270
272
 
@@ -2905,6 +2907,134 @@ async def dashboard_connect_page(request: Request) -> Response:
2905
2907
  )
2906
2908
 
2907
2909
 
2910
+ # ======================================================================
2911
+ # Site View Route (F.7b session 2)
2912
+ # ======================================================================
2913
+
2914
+
2915
+ async def dashboard_sites_view(request: Request) -> Response:
2916
+ """GET /dashboard/sites/{id} — Show site connect page with config snippets."""
2917
+ user_session, redirect = _require_user_session(request)
2918
+ if redirect:
2919
+ return redirect
2920
+
2921
+ site_id = request.path_params.get("id", "")
2922
+
2923
+ from core.config_snippets import get_supported_clients
2924
+ from core.site_api import PLUGIN_DISPLAY_NAMES as SITE_PLUGIN_NAMES
2925
+ from core.site_api import get_user_site
2926
+
2927
+ site = await get_user_site(site_id, user_session["user_id"])
2928
+ if site is None:
2929
+ return RedirectResponse("/dashboard/sites?error=site_not_found", status_code=302)
2930
+
2931
+ accept_language = request.headers.get("accept-language")
2932
+ query_lang = request.query_params.get("lang")
2933
+ lang = detect_language(accept_language, query_lang)
2934
+ t = get_translations(lang)
2935
+
2936
+ public_url = os.environ.get("PUBLIC_URL", "http://localhost:8000").rstrip("/")
2937
+ mcp_url = f"{public_url}/u/{user_session['user_id']}/{site['alias']}/mcp"
2938
+
2939
+ return templates.TemplateResponse(
2940
+ request,
2941
+ "dashboard/sites/view.html",
2942
+ {
2943
+ "lang": lang,
2944
+ "t": t,
2945
+ "session": user_session,
2946
+ "site": site,
2947
+ "plugin_names": SITE_PLUGIN_NAMES,
2948
+ "mcp_url": mcp_url,
2949
+ "clients": get_supported_clients(),
2950
+ "current_page": "my_sites",
2951
+ },
2952
+ )
2953
+
2954
+
2955
+ # ======================================================================
2956
+ # Unified Keys Route (F.7b session 2)
2957
+ # ======================================================================
2958
+
2959
+
2960
+ async def dashboard_keys_unified(request: Request) -> Response:
2961
+ """GET /dashboard/keys — Unified API keys page (user or admin view)."""
2962
+ accept_language = request.headers.get("accept-language")
2963
+ query_lang = request.query_params.get("lang")
2964
+ lang = detect_language(accept_language, query_lang)
2965
+ t = get_translations(lang)
2966
+
2967
+ auth = get_dashboard_auth()
2968
+ admin_session = auth.get_session_from_request(request)
2969
+ user_session = auth.get_user_session_from_request(request)
2970
+
2971
+ if admin_session and is_admin_session(admin_session):
2972
+ # Admin view — reuse existing admin keys logic
2973
+ project_filter = request.query_params.get("project", "")
2974
+ status_filter = request.query_params.get("status", "active")
2975
+ search = request.query_params.get("search", "")
2976
+ page = int(request.query_params.get("page", 1))
2977
+
2978
+ keys_data = await get_all_api_keys(
2979
+ project_id=project_filter if project_filter else None,
2980
+ status=status_filter,
2981
+ search=search if search else None,
2982
+ page=page,
2983
+ )
2984
+
2985
+ from core.site_manager import get_site_manager
2986
+
2987
+ site_manager = get_site_manager()
2988
+ available_projects = site_manager.list_all_sites()
2989
+
2990
+ return templates.TemplateResponse(
2991
+ request,
2992
+ "dashboard/keys/list.html",
2993
+ {
2994
+ "lang": lang,
2995
+ "t": t,
2996
+ "session": admin_session,
2997
+ "is_admin": True,
2998
+ "api_keys": keys_data["api_keys"],
2999
+ "total_count": keys_data["total_count"],
3000
+ "total_pages": keys_data["total_pages"],
3001
+ "page_number": keys_data["current_page"],
3002
+ "per_page": keys_data["per_page"],
3003
+ "available_projects": available_projects,
3004
+ "selected_project": project_filter,
3005
+ "selected_status": status_filter,
3006
+ "search_query": search,
3007
+ "current_page": "keys",
3008
+ },
3009
+ )
3010
+
3011
+ if user_session:
3012
+ # User view — personal keys
3013
+ from core.user_keys import get_user_key_manager
3014
+
3015
+ user_keys = []
3016
+ try:
3017
+ key_mgr = get_user_key_manager()
3018
+ user_keys = await key_mgr.list_keys(user_session["user_id"])
3019
+ except RuntimeError:
3020
+ pass
3021
+
3022
+ return templates.TemplateResponse(
3023
+ request,
3024
+ "dashboard/keys/list.html",
3025
+ {
3026
+ "lang": lang,
3027
+ "t": t,
3028
+ "session": user_session,
3029
+ "is_admin": False,
3030
+ "user_keys": user_keys,
3031
+ "current_page": "keys",
3032
+ },
3033
+ )
3034
+
3035
+ return RedirectResponse(url="/auth/login", status_code=303)
3036
+
3037
+
2908
3038
  # ======================================================================
2909
3039
  # Site Management API Routes (E.3)
2910
3040
  # ======================================================================
@@ -3162,6 +3292,181 @@ async def api_delete_key(request: Request) -> Response:
3162
3292
  return JSONResponse({"error": str(e)}, status_code=503)
3163
3293
 
3164
3294
 
3295
+ # ----------------------------------------------------------------------
3296
+ # F.7b: per-site tool visibility management
3297
+ # ----------------------------------------------------------------------
3298
+
3299
+
3300
+ _VALID_TOOL_SCOPES = {"read", "read:sensitive", "deploy", "write", "admin", "custom"}
3301
+
3302
+
3303
+ async def _require_owned_site(request: Request) -> tuple[dict | None, Response | None]:
3304
+ """Resolve ``{site_id}`` path param → site row owned by the current user.
3305
+
3306
+ Returns ``(site, None)`` on success, or ``(None, error_response)``.
3307
+ """
3308
+ user_session, redirect = _require_user_session(request)
3309
+ if redirect:
3310
+ return None, JSONResponse({"error": "Unauthorized"}, status_code=401)
3311
+
3312
+ site_id = request.path_params.get("site_id", "")
3313
+ if not site_id:
3314
+ return None, JSONResponse({"error": "Missing site_id"}, status_code=400)
3315
+
3316
+ from core.database import get_database
3317
+
3318
+ try:
3319
+ db = get_database()
3320
+ except RuntimeError:
3321
+ return None, JSONResponse({"error": "Database unavailable"}, status_code=503)
3322
+
3323
+ site = await db.get_site(site_id, user_session["user_id"])
3324
+ if site is None:
3325
+ return None, JSONResponse({"error": "Site not found"}, status_code=404)
3326
+ return site, None
3327
+
3328
+
3329
+ async def api_list_site_tools(request: Request) -> Response:
3330
+ """GET /api/sites/{site_id}/tools — list tools for a site with toggle state."""
3331
+ site, err = await _require_owned_site(request)
3332
+ if err:
3333
+ return err
3334
+ assert site is not None
3335
+
3336
+ from core.tool_access import get_tool_access_manager
3337
+
3338
+ access = get_tool_access_manager()
3339
+ tools = await access.list_tools_for_site(site["id"], site["plugin_type"])
3340
+ return JSONResponse(
3341
+ {
3342
+ "site_id": site["id"],
3343
+ "plugin_type": site["plugin_type"],
3344
+ "tool_scope": site.get("tool_scope", "admin"),
3345
+ "tools": tools,
3346
+ }
3347
+ )
3348
+
3349
+
3350
+ async def api_patch_site_tool(request: Request) -> Response:
3351
+ """PATCH /api/sites/{site_id}/tools/{tool_name} — toggle a single tool."""
3352
+ site, err = await _require_owned_site(request)
3353
+ if err:
3354
+ return err
3355
+ assert site is not None
3356
+
3357
+ tool_name = request.path_params.get("tool_name", "")
3358
+ try:
3359
+ body = await request.json()
3360
+ except Exception:
3361
+ return JSONResponse({"error": "Invalid JSON body"}, status_code=400)
3362
+
3363
+ if "enabled" not in body or not isinstance(body["enabled"], bool):
3364
+ return JSONResponse({"error": "Missing boolean 'enabled' field"}, status_code=400)
3365
+
3366
+ from core.tool_access import get_tool_access_manager
3367
+ from core.tool_registry import get_tool_registry
3368
+
3369
+ tool_def = get_tool_registry().get_by_name(tool_name)
3370
+ if tool_def is None:
3371
+ return JSONResponse({"error": f"Unknown tool '{tool_name}'"}, status_code=404)
3372
+ if tool_def.plugin_type != site["plugin_type"]:
3373
+ return JSONResponse(
3374
+ {"error": f"Tool '{tool_name}' does not belong to this site's plugin"},
3375
+ status_code=400,
3376
+ )
3377
+
3378
+ access = get_tool_access_manager()
3379
+ try:
3380
+ await access.toggle_tool(
3381
+ site["id"],
3382
+ tool_name,
3383
+ bool(body["enabled"]),
3384
+ body.get("reason"),
3385
+ )
3386
+ except RuntimeError as exc:
3387
+ return JSONResponse({"error": str(exc)}, status_code=503)
3388
+
3389
+ return JSONResponse({"ok": True, "tool_name": tool_name, "enabled": body["enabled"]})
3390
+
3391
+
3392
+ async def api_bulk_toggle_site_tools(request: Request) -> Response:
3393
+ """POST /api/sites/{site_id}/tools/bulk-toggle — toggle a category set."""
3394
+ site, err = await _require_owned_site(request)
3395
+ if err:
3396
+ return err
3397
+ assert site is not None
3398
+
3399
+ try:
3400
+ body = await request.json()
3401
+ except Exception:
3402
+ return JSONResponse({"error": "Invalid JSON body"}, status_code=400)
3403
+
3404
+ scope = body.get("scope")
3405
+ enabled = body.get("enabled")
3406
+ if not isinstance(scope, str) or not isinstance(enabled, bool):
3407
+ return JSONResponse(
3408
+ {"error": "Body must contain string 'scope' and bool 'enabled'"},
3409
+ status_code=400,
3410
+ )
3411
+
3412
+ from core.tool_access import get_tool_access_manager
3413
+
3414
+ access = get_tool_access_manager()
3415
+ try:
3416
+ affected = await access.bulk_toggle_by_scope(
3417
+ site["id"], scope, enabled, plugin_type=site["plugin_type"]
3418
+ )
3419
+ except ValueError as exc:
3420
+ return JSONResponse({"error": str(exc)}, status_code=400)
3421
+ except RuntimeError as exc:
3422
+ return JSONResponse({"error": str(exc)}, status_code=503)
3423
+
3424
+ return JSONResponse({"ok": True, "affected": affected})
3425
+
3426
+
3427
+ async def api_set_site_tool_scope(request: Request) -> Response:
3428
+ """PATCH /api/sites/{site_id}/tool-scope — update the site's scope preset."""
3429
+ site, err = await _require_owned_site(request)
3430
+ if err:
3431
+ return err
3432
+ assert site is not None
3433
+
3434
+ try:
3435
+ body = await request.json()
3436
+ except Exception:
3437
+ return JSONResponse({"error": "Invalid JSON body"}, status_code=400)
3438
+
3439
+ scope = body.get("scope")
3440
+ if not isinstance(scope, str) or scope not in _VALID_TOOL_SCOPES:
3441
+ return JSONResponse(
3442
+ {
3443
+ "error": (
3444
+ "Body must contain 'scope' with one of: "
3445
+ + ", ".join(sorted(_VALID_TOOL_SCOPES))
3446
+ )
3447
+ },
3448
+ status_code=400,
3449
+ )
3450
+
3451
+ from core.database import get_database
3452
+
3453
+ db = get_database()
3454
+ await db.set_site_tool_scope(site["id"], scope)
3455
+ return JSONResponse({"ok": True, "site_id": site["id"], "tool_scope": scope})
3456
+
3457
+
3458
+ async def api_scope_presets(request: Request) -> Response:
3459
+ """GET /api/scope-presets — static scope → categories mapping."""
3460
+ user_session, redirect = _require_user_session(request)
3461
+ if redirect:
3462
+ return JSONResponse({"error": "Unauthorized"}, status_code=401)
3463
+ del user_session
3464
+
3465
+ from core.tool_access import SCOPE_TO_CATEGORIES
3466
+
3467
+ return JSONResponse({"presets": {k: sorted(v) for k, v in SCOPE_TO_CATEGORIES.items()}})
3468
+
3469
+
3165
3470
  async def api_get_config(request: Request) -> Response:
3166
3471
  """GET /api/config/{alias} — Get config snippets for a site."""
3167
3472
  user_session, redirect = _require_user_session(request)
@@ -3471,8 +3776,11 @@ def register_dashboard_routes(mcp):
3471
3776
  dashboard_project_detail
3472
3777
  )
3473
3778
 
3474
- # API Keys routes
3475
- mcp.custom_route("/dashboard/api-keys", methods=["GET"])(dashboard_api_keys_list)
3779
+ # API Keys routes (unified — /dashboard/keys replaces /dashboard/api-keys and /dashboard/connect)
3780
+ mcp.custom_route("/dashboard/keys", methods=["GET"])(dashboard_keys_unified)
3781
+ mcp.custom_route("/dashboard/api-keys", methods=["GET"])(
3782
+ lambda r: RedirectResponse("/dashboard/keys", status_code=301)
3783
+ )
3476
3784
 
3477
3785
  # OAuth Clients routes
3478
3786
  mcp.custom_route("/dashboard/oauth-clients", methods=["GET"])(dashboard_oauth_clients_list)
@@ -3519,7 +3827,11 @@ def register_dashboard_routes(mcp):
3519
3827
  mcp.custom_route("/dashboard/sites", methods=["GET"])(dashboard_sites_list)
3520
3828
  mcp.custom_route("/dashboard/sites/add", methods=["GET"])(dashboard_sites_add)
3521
3829
  mcp.custom_route("/dashboard/sites/{id}/edit", methods=["GET"])(dashboard_sites_edit)
3522
- mcp.custom_route("/dashboard/connect", methods=["GET"])(dashboard_connect_page)
3830
+ mcp.custom_route("/dashboard/sites/{id}", methods=["GET"])(dashboard_sites_view)
3831
+ # /dashboard/connect → /dashboard/keys (301)
3832
+ mcp.custom_route("/dashboard/connect", methods=["GET"])(
3833
+ lambda r: RedirectResponse("/dashboard/keys", status_code=301)
3834
+ )
3523
3835
 
3524
3836
  # Service pages (F.3)
3525
3837
  mcp.custom_route("/dashboard/services", methods=["GET"])(dashboard_services_list)
@@ -37,7 +37,7 @@ logger = logging.getLogger(__name__)
37
37
  _DEFAULT_DATA_DIR = "/app/data" if Path("/app").exists() else "./data"
38
38
 
39
39
  # Schema version — increment when adding migrations
40
- SCHEMA_VERSION = 5
40
+ SCHEMA_VERSION = 7
41
41
 
42
42
  # Initial schema DDL
43
43
  _SCHEMA_SQL = """\
@@ -67,6 +67,7 @@ CREATE TABLE IF NOT EXISTS sites (
67
67
  status_msg TEXT,
68
68
  last_health TEXT,
69
69
  last_tested_at TEXT,
70
+ tool_scope TEXT NOT NULL DEFAULT 'admin',
70
71
  created_at TEXT NOT NULL,
71
72
  UNIQUE(user_id, alias)
72
73
  );
@@ -100,6 +101,18 @@ CREATE TABLE IF NOT EXISTS schema_version (
100
101
  version INTEGER PRIMARY KEY,
101
102
  applied_at TEXT NOT NULL
102
103
  );
104
+
105
+ -- F.7b: per-site tool toggles (scope-based visibility overrides)
106
+ CREATE TABLE IF NOT EXISTS site_tool_toggles (
107
+ id TEXT PRIMARY KEY,
108
+ site_id TEXT NOT NULL REFERENCES sites(id) ON DELETE CASCADE,
109
+ tool_name TEXT NOT NULL,
110
+ enabled INTEGER NOT NULL DEFAULT 1,
111
+ reason TEXT,
112
+ updated_at TEXT NOT NULL,
113
+ UNIQUE(site_id, tool_name)
114
+ );
115
+ CREATE INDEX IF NOT EXISTS idx_site_tool_toggles_site ON site_tool_toggles(site_id);
103
116
  """
104
117
 
105
118
  # Migration registry: version -> SQL string
@@ -120,6 +133,38 @@ _MIGRATIONS: dict[int, str] = {
120
133
  " updated_at TEXT NOT NULL DEFAULT (datetime('now'))\n"
121
134
  ");\n"
122
135
  ),
136
+ 6: (
137
+ # F.7: per-user tool toggles for scope-based visibility & per-tool disable
138
+ "CREATE TABLE IF NOT EXISTS user_tool_toggles (\n"
139
+ " id TEXT PRIMARY KEY,\n"
140
+ " user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,\n"
141
+ " tool_name TEXT NOT NULL,\n"
142
+ " enabled INTEGER NOT NULL DEFAULT 1,\n"
143
+ " reason TEXT,\n"
144
+ " updated_at TEXT NOT NULL,\n"
145
+ " UNIQUE(user_id, tool_name)\n"
146
+ ");\n"
147
+ "CREATE INDEX IF NOT EXISTS idx_user_tool_toggles_user "
148
+ "ON user_tool_toggles(user_id);\n"
149
+ ),
150
+ 7: (
151
+ # F.7b: move tool toggles from per-user to per-site and add a
152
+ # per-site preset column. user_tool_toggles was merged on Phase-1
153
+ # but never populated with real data — safe to drop.
154
+ "DROP TABLE IF EXISTS user_tool_toggles;\n"
155
+ "CREATE TABLE IF NOT EXISTS site_tool_toggles (\n"
156
+ " id TEXT PRIMARY KEY,\n"
157
+ " site_id TEXT NOT NULL REFERENCES sites(id) ON DELETE CASCADE,\n"
158
+ " tool_name TEXT NOT NULL,\n"
159
+ " enabled INTEGER NOT NULL DEFAULT 1,\n"
160
+ " reason TEXT,\n"
161
+ " updated_at TEXT NOT NULL,\n"
162
+ " UNIQUE(site_id, tool_name)\n"
163
+ ");\n"
164
+ "CREATE INDEX IF NOT EXISTS idx_site_tool_toggles_site "
165
+ "ON site_tool_toggles(site_id);\n"
166
+ "ALTER TABLE sites ADD COLUMN tool_scope TEXT NOT NULL DEFAULT 'admin';\n"
167
+ ),
123
168
  }
124
169
 
125
170
 
@@ -726,6 +771,121 @@ class Database:
726
771
  (_utc_now(), key_id),
727
772
  )
728
773
 
774
+ # ------------------------------------------------------------------
775
+ # Site tool toggles & tool_scope (F.7b)
776
+ # ------------------------------------------------------------------
777
+
778
+ async def get_site_tool_toggles(self, site_id: str) -> dict[str, bool]:
779
+ """Get explicit tool toggle overrides for a site.
780
+
781
+ Only rows where a tool has been explicitly toggled are stored.
782
+ Tools not in the result are implicitly enabled.
783
+
784
+ Args:
785
+ site_id: Site UUID.
786
+
787
+ Returns:
788
+ Dict mapping ``tool_name`` → ``enabled`` (bool).
789
+ """
790
+ rows = await self.fetchall(
791
+ "SELECT tool_name, enabled FROM site_tool_toggles WHERE site_id = ?",
792
+ (site_id,),
793
+ )
794
+ return {row["tool_name"]: bool(row["enabled"]) for row in rows}
795
+
796
+ async def set_site_tool_toggle(
797
+ self,
798
+ site_id: str,
799
+ tool_name: str,
800
+ enabled: bool,
801
+ reason: str | None = None,
802
+ ) -> None:
803
+ """Upsert a single tool toggle for a site.
804
+
805
+ Args:
806
+ site_id: Site UUID.
807
+ tool_name: Fully-qualified tool name (e.g. ``coolify_list_applications``).
808
+ enabled: Whether the tool should be visible on this site.
809
+ reason: Optional note.
810
+ """
811
+ toggle_id = str(uuid.uuid4())
812
+ now = _utc_now()
813
+ await self.execute(
814
+ "INSERT INTO site_tool_toggles (id, site_id, tool_name, enabled, reason, updated_at) "
815
+ "VALUES (?, ?, ?, ?, ?, ?) "
816
+ "ON CONFLICT(site_id, tool_name) DO UPDATE SET "
817
+ "enabled = excluded.enabled, reason = excluded.reason, updated_at = excluded.updated_at",
818
+ (toggle_id, site_id, tool_name, 1 if enabled else 0, reason, now),
819
+ )
820
+
821
+ async def delete_site_tool_toggle(self, site_id: str, tool_name: str) -> bool:
822
+ """Delete a site's toggle for a tool (reverts to the default).
823
+
824
+ Args:
825
+ site_id: Site UUID.
826
+ tool_name: Fully-qualified tool name.
827
+
828
+ Returns:
829
+ True if a row was deleted.
830
+ """
831
+ cursor = await self.execute(
832
+ "DELETE FROM site_tool_toggles WHERE site_id = ? AND tool_name = ?",
833
+ (site_id, tool_name),
834
+ )
835
+ return cursor.rowcount > 0
836
+
837
+ async def bulk_set_site_tool_toggles(
838
+ self,
839
+ site_id: str,
840
+ toggles: list[tuple[str, bool]],
841
+ reason: str | None = None,
842
+ ) -> int:
843
+ """Upsert multiple tool toggles for a site in one transaction.
844
+
845
+ Args:
846
+ site_id: Site UUID.
847
+ toggles: List of ``(tool_name, enabled)`` pairs.
848
+ reason: Optional shared reason applied to every row.
849
+
850
+ Returns:
851
+ Number of rows affected.
852
+ """
853
+ if not toggles:
854
+ return 0
855
+ now = _utc_now()
856
+ rows = [
857
+ (str(uuid.uuid4()), site_id, tool_name, 1 if enabled else 0, reason, now)
858
+ for tool_name, enabled in toggles
859
+ ]
860
+ await self.executemany(
861
+ "INSERT INTO site_tool_toggles (id, site_id, tool_name, enabled, reason, updated_at) "
862
+ "VALUES (?, ?, ?, ?, ?, ?) "
863
+ "ON CONFLICT(site_id, tool_name) DO UPDATE SET "
864
+ "enabled = excluded.enabled, reason = excluded.reason, updated_at = excluded.updated_at",
865
+ rows,
866
+ )
867
+ return len(rows)
868
+
869
+ async def get_site_tool_scope(self, site_id: str) -> str:
870
+ """Return the site's ``tool_scope`` preset (defaults to ``'admin'``)."""
871
+ row = await self.fetchone("SELECT tool_scope FROM sites WHERE id = ?", (site_id,))
872
+ if row is None:
873
+ return "admin"
874
+ return row["tool_scope"] or "admin"
875
+
876
+ async def set_site_tool_scope(self, site_id: str, scope: str) -> None:
877
+ """Update the ``tool_scope`` preset for a site.
878
+
879
+ Args:
880
+ site_id: Site UUID.
881
+ scope: One of ``read``, ``read:sensitive``, ``deploy``,
882
+ ``write``, ``admin``, ``custom``.
883
+ """
884
+ await self.execute(
885
+ "UPDATE sites SET tool_scope = ? WHERE id = ?",
886
+ (scope, site_id),
887
+ )
888
+
729
889
 
730
890
  # ======================================================================
731
891
  # Module-level helpers
@@ -136,8 +136,8 @@
136
136
  01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9',
137
137
  '/dashboard/sites'),
138
138
  ('services', t.get('services', 'Services'), 'M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10', '/dashboard/services'),
139
- ('connect', t.get('connect', 'Connect'), 'M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656
140
- 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1', '/dashboard/connect'),
139
+ ('keys', t.get('keys', 'API Keys'), 'M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0
140
+ 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z', '/dashboard/keys'),
141
141
  ('oauth_clients', t.oauth_clients, 'M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0
142
142
  01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622
143
143
  0-1.042-.133-2.052-.382-3.016z', '/dashboard/oauth-clients'),