Conversation
|
Hey guys when can we expect the integration to be out...super excited to use supabase in ma mcp auth |
|
I think we will hold this until we either confirm #1997 works or it comes out of beta, see https://github.com/orgs/supabase/discussions/38022 |
WalkthroughA new Supabase authentication integration documentation page was added to the FastMCP documentation. This includes creating Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/integrations/supabase.mdx (1)
97-123: Subsection headings should use H3 markdown markup for proper hierarchy."Provider Selection" (line 97) and "Supabase-Specific Configuration" (line 107) are subsection labels within the main "Environment Variables" section, but they are not formatted as H3 headings. Per the MDX guidelines on heading hierarchy, subsections should use
###markdown syntax.Apply this diff to add proper H3 heading markup:
### Provider Selection Setting this environment variable allows the Supabase provider to be used automatically without explicitly instantiating it in code.And:
### Supabase-Specific Configuration These environment variables provide default values for the Supabase provider, whether it's instantiated manually or configured via `FASTMCP_SERVER_AUTH`.This improves consistency and helps with documentation hierarchy and SEO.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/docs.json(1 hunks)docs/integrations/supabase.mdx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/**/*.mdx
📄 CodeRabbit inference engine (docs/.cursor/rules/mintlify.mdc)
docs/**/*.mdx: Use clear, direct language appropriate for technical audiences
Write in second person ('you') for instructions and procedures in MDX documentation
Use active voice over passive voice in MDX technical documentation
Employ present tense for current states and future tense for outcomes in MDX documentation
Maintain consistent terminology throughout all MDX documentation
Keep sentences concise while providing necessary context in MDX documentation
Use parallel structure in lists, headings, and procedures in MDX documentation
Lead with the most important information using inverted pyramid structure in MDX documentation
Use progressive disclosure in MDX documentation: present basic concepts before advanced ones
Break complex procedures into numbered steps in MDX documentation
Include prerequisites and context before instructions in MDX documentation
Provide expected outcomes for each major step in MDX documentation
End sections with next steps or related information in MDX documentation
Use descriptive, keyword-rich headings for navigation and SEO in MDX documentation
Focus on user goals and outcomes rather than system features in MDX documentation
Anticipate common questions and address them proactively in MDX documentation
Include troubleshooting for likely failure points in MDX documentation
Provide multiple pathways (beginner vs advanced) but offer an opinionated path to avoid overwhelming users in MDX documentation
Always include complete, runnable code examples that users can copy and execute in MDX documentation
Show proper error handling and edge case management in MDX code examples
Use realistic data instead of placeholder values in MDX code examples
Include expected outputs and results for verification in MDX code examples
Test all code examples thoroughly before publishing in MDX documentation
Specify language and include filename when relevant in MDX code examples
Add explanatory comments for complex logic in MDX code examples
Document all API...
Files:
docs/integrations/supabase.mdx
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: docs/.cursor/rules/mintlify.mdc:0-0
Timestamp: 2025-11-26T21:52:08.947Z
Learning: Applies to docs/**/*.mdx : Provide authentication examples showing proper format in MDX API documentation
📚 Learning: 2025-11-26T21:52:08.947Z
Learnt from: CR
Repo: jlowin/fastmcp PR: 0
File: docs/.cursor/rules/mintlify.mdc:0-0
Timestamp: 2025-11-26T21:52:08.947Z
Learning: Applies to docs/**/*.mdx : Provide authentication examples showing proper format in MDX API documentation
Applied to files:
docs/integrations/supabase.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Run tests: Python 3.10 on windows-latest
🔇 Additional comments (4)
docs/docs.json (1)
205-205: Navigation entry correctly positioned.The Supabase integration reference is added in proper alphabetical order within the Authentication integrations section.
docs/integrations/supabase.mdx (3)
1-11: Frontmatter and imports properly structured.YAML frontmatter includes all required fields and the VersionBadge correctly indicates API version compatibility.
15-41: Configuration section follows progressive disclosure pattern.Prerequisites are clearly listed before instructions, and Step 1-2 provide clear sequential guidance. The server code example is complete and uses realistic configuration values (project URL format, localhost for development).
93-143: Environment Variables section is well-structured and documented.The ParamField components correctly specify required vs. optional parameters with clear descriptions. The example .env file and simplified server code effectively demonstrate environment-based setup, reducing configuration complexity.
| ```python client.py | ||
| from fastmcp import Client | ||
| import asyncio | ||
|
|
||
| async def main(): | ||
| # The client will automatically handle Supabase OAuth | ||
| async with Client("http://localhost:8000/mcp", auth="oauth") as client: | ||
| # First-time connection will open Supabase login in your browser | ||
| print("✓ Authenticated with Supabase!") | ||
|
|
||
| # Test the protected tool | ||
| result = await client.call_tool("protected_tool", {"message": "Hello!"}) | ||
| print(result) | ||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.run(main()) | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Find Client class definition
find . -type f -name "*.py" | xargs grep -l "class Client"Repository: jlowin/fastmcp
Length of output: 227
🏁 Script executed:
# Search for auth parameter usage in Client initialization
rg "Client.*auth" --type py -A 3 -B 3Repository: jlowin/fastmcp
Length of output: 6297
🏁 Script executed:
# Look for existing MDX examples showing error handling
find docs -name "*.mdx" -exec grep -l "try:" {} \;Repository: jlowin/fastmcp
Length of output: 189
🏁 Script executed:
# Check for exception types in fastmcp
rg "class.*Error|class.*Exception" --type pyRepository: jlowin/fastmcp
Length of output: 968
🏁 Script executed:
# Examine Client class definition
head -100 src/fastmcp/client/client.pyRepository: jlowin/fastmcp
Length of output: 2656
🏁 Script executed:
# Look at one complete auth example to see error handling pattern
cat examples/auth/github_oauth/client.pyRepository: jlowin/fastmcp
Length of output: 844
🏁 Script executed:
# Check what exceptions can be raised during Client operations
cat src/fastmcp/exceptions.pyRepository: jlowin/fastmcp
Length of output: 801
🏁 Script executed:
# Verify the specific supabase.mdx file to see full context
sed -n '54,92p' docs/integrations/supabase.mdxRepository: jlowin/fastmcp
Length of output: 1158
Add error handling to the client code example.
The code example shows only the successful OAuth flow but lacks error handling for authentication failures (denied authorization, network errors, token exchange failures). All official fastmcp auth examples wrap the Client initialization in try/except blocks. Add error handling to match the established pattern:
async def main():
try:
async with Client("http://localhost:8000/mcp", auth="oauth") as client:
print("✓ Authenticated with Supabase!")
result = await client.call_tool("protected_tool", {"message": "Hello!"})
print(result)
except Exception as e:
print(f"✗ Authentication failed: {e}")
raise🤖 Prompt for AI Agents
In docs/integrations/supabase.mdx around lines 70 to 86, the example client code
lacks error handling for OAuth failures (denied auth, network/token errors);
wrap the async Client usage in a try/except block that logs/prints a clear
authentication failure message including the exception and re-raises (or exits)
so examples match the project's established pattern for auth examples.
Fast follow to #1997 to add integration docs