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

Related MCP Servers

  • -
    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 -
    130
    1,461
    MIT License
    • Apple
    • Linux
  • A
    security
    A
    license
    A
    quality
    Enables querying documents through a Langflow backend using natural language questions, providing an interface to interact with Langflow document Q\&A flows.
    Last updated -
    1
    14
    MIT License
    • Apple
  • -
    security
    A
    license
    -
    quality
    A Model Context Protocol Server that enables LLMs to interact with and execute REST API calls through natural language prompts, supporting GET/PUT/POST/PATCH operations on configured APIs.
    Last updated -
    6
    Apache 2.0
  • -
    security
    F
    license
    -
    quality
    A simple application demonstrating Model Context Protocol (MCP) integration with FastAPI and Streamlit, allowing users to interact with LLMs through a clean interface.
    Last updated -
    3
    • Linux

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