INNER CODE UNIT · Python
__init__
oneclickvirt/ecs · agent/server.py:118
def __init__(self, profile_path):
self.path = Path(profile_path).resolve()
self.profile = json.loads(self.path.read_text(encoding="utf-8"))
self.repo = self.profile["repository"]
if not re.fullmatch(r"oneclickvirt/[A-Za-z0-9_.-]+", self.repo):
raise ValueError("Invalid repository profile")
def binary(self):
return os.environ.get("ONECLICKVIRT_MCP_BINARY") or self.profile.get("binary", "")
def tools(self):
result = []
def add(name, description, spec=None, write=False, external=False):
result.append({"name": name, "description": description, "inputSchema": spec or schema(),
"annotations": {"readOnlyHint": not write, "destructiveHint": write,
"idempotentHint": not write, "openWorldHint": external}})
add("integration_info", "Show repository, supported operations, prerequisites and documentation.")
if self.profile.get("releases"):