flet-mcp-server

v1.1.1
flet-mcp-server Checked 5 days ago Published 20 days ago

MCP server that makes the installed Flet source code the source of truth for AI agents

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

verify_flet_code

Verify Flet code against the INSTALLED flet — ALWAYS call this before delivering Flet code to the user. Two passes: (1) static analysis for unknown controls, invalid constructor properties, enum typos, deprecated usage and undefined event handlers, each with line numbers and hints; (2) sandboxed execution that constructs the controls (app launchers are neutralized, nothing opens) and fires flet's own validators, catching errors that only appear at runtime (e.g. Slider(min > max)). Fix every diagnostic and re-verify until status == 'passed'. Args:…

ParameterTypeDescription
code *string
timeout_secsinteger

get_flet_version

Report which flet version the source tools read, and from where. Call this first when a Flet API question matters — Flet changes faster than model training data, so the installed source is the only truth.

inspect_flet_control

Get the exact, current API of any Flet control straight from the installed source: every property with its type and default (inherited ones marked), events (on_*), deprecation warnings, the class hierarchy, and the full class source with per-property docstrings. ALWAYS use this before writing Flet UI code — control APIs in training data are often outdated. Args: control_name: Public flet class name, e.g. 'Button', 'TextField', 'CupertinoSwitch', 'Page', 'View'.

ParameterTypeDescription
control_name *string

search_flet_source

Search the installed flet source code (every .py file in the flet package). Class and function definitions rank first, then assignments, then comments. Use this to find where anything is defined, which modules exist, or how a feature is actually implemented in the CURRENT version. Args: query: Case-insensitive substring, e.g. 'Snackbar', 'on_route_change', 'adaptive', 'cupertino_switch'. max_results: Maximum matches to return (default 25).

ParameterTypeDescription
query *string
max_resultsinteger

read_flet_source

Read the actual installed source of a flet module (numbered lines). This is the ground truth when docs and training data disagree. Args: module: Dotted module or path relative to the flet package, e.g. 'controls/material/button.py', 'flet.controls.page', 'controls/types'. symbol: Optional class or function to extract instead of the whole file (e.g. 'Button', 'Page', 'Button.style' or 'app'). max_lines: Line cap when reading a whole file (default 400).

ParameterTypeDescription
module *string
max_linesinteger
symbol

list_flet_api

List every public name in the installed flet (the true flet.__all__), grouped by category: Material/Cupertino/Core controls, Services, Components & hooks, types. Use this to discover what exists in the CURRENT version before guessing control or API names.

search_flet_icons

Search valid flet icon names for ft.Icons.* / ft.CupertinoIcons.*. NEVER invent icon names — models consistently hallucinate them. This reads the icon database of the installed flet version. Args: query: Icon name fragment, e.g. 'home', 'arrow_back', 'delete_outline'. icon_set: 'material' (ft.Icons, default) or 'cupertino' (ft.CupertinoIcons). max_results: Maximum names to return (default 50).

ParameterTypeDescription
query *string
icon_setstring
max_resultsinteger

search_flet_colors

Search valid flet color constants (ft.Colors.*, incl. shades like AMBER_500, and ft.CupertinoColors.*). Use this instead of guessing color names. Args: query: Color name fragment, e.g. 'amber', 'teal', 'primary', 'error'. max_results: Maximum names to return (default 50).

ParameterTypeDescription
query *string
max_resultsinteger

search_flet_docs

Search the official Flet documentation index for a specific topic or control. Always use this first to find the correct file path before calling get_flet_doc. Docs explain intent and cookbook patterns; use the source tools for exact APIs. Args: query: The keyword to search for (e.g., 'dropdown', 'navigation', 'layout').

ParameterTypeDescription
query *string

get_flet_doc

Fetch the Markdown documentation for a specific Flet control or topic, paged to keep responses small. Long pages are cut off with a hint for the next `offset` — page through instead of dumping huge docs into the conversation. Args: doc_path: The exact path of the doc file, usually obtained from search_flet_docs (e.g., 'website/docs/controls/dropdown/index.md'). offset: Line to start from (default 0; the response tells you the next offset). max_lines: Maximum lines to return per call (default 400).

ParameterTypeDescription
doc_path *string
max_linesinteger
offsetinteger

search_flet_examples

Search the official Flet example apps in the flet repo (counter, todo, 7guis, routing, games, declarative components, …) by keyword. Each result is a runnable project; fetch its full source with get_flet_example. Reading a real example is the fastest way to learn correct Flet idioms for a pattern. Args: query: Keywords describing the app or pattern (e.g., 'counter', 'todo', 'routing', 'drag', 'animation', 'form validation'). max_results: Maximum results (default 5).

ParameterTypeDescription
query *string
max_resultsinteger

get_flet_example

Fetch the full source of an official Flet example app (from search_flet_examples): pyproject.toml plus its Python files, bundled with a character budget so huge examples page gracefully. Args: example_id: Example id from search_flet_examples (e.g., 'counter' or '7guis/flight_booker'). max_chars: Total character budget for the returned source (default 24000).

ParameterTypeDescription
example_id *string
max_charsinteger

list_flet_controls

Get a list of all Flet UI controls that have a documentation page. For the complete programmatic API surface of the installed version (including undocumented controls, services and hooks), use list_flet_api.

list_official_packages

Get a list of all official Flet extension packages (e.g. flet-audio, flet-video). Use this to see what official extra capabilities Flet supports outside the core library.

search_flet_ecosystem

Search the open-source community for third-party Flet packages and components. Use this when the user wants to add a feature (e.g., 'calendar', 'table', 'auth') that might not be in the core Flet library. Args: query: The keyword to search for (e.g., 'calendar').

ParameterTypeDescription
query *string

get_package_details

Fetch PyPI details, current version, and installation instructions for a specific Flet package. Args: package_name: The exact name of the package on PyPI (e.g., 'flet-audio').

ParameterTypeDescription
package_name *string