Skip to main content
Glama

MLflow MCP Server

by iRahulPandey

MLflow MCP 服务器:MLflow 的自然语言接口

该项目通过模型上下文协议 (MCP) 为 MLflow 提供自然语言接口。它允许您使用简单的英语查询 MLflow 跟踪服务器,从而更轻松地管理和探索您的机器学习实验和模型。

概述

MLflow MCP Agent由两个主要组件组成:

  1. MLflow MCP 服务器mlflow_server.py ):连接到您的 MLflow 跟踪服务器并通过模型上下文协议 (MCP) 公开 MLflow 功能。
  2. MLflow MCP 客户端mlflow_client.py ):提供自然语言界面,使用对话式 AI 助手与 MLflow MCP 服务器进行交互。

特征

  • 自然语言查询:用简单的英语询问有关 MLflow 跟踪服务器的问题
  • 模型注册表探索:获取有关已注册模型的信息
  • 实验跟踪:列出并探索您的实验和运行
  • 系统信息:获取有关 MLflow 环境的状态和元数据

先决条件

  • Python 3.8+
  • MLflow 服务器正在运行(默认值: http://localhost:8080
  • LLM 的 OpenAI API 密钥

安装

  1. 克隆此存储库:
    git clone https://github.com/iRahulPandey/mlflowMCPServer.git cd mlflowMCPServer
  2. 创建虚拟环境:
    python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
  3. 安装所需的软件包:
    pip install mcp[cli] langchain-mcp-adapters langchain-openai langgraph mlflow
  4. 设置您的 OpenAI API 密钥:
    export OPENAI_API_KEY=your_key_here
  5. (可选)配置 MLflow 跟踪服务器 URI:
    export MLFLOW_TRACKING_URI=http://localhost:8080

用法

启动 MCP 服务器

首先,启动 MLflow MCP 服务器:

python mlflow_server.py

该服务器连接到您的 MLflow 跟踪服务器并通过 MCP 公开 MLflow 功能。

进行查询

服务器运行后,您可以使用客户端进行自然语言查询:

python mlflow_client.py "What models do I have registered in MLflow?"

示例查询:

  • “显示 MLflow 中所有已注册的模型”
  • “列出我的所有实验”
  • “获取名为‘iris-classifier’的模型的详细信息”
  • “我的 MLflow 服务器的状态如何?”

配置

您可以使用环境变量自定义行为:

  • MLFLOW_TRACKING_URI :MLflow 跟踪服务器的 URI(默认值: http://localhost:8080
  • OPENAI_API_KEY :您的 OpenAI API 密钥
  • MODEL_NAME :要使用的 OpenAI 模型(默认值: gpt-3.5-turbo-0125
  • MLFLOW_SERVER_SCRIPT :MLflow MCP 服务器脚本的路径(默认值: mlflow_server.py
  • LOG_LEVEL :日志级别(默认值: INFO

MLflow MCP 服务器( mlflow_server.py

该服务器连接到您的 MLflow 跟踪服务器并通过 MCP 公开以下工具:

  • list_models :列出 MLflow 模型注册表中所有已注册的模型
  • list_experiments :列出 MLflow 跟踪服务器中的所有实验
  • get_model_details :获取特定注册模型的详细信息
  • get_system_info :获取有关 MLflow 跟踪服务器和系统的信息

限制

  • 目前仅支持 MLflow 的部分功能
  • 客户端需要互联网访问才能使用 OpenAI 模型
  • 对于复杂的 MLflow 操作,错误处理可能会受到限制

未来的改进

  • 添加对 MLflow 模型预测的支持
  • 提高对更复杂查询的自然语言理解
  • 添加指标和参数的可视化功能
  • 支持更多 MLflow 操作,例如运行管理和工件处理

致谢

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

MLflow 的自然语言界面,允许用户通过模型上下文协议使用简单的英语查询和管理他们的机器学习实验和模型。

  1. 概述
    1. 特征
      1. 先决条件
        1. 安装
          1. 用法
            1. 启动 MCP 服务器
            2. 进行查询
          2. 配置
            1. MLflow MCP 服务器( mlflow_server.py )
              1. 限制
                1. 未来的改进
                  1. 致谢

                    Related MCP Servers

                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model Context Protocol server that enables AI agents to query Erick Wendel's talks, blog posts, and videos across different platforms using natural language.
                      Last updated -
                      55
                      TypeScript
                      MIT License
                    • -
                      security
                      F
                      license
                      -
                      quality
                      A Model Context Protocol server that enables AI assistants to interact with Coolify instances through natural language, allowing management of servers, applications, databases, and deployments.
                      Last updated -
                      85
                      2
                      TypeScript
                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model Context Protocol server that enables AI assistants to interact with n8n workflows through natural language, supporting actions like listing, creating, updating, executing and monitoring workflows.
                      Last updated -
                      388
                      464
                      TypeScript
                      MIT License
                      • Apple
                      • Linux
                    • -
                      security
                      F
                      license
                      -
                      quality
                      A Model Context Protocol server that allows AI assistants to interact with Prefect's workflow automation platform through natural language, enabling users to manage flows, deployments, tasks, and other Prefect resources via conversational commands.
                      Last updated -
                      4
                      Python

                    View all related MCP servers

                    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/iRahulPandey/mlflowMCPServer'

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