INNER CODE UNIT · Python
_json_result
Nebulock-Inc/agentic-threat-hunting-framework · athf/mcp/server.py:45
def _json_result(data: Any) -> str:
"""Serialize a result to JSON string for MCP tool output."""
return json.dumps(data, indent=2, default=str)
def _discover_plugin_tools() -> list:
"""Discover MCP tool registration functions from installed plugins."""
from importlib.metadata import entry_points
return list(entry_points(group="athf.mcp_tools"))
def create_server(workspace_path: Optional[str] = None) -> "FastMCP": # type: ignore[name-defined] # noqa: F821
"""Create and configure the ATHF MCP server.
Args:
workspace_path: Explicit workspace path (optional).