<#1036 Flyte MCP: native MCP to access flyte remot...
# flyte-github
a
#1036 Flyte MCP: native MCP to access flyte remote commands and more. Pull request opened by cosmicBboy This pull request introduces support for deploying and serving Model Context Protocol (MCP) servers within Flyte, enabling AI assistants and LLM-based clients to interact with Flyte via standardized MCP tools. It adds new example applications, a generic MCP app environment, a CLI entrypoint, and corresponding tests. The main themes are: new Flyte MCP app environments, CLI and packaging updates, and test coverage. New Flyte MCP App Environments and Examples: • Added
FlyteMCPAppEnvironment
and
MCPAppEnvironment
classes to allow serving Flyte-integrated MCP servers and generic FastMCP servers, respectively. These environments expose Flyte operations as MCP tools over HTTP with configurable endpoints, tool groups, and search paths. (
src/flyte/ai/mcp/_mcp_app.py
[1]
src/flyte/ai/mcp/__init__.py
[2] • Added comprehensive examples for deploying MCP servers: •
flyte_mcp_app.py
: Deploys a full-featured MCP server with all Flyte tools. •
flyte_mcp_app_filtered.py
: Shows how to restrict tool access and configure search paths with an allowlist. •
generic_mcp_app.py
: Demonstrates serving a generic FastMCP server as a Flyte app. CLI and Packaging Updates: • Added a new CLI entrypoint
flyte-mcp
for serving a Flyte MCP server, with options for tool selection, search paths, and HTTP configuration. (
src/flyte/_bin/mcp.py
[1]
pyproject.toml
[2] • Updated
pyproject.toml
to include a new
mcp
optional dependency group for examples and to register the new CLI. [1] [2] Test Coverage: • Introduced unit tests for the new
MCPAppEnvironment
, verifying correct mounting, health checks, and error handling for invalid configurations. (
tests/flyte/ai/mcp/test_mcp_app_environment.py
tests/flyte/ai/mcp/test_mcp_app_environment.pyR1-R63) flyteorg/flyte-sdk