Self-hosted, Docker-based agentic troubleshooting platform: FastAPI backend + LangGraph agent, Next.js UI, tiered LLM routing (local Ollama -> Gemini -> DeepSeek -> OpenRouter), MCP server manager, encrypted device credentials, RBAC, audit log, project-memory + Obsidian integrations, and editable troubleshooting decision rules tuned for the GeneseasX vessel stack. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
891 B
Python
30 lines
891 B
Python
"""Connect argument builders for layer MCP tools (device ctx + .env fallbacks)."""
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
|
|
def pfsense_connect_args(ctx: dict) -> dict:
|
|
port = ctx.get("port") or int(os.environ.get("DEVICE_PFSENSE_PORT", "40443") or 40443)
|
|
api_key = (
|
|
ctx.get("secret")
|
|
or os.environ.get("DEVICE_PFSENSE_API_KEY", "").strip()
|
|
or os.environ.get("DEVICE_API_KEY", "").strip()
|
|
or None
|
|
)
|
|
return {
|
|
"url": f"https://{ctx['address']}:{port}",
|
|
"api_key": api_key,
|
|
"name": ctx.get("catalog_key") or "pfsense",
|
|
"verify_ssl": False,
|
|
}
|
|
|
|
|
|
def ssh_connect_args(ctx: dict, *, default_port: int = 22) -> dict:
|
|
return {
|
|
"host": ctx["address"],
|
|
"port": ctx.get("port") or default_port,
|
|
"username": ctx.get("username") or "root",
|
|
"password": ctx.get("secret"),
|
|
}
|