Skip to content

feat(logs): introduce retrieve_logs tool #56

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

Merged
merged 2 commits into from
Mar 12, 2025
Merged

Conversation

alexander-zuev
Copy link
Owner

@alexander-zuev alexander-zuev commented Mar 12, 2025

retrieve_logs tool: access 10 Supabase log collections with filters and custom queries support

This PR introduces support for a new class of Logs & Analytics tools. The first tool in the series retrieve_logs tool allows users to easily retrieve logs from any log collection in Supabase, such as Auth, Postgres, PostgREST, Edge functions and many others. This will greatly aid in debugging and working with Supabase instance from the IDE / MCP client.

Other changes included in the PR:

  • added file logger rotation (5MB)
  • updated warnings and error messages and updated documentation to clarify SUPABASE_DB_REGION is required when connecting to a remote Supabase instance

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation update
  • Test updates

Checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes

@alexander-zuev alexander-zuev added the enhancement New feature or request label Mar 12, 2025
@alexander-zuev alexander-zuev self-assigned this Mar 12, 2025
…ervices

This commit adds a powerful new log retrieval capability to the Supabase MCP server:

- Implemented  tool to access logs from multiple Supabase services
- Added support for 10 different log collections (postgres, auth, edge functions, etc.)
- Introduced flexible querying with filters, search, and custom SQL support
- Enhanced log management with improved error handling and configuration
- Updated documentation and tests to cover the new log retrieval functionality
- Improved region configuration with clearer error messages
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 85.85859% with 14 lines in your changes missing coverage. Please review.

Project coverage is 84.0%. Comparing base (0f6d8dd) to head (ca81586).

Files with missing lines Patch % Lines
supabase_mcp/services/database/postgres_client.py 58.8% 7 Missing ⚠️
supabase_mcp/tools/registry.py 28.5% 5 Missing ⚠️
supabase_mcp/services/logs/log_manager.py 94.7% 2 Missing ⚠️

Impacted file tree graph

@@           Coverage Diff           @@
##            main     #56     +/-   ##
=======================================
+ Coverage   83.8%   84.0%   +0.1%     
=======================================
  Files         25      26      +1     
  Lines       1602    1682     +80     
=======================================
+ Hits        1344    1413     +69     
- Misses       258     269     +11     
Files with missing lines Coverage Δ
supabase_mcp/core/container.py 100.0% <100.0%> (ø)
supabase_mcp/logger.py 94.1% <100.0%> (+0.3%) ⬆️
supabase_mcp/services/api/api_manager.py 79.0% <100.0%> (+2.5%) ⬆️
supabase_mcp/services/database/sql/loader.py 100.0% <100.0%> (ø)
supabase_mcp/settings.py 94.0% <100.0%> (+4.0%) ⬆️
supabase_mcp/tools/manager.py 93.6% <100.0%> (+0.1%) ⬆️
supabase_mcp/services/logs/log_manager.py 94.7% <94.7%> (ø)
supabase_mcp/tools/registry.py 45.5% <28.5%> (-1.5%) ⬇️
supabase_mcp/services/database/postgres_client.py 87.3% <58.8%> (-4.2%) ⬇️
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexander-zuev alexander-zuev merged commit 8584d4a into main Mar 12, 2025
2 checks passed
@alexander-zuev alexander-zuev deleted the feat/log-tools branch March 12, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants