-
-
Notifications
You must be signed in to change notification settings - Fork 83
feat: introduce api client <> server separation #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fb4dd6a
to
0a89712
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a separation between the API client and server along with a new feature manager for enhanced query and premium feature access. Key changes include:
- Adding a new feature manager service to handle feature access and tool execution.
- Refactoring service initialization and shutdown (including a new lifespan function with forced termination).
- Updating client implementations (API, management, SDK) and configuration schemas.
Reviewed Changes
Copilot reviewed 33 out of 35 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
supabase_mcp/services/database/postgres_client.py | Updated connection pool typing and enhanced pool closing logic. |
supabase_mcp/services/api/api_manager.py | Updated API client import references. |
supabase_mcp/main.py | Revised application lifespan and shutdown sequence. |
supabase_mcp/exceptions.py | Added custom exceptions for feature access errors. |
supabase_mcp/core/feature_manager.py | Introduced a new feature management service implementation. |
supabase_mcp/core/container.py | Refactored container to a singleton ServicesContainer with new services. |
supabase_mcp/clients/sdk_client.py | Minor updates to logging messages. |
supabase_mcp/clients/management_client.py | Corrected logging messages and now uses configured API URL. |
supabase_mcp/clients/base_http_client.py | New async HTTP client with retry logic for network requests. |
supabase_mcp/clients/api_client.py | New Query API client implementation with proper error handling. |
smithery.yaml | Added Query API key configuration and mapping. |
pyproject.toml | Updated dependencies and version bumps. |
README.md | Updated documentation to reflect the new Query MCP branding. |
Files not reviewed (2)
- .env.example: Language not supported
- .env.test.example: Language not supported
@@ -17,6 +17,8 @@ | |||
# Define a type variable for generic return types | |||
T = TypeVar("T") | |||
|
|||
# TODO: Use a context manager to properly handle the connection pool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider implementing a context manager for the connection pool to ensure it is properly closed even when exceptions occur.
Copilot uses AI. Check for mistakes.
import os | ||
|
||
# Register tools | ||
mcp = ToolRegistry(mcp=mcp, services_container=services_container).register_tools() | ||
os._exit(0) # Use 0 for successful termination | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using os._exit(0) forces an abrupt termination that bypasses graceful cleanup; consider replacing it with a more orderly shutdown mechanism if possible.
import os | |
# Register tools | |
mcp = ToolRegistry(mcp=mcp, services_container=services_container).register_tools() | |
os._exit(0) # Use 0 for successful termination | |
import sys | |
sys.exit(0) # Use 0 for successful termination |
Copilot uses AI. Check for mistakes.
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #62 +/- ##
=======================================
- Coverage 84.0% 78.4% -5.6%
=======================================
Files 26 29 +3
Lines 1682 1932 +250
=======================================
+ Hits 1413 1515 +102
- Misses 269 417 +148
🚀 New features to boost your workflow:
|
Query MCP
This PR enables release of v0.4 of this MCP server (renamed Query MCP to account for the future development) and includes a number of changes, most critical of which:
Type of Change
Checklist