mcp.plugins.browser_pluginΒΆ
MCP Browser Plugin - Manage Our 63 Downloaded MCP Servers
This plugin inherits from PluginPlatform and specializes in managing the 63 MCP servers we successfully downloaded using our bulk installer. It implements the intelligent inheritance pattern from our architecture plan.
Key Features: - Inherits all PluginPlatform capabilities - Loads servers from our actual CSV and install report data - Intelligent caching for performance - FastAPI route registration for server browsing - Real integration with our download infrastructure
Architecture: - Inherits from: PluginPlatform (which inherits from BasePlatform) - Manages: DownloadedServerInfo instances - Provides: Server discovery, health checks, browsing interface - Integrates: Real CSV data and install reports from our bulk download
AttributesΒΆ
ClassesΒΆ
Plugin for managing our 63 downloaded MCP servers. |
Module ContentsΒΆ
- class mcp.plugins.browser_plugin.MCPBrowserPluginΒΆ
Bases:
haive.dataflow.platform.models.PluginPlatform
Plugin for managing our 63 downloaded MCP servers.
This plugin inherits from PluginPlatform and specializes in managing the MCP servers we successfully downloaded during our bulk download session. It demonstrates the intelligent inheritance pattern by extending platform capabilities while maintaining the Pydantic-first design philosophy.
Inheritance Features: - Inherits: platform_id, status, metadata, lifecycle methods from BasePlatform (via PluginPlatform) - Inherits: entry_point, routes, priorities, dependencies from PluginPlatform - Extends: MCP-specific server management and discovery capabilities - Specializes: Downloaded server data integration and caching
Real Integration: - Works with our actual mcp_servers_data.csv file - Uses our install report JSON files - Loads our 63 successfully downloaded servers - Provides web interface for browsing servers
Examples
Basic plugin creation:
plugin = MCPBrowserPlugin() # Uses intelligent defaults for all inherited fields
With custom data paths:
plugin = MCPBrowserPlugin( servers_data_file=Path("custom/path/servers.csv"), install_reports_pattern="custom_install_*.json" )
Plugin initialization:
await plugin.initialize() servers = plugin.get_servers() print(f"Loaded {len(servers)} downloaded servers")
- get_plugin_stats() Dict[str, Any] ΒΆ
Get comprehensive plugin statistics.
- Returns:
Dictionary with plugin statistics and server information
- get_server_by_name(server_name: str) haive.dataflow.platform.models.DownloadedServerInfo | None ΒΆ
Get a specific server by name.
- Parameters:
server_name β Server name to search for
- Returns:
Server if found, None otherwise
- get_servers() List[haive.dataflow.platform.models.DownloadedServerInfo] ΒΆ
Get our 63 downloaded servers with intelligent caching.
This method implements intelligent caching to avoid repeatedly loading and processing our server data. It uses the cache TTL to determine when to refresh the data.
- Returns:
List of DownloadedServerInfo instances for our downloaded servers
Examples
>>> plugin = MCPBrowserPlugin() >>> servers = plugin.get_servers() >>> len(servers) 63 >>> all(s.source == ServerSource.DOWNLOADED for s in servers) True
- get_servers_by_language(language: str) List[haive.dataflow.platform.models.DownloadedServerInfo] ΒΆ
Get servers filtered by programming language.
- Parameters:
language β Programming language to filter by
- Returns:
List of servers matching the language
- get_servers_by_stars(min_stars: int = 0) List[haive.dataflow.platform.models.DownloadedServerInfo] ΒΆ
Get servers with at least the specified number of stars.
- Parameters:
min_stars β Minimum number of GitHub stars
- Returns:
List of servers sorted by star count (descending)
- async initialize() None ΒΆ
Initialize plugin with validation and server loading.
This method extends the base PluginPlatform initialization with MCP-specific setup and validation.
- register_routes(app: fastapi.FastAPI) None ΒΆ
Register plugin routes with FastAPI app.
This method creates FastAPI routes for browsing our downloaded servers. Itβs called by the platform during plugin initialization.
- Parameters:
app β FastAPI application instance to register routes with
- classmethod validate_servers_data_file_exists(v: pathlib.Path) pathlib.Path ΒΆ
Validate that servers data file exists (when not using defaults).
- cache_timestamp: datetime.datetime | None = NoneΒΆ
- downloaded_servers_path: pathlib.Path = NoneΒΆ
- model_configΒΆ
- servers_data_file: pathlib.Path = NoneΒΆ
- mcp.plugins.browser_plugin.loggerΒΆ