haive.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

Classes

MCPBrowserPlugin

Plugin for managing our 63 downloaded MCP servers.

Module Contents

class haive.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")
async cleanup()

Cleanup plugin resources.

Return type:

None

get_plugin_stats()

Get comprehensive plugin statistics.

Returns:

Dictionary with plugin statistics and server information

Return type:

Dict[str, Any]

get_server_by_name(server_name)

Get a specific server by name.

Parameters:

server_name (str) – Server name to search for

Returns:

Server if found, None otherwise

Return type:

Optional[haive.dataflow.platform.models.DownloadedServerInfo]

get_servers()

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

Return type:

List[haive.dataflow.platform.models.DownloadedServerInfo]

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)

Get servers filtered by programming language.

Parameters:

language (str) – Programming language to filter by

Returns:

List of servers matching the language

Return type:

List[haive.dataflow.platform.models.DownloadedServerInfo]

get_servers_by_stars(min_stars=0)

Get servers with at least the specified number of stars.

Parameters:

min_stars (int) – Minimum number of GitHub stars

Returns:

List of servers sorted by star count (descending)

Return type:

List[haive.dataflow.platform.models.DownloadedServerInfo]

async initialize()

Initialize plugin with validation and server loading.

This method extends the base PluginPlatform initialization with MCP-specific setup and validation.

Return type:

None

register_routes(app)

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.FastAPI) – FastAPI application instance to register routes with

Return type:

None

classmethod validate_servers_data_file_exists(v)

Validate that servers data file exists (when not using defaults).

Parameters:

v (pathlib.Path)

Return type:

pathlib.Path