dataflow.mcp.discovery¶
MCP Server Discovery for haive-dataflow.
This module provides discovery capabilities for MCP (Model Context Protocol) servers from various sources and integrates them with the haive-dataflow registry system.
The discovery system can find MCP servers from: - npm packages (@modelcontextprotocol/) - PyPI packages (mcp-) - GitHub repositories - Local configurations - Existing haive-mcp downloaded servers
- Classes:
MCPDiscovery: Main discovery engine for MCP servers
- Functions:
discover_mcp_servers: Discover and register MCP servers in dataflow registry
Attributes¶
Classes¶
Discovery engine for MCP servers. |
Functions¶
|
Discover MCP servers and create registry items. |
Module Contents¶
- class dataflow.mcp.discovery.MCPDiscovery(registry_system=None)¶
Discovery engine for MCP servers.
This class provides comprehensive discovery of MCP servers from various sources and creates appropriate registry entries for integration with haive-dataflow.
- registry_system¶
Reference to the dataflow registry system
- discovered_servers¶
Cache of discovered server configurations
Examples
Basic usage:
discovery = MCPDiscovery() servers = await discovery.discover_all()
# Register with dataflow registry await discovery.register_with_dataflow()
- async discover_all() list[haive.dataflow.registry.models.MCPServerConfig]¶
Discover MCP servers from all available sources.
- Returns:
List of discovered MCP server configurations
- async discover_from_haive_mcp() list[haive.dataflow.registry.models.MCPServerConfig]¶
Discover servers from the haive-mcp package data.
This integrates with the existing haive-mcp package to load the 941 downloaded servers into the dataflow registry.
- Returns:
List of MCP server configurations from haive-mcp
- async discover_local_servers() list[haive.dataflow.registry.models.MCPServerConfig]¶
Discover locally configured MCP servers.
- Returns:
List of locally configured MCP server configurations
- async discover_npm_servers() list[haive.dataflow.registry.models.MCPServerConfig]¶
Discover MCP servers from npm packages.
- Returns:
List of npm-based MCP server configurations
- async discover_pip_servers() list[haive.dataflow.registry.models.MCPServerConfig]¶
Discover MCP servers from pip packages.
- Returns:
List of pip-based MCP server configurations
- async register_with_dataflow() list[str]¶
Register discovered MCP servers with the dataflow registry.
- Returns:
List of registry IDs for registered servers
- registry_system = None¶
- async dataflow.mcp.discovery.discover_mcp_servers(registry_system=None) list[haive.dataflow.registry.models.RegistryItem]¶
Discover MCP servers and create registry items.
This function provides a simple interface for discovering MCP servers and creating appropriate registry items for the dataflow system.
- Parameters:
registry_system – Optional registry system for registration
- Returns:
List of RegistryItem objects for discovered MCP servers
Examples
from haive.dataflow.mcp.discovery import discover_mcp_servers from haive.dataflow import registry_system
# Discover and register MCP servers registry_items = await discover_mcp_servers(registry_system) print(f”Discovered {len(registry_items)} MCP servers”)
- dataflow.mcp.discovery.logger¶