Skip to content

Index

Professor MCP Server.

ProfessorServer

Bases: BaseMCPServer

MCP Server for Professor analysis and visualization.

Source code in src/mada_tools/surrogate/professor/server.py
class ProfessorServer(BaseMCPServer):
    """MCP Server for Professor analysis and visualization."""

    def __init__(self):
        super().__init__("Professor Analysis", "Professor analysis and visualization tools")

        self.professor_helper = ProfessorHelper()

    def _register_tools(self):
        """Register MCP tools for Professor operations."""

        @self.mcp.tool()
        async def launch_professor_gui(yaml_file: str) -> str:
            """
            Launch Professor GUI from the given YAML config.

            Args:
                yaml_file: Path to Professor YAML config file

            Returns:
                str: Confirmation message once GUI process has started
            """
            return await self.run_tool(self.professor_helper.launch_professor_gui, yaml_file)

        @self.mcp.tool()
        async def analyze_image_with_llm(image_path: str, prompt: str) -> str:
            """
            Use an LLM to analyze and describe an image based on a prompt.

            Args:
                image_path: Local file path to the image
                prompt: Question or instruction about the image

            Returns:
                str: LLM-generated description or error message
            """
            return await self.run_tool(self.professor_helper.analyze_image_with_llm, image_path, prompt)