Files
2026-07-13 13:22:34 +08:00

28 lines
593 B
Python

import sys
import pytest
from fastmcp import Client
from fastmcp.client.transports import StdioTransport
import mlflow
@pytest.mark.asyncio
async def test_cli():
transport = StdioTransport(
command=sys.executable,
args=[
"-m",
"mlflow",
"mcp",
"run",
],
env={
"MLFLOW_TRACKING_URI": mlflow.get_tracking_uri(),
"MLFLOW_MCP_TOOLS": "traces,scorers",
},
)
async with Client(transport) as client:
tools = await client.list_tools()
assert len(tools) > 0