Settings fixes: - MAX_SITES_PER_USER, USER_RATE_LIMIT_PER_MIN/HR now read from DB settings table (DB > ENV > default), so dashboard/settings changes apply without restart. Sync cache refreshed on every save or delete. - /api/me reports the live DB value for max_sites_per_user. Admin improvements: - Admin users bypass per-user rate limiting entirely (role=admin or ADMIN_EMAILS). - Admin Overview now shows platform stats: registered users, new users (7d), total user sites, available tools. Plugin cleanup: - Appwrite and Directus plugins removed from the active registry (8 plugins now: WordPress, WooCommerce, WordPress Specialist, Gitea, n8n, Supabase, OpenPanel, Coolify). Plugin code is retained for future re-enabling. - Settings page plugin visibility list updated to match. Mobile onboarding: - Stepper steps on narrow viewports stack vertically with correct full border and rounded corners on each step. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
64 lines
1.7 KiB
Python
64 lines
1.7 KiB
Python
"""
|
|
Multi-Endpoint Architecture for MCP Hub
|
|
|
|
This module provides a factory pattern for creating scoped MCP endpoints.
|
|
Each endpoint exposes only the tools relevant to its purpose.
|
|
|
|
Endpoints:
|
|
/mcp - Admin endpoint (all tools, requires Master API Key)
|
|
/mcp/wordpress - WordPress tools only (92 tools)
|
|
/mcp/wordpress-specialist - WordPress Specialist tools (companion-backed)
|
|
/mcp/gitea - Gitea tools only (55 tools)
|
|
/mcp/project/{id} - Project-specific tools
|
|
|
|
Benefits:
|
|
- Better security: Users only see tools they can access
|
|
- Optimized context: Smaller tool lists for AI assistants
|
|
- Scalability: Easy to add new plugin endpoints
|
|
- Clear separation of concerns
|
|
"""
|
|
|
|
from .config import (
|
|
ENDPOINT_CONFIGS,
|
|
EndpointConfig,
|
|
EndpointType,
|
|
create_project_endpoint_config,
|
|
get_endpoint_config,
|
|
)
|
|
from .factory import MCPEndpointFactory
|
|
from .middleware import (
|
|
AuthContext,
|
|
EndpointAuditMiddleware,
|
|
EndpointAuthMiddleware,
|
|
EndpointRateLimitMiddleware,
|
|
create_endpoint_middleware,
|
|
)
|
|
from .registry import (
|
|
EndpointInfo,
|
|
EndpointRegistry,
|
|
get_endpoint_registry,
|
|
initialize_endpoint_registry,
|
|
)
|
|
|
|
__all__ = [
|
|
# Config
|
|
"EndpointConfig",
|
|
"EndpointType",
|
|
"ENDPOINT_CONFIGS",
|
|
"get_endpoint_config",
|
|
"create_project_endpoint_config",
|
|
# Factory
|
|
"MCPEndpointFactory",
|
|
# Registry
|
|
"EndpointRegistry",
|
|
"EndpointInfo",
|
|
"get_endpoint_registry",
|
|
"initialize_endpoint_registry",
|
|
# Middleware
|
|
"EndpointAuthMiddleware",
|
|
"EndpointRateLimitMiddleware",
|
|
"EndpointAuditMiddleware",
|
|
"create_endpoint_middleware",
|
|
"AuthContext",
|
|
]
|