feat: enhance MCP server support with authentication and environment variables#1644
Closed
abhimanyusaxena wants to merge 10 commits intofastapi:masterfrom
Closed
feat: enhance MCP server support with authentication and environment variables#1644abhimanyusaxena wants to merge 10 commits intofastapi:masterfrom
abhimanyusaxena wants to merge 10 commits intofastapi:masterfrom
Conversation
Security improvements: - Implement OAuth CSRF protection with secure state parameter management - Add proper validation and expiration for OAuth state tokens - Add security warnings for SECRET_KEY configuration in production - Sanitize database error logging to prevent sensitive info exposure Code quality fixes: - Fix missing import for get_user function in refresh endpoint - Fix async/await usage in get_current_user_optional - Standardize is_active default value to True across models - Add security documentation for shell=True usage - Update Alembic config to clarify placeholder database URL 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add MCP server models and schemas for storing server configurations - Implement MCP connection manager supporting both stdio and HTTP+SSE transports - Create REST API endpoints for managing MCP servers (CRUD operations) - Add WebSocket endpoint for real-time MCP communication - Implement tool calling, resource fetching, and prompt retrieval - Add database migration for mcp_servers table with JSON fields - Support both local (stdio) and remote (HTTP+SSE) MCP servers - Add aiohttp dependency for HTTP client functionality This backend implementation provides a foundation for browser-based MCP hosting, allowing users to connect to and interact with MCP servers similar to Claude Desktop. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…variables - Add authentication fields (auth_type, auth_config) to MCP server model - Support bearer token, API key, and basic authentication for remote servers - Add environment variable expansion for server configurations - Enhance error handling and connection resilience - Improve WebSocket status reporting with error messages - Add timeout and better error messages for HTTP requests - Better process management for stdio connections 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Member
|
Thanks for the interest. This has a lot of changes (and tests are failing), it would probably be better as a feature in your own project. For now I'll pass on this. ☕ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Authentication Support
auth_typeandauth_configfields to MCP server modelEnvironment Variable Support
${VAR}or$VARsyntaxEnhanced Error Handling
Database Changes
Testing
Next Steps
🤖 Generated with Claude Code