MCP Server Catalog Improvements #1170
Merged
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.
Pull Request: MCP Server Catalog Improvements
Closes #1143
Summary
This PR comprehensively enhances the MCP Server Catalog feature with 21 critical fixes and improvements, addressing transport detection, authentication, UI/UX, and developer experience issues. All tests passing with perfect quality scores.
Changes Overview
🔧 Core Functionality Fixes (10 fixes)
WebSocket Transport Detection - Fixed auto-detection logic to correctly identify
ws://
andwss://
URLs as WEBSOCKET transport instead of incorrectly mapping to SSETransport Field Support - Added optional
transport
field toCatalogServer
schema allowing explicit specification ofSSE
,STREAMABLEHTTP
, orWEBSOCKET
Auth Headers Mapping - Fixed authentication headers to use proper list structure
[{"key": "X-API-Key", "value": "..."}]
instead of individual key/value fieldsOAuth Server Registration - Implemented ability to register OAuth2.1 servers without immediate credentials, creating them in disabled state until OAuth flow is completed
URL Normalization - Verified URL normalization handles trailing slashes, paths, and protocols correctly
Server Availability Tracking - Fixed
is_available
field logic to properly reflect registration and health statusProvider Filter Normalization - Normalized provider names for consistent filtering across the catalog
Root Path Handling - Standardized
window.ROOT_PATH
global variable for consistent URL construction in JavaScriptConfigurable Page Size - Added
MCPGATEWAY_CATALOG_PAGE_SIZE
environment variable (default: 12) for customizable paginationImport Path Fix - Corrected import from
mcpgateway.utils.slug
tomcpgateway.utils.create_slug.slugify
🎨 UI/UX Enhancements (7 fixes)
Custom Name in Registration Modal - Added visible input field allowing users to specify custom server names during registration
Authorization Bearer Header - Added JWT token to fetch requests via
Authorization: Bearer
header for authenticated API callsHTMX Error Handling - Implemented
hx-on::after-request
error handling with user-friendly alert messages on registration failuresLoading States - Added visual loading indicators during server registration with spinner and "Registering..." text
Search Debouncing - Implemented 300ms debounce on search input to prevent excessive DOM manipulation and improve performance
Pagination Filter Preservation - Filter parameters (category, auth_type, search) now preserved when navigating between pages
Refresh Button - Added manual catalog refresh button to reload server list without full page reload
⚡ Developer Experience (4 fixes)
Code Deduplication - Consolidated duplicate code paths in registration and filtering logic
Environment Documentation - Updated
.env.example
withMCPGATEWAY_CATALOG_PAGE_SIZE
configurationComprehensive Documentation - Updated
docs/docs/manage/catalog.md
with:Files Modified
Code Changes (7 files)
.env.example
- Added catalog page size configurationmcpgateway/config.py
- Addedmcpgateway_catalog_page_size
settingmcpgateway/schemas.py
- Added optionaltransport
field toCatalogServer
mcpgateway/services/catalog_service.py
- Core fixes for transport detection, OAuth registration, error handlingmcpgateway/admin.py
- Filter preservation for paginationmcpgateway/templates/mcp_registry_partial.html
- UI enhancements, modal improvements, debouncing, refresh buttonDocumentation Updates (2 files)
README.md
- Added catalog page size config and key features sectiondocs/docs/manage/catalog.md
- Comprehensive transport field docs, WebSocket examples, improvements section, troubleshootingTotal: +305 net lines across 9 files
Transport Detection Logic
The catalog service now intelligently detects transport types:
Servers can also explicitly specify transport in catalog YAML:
Test Results
✅ All Tests Passing
✅ Perfect Quality Scores
Breaking Changes
None - all changes are backward compatible.
Migration Guide
No migration required. Existing catalog servers will continue to work with auto-detection. Optional: Add explicit
transport
field to catalog YAML for clarity:Related Issues
Closes #1143 - MCP Server Catalog Improvements