Skip to main content
Glama

MCP Orchestration Server

discovery.py718 B
import importlib.util import os from pathlib import Path def discover_agents(): agents = {} for path in Path("agents").rglob("*_agent.py"): try: spec = importlib.util.spec_from_file_location(path.stem, path) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) if hasattr(module, "get_agent_info") and hasattr(module, "create_agent"): info = module.get_agent_info() agent_id = info.get("id", path.stem) info["path"] = str(path) agents[agent_id] = info except Exception as e: print(f"⚠️ Failed to discover {path}: {e}") return agents

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Nisarg-123-web/MCP2'

If you have feedback or need assistance with the MCP directory API, please join our Discord server