28 lines
593 B
Python
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
|