Skip to main content

Auto-updating MCP server for Flet documentation and packages

Project description

Flet MCP Server logo

Flet MCP Server

Model Context Protocol that serves official Flet resources to AI agents.

PyPI version Total users CI status Python >= 3.10 MCP server score


Flet MCP Server dynamically fetches and serves official Flet documentation, controls, packages, and ecosystem resources for AI agents and MCP-compatible clients.

Nwokike/flet-mcp-server MCP server

Features

  • GitHub Tree Sync: Maps documentation in real-time from the Flet repository.
  • Intelligent Caching: Uses diskcache for fast responses with 24-hour TTL.
  • Smart Search: Fuzzy matching, keyword aliases, and direct path search over documentation.
  • Ecosystem Discovery: Finds and verifies official and community Flet packages via PyPI metadata.
  • AI-Optimized: Tool definitions designed for LLM understanding with clear usage guidance.
  • Configurable: Supports custom Flet repo/branch via environment variables.
  • Resource Safe: Shared HTTP client with proper lifecycle management and graceful shutdown.

Tools Included

1. list_flet_controls

List all available Flet UI controls.

2. search_flet_docs(query)

Search the documentation index with fuzzy matching and keyword aliases.

3. get_flet_doc(doc_path)

Get raw Markdown for a specific doc file.

4. list_official_packages()

List official Flet extension packages from the monorepo.

5. search_flet_ecosystem(query)

Search for verified community Flet components on GitHub.

6. get_package_details(package_name)

Fetch version, type classification, and installation info from PyPI.

Client Configuration Examples

๐ŸŒŒ VSCode

Add this to your .vscode/mcp.json:

{
  "servers": {
    "flet-mcp-server": {
      "command": "uvx",
      "args": ["flet-mcp-server"]
    }
  }
}

๐ŸŒŒ Antigravity / Cascade

Add this to your mcp_config.json:

{
  "mcpServers": {
    "flet-mcp-server": {
      "command": "uvx",
      "args": ["flet-mcp-server"]
    }
  }
}

๐Ÿค– Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "flet-mcp-server": {
      "command": "uvx",
      "args": ["flet-mcp-server"]
    }
  }
}

๐Ÿ’ป Cursor / Windsurf

In your IDE's MCP settings, add a new server:

  • Name: Flet MCP
  • Type: Command
  • Command: uvx flet-mcp-server

๐Ÿ’ป OpenCode

Add this to your ~/.opencode/opencode.json or project-level .opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "flet-mcp": {
      "type": "local",
      "command": ["uvx", "flet-mcp-server"],
      "enabled": true
    }
  }
}

For authenticated GitHub API access (higher rate limits), set GITHUB_TOKEN in your environment:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "flet-mcp": {
      "type": "local",
      "command": ["uvx", "flet-mcp-server"],
      "enabled": true,
      "env": {
        "GITHUB_TOKEN": "your-github-token"
      }
    }
  }
}

Environment Variables

Variable Default Description
FLET_MCP_CACHE_DIR /tmp/flet-mcp-cache Directory for persistent cache storage
GITHUB_TOKEN (none) GitHub personal access token for higher API rate limits
FLET_REPO flet-dev/flet GitHub repository to fetch docs from
FLET_BRANCH main Branch or tag to fetch docs from

Development

Directory Structure

flet-mcp-server/
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ”œโ”€โ”€ ci.yml
โ”‚       โ””โ”€โ”€ publish.yml
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ ARCHITECTURE.md
โ”‚   โ””โ”€โ”€ CONTRIBUTING.md
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ flet_mcp/
โ”‚       โ”œโ”€โ”€ services/
โ”‚       โ”‚   โ”œโ”€โ”€ github_docs.py
โ”‚       โ”‚   โ”œโ”€โ”€ packages.py
โ”‚       โ”‚   โ””โ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ exceptions.py
โ”‚       โ”œโ”€โ”€ http.py
โ”‚       โ”œโ”€โ”€ main.py
โ”‚       โ””โ”€โ”€ server.py
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test_fetcher.py
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ uv.lock

Install

git clone https://github.com/Nwokike/flet-mcp-server.git
cd flet-mcp-server
uv sync

Test

uv run pytest

Lint

uv run ruff check .

Changelog

v0.2.0

  • Smart Search: Added fuzzy matching, keyword alias index, and multi-strategy search (direct > alias > fuzzy)
  • Shared HTTP Client: Single httpx.AsyncClient with proper lifecycle management via server lifespan
  • Custom Exceptions: DocNotFoundError, PackageNotFoundError, FetchError, TreeFetchError for better error handling
  • Configurable Repo/Branch: FLET_REPO and FLET_BRANCH environment variables for version pinning
  • Robust Control Parsing: Set-based deduplication with safer path parsing
  • Concurrent Verification: Batched PyPI verification with semaphore-based rate limiting for ecosystem search
  • Graceful Shutdown: Server lifespan handler cleans up HTTP connections
  • Better Error Handling: All tools catch and format errors gracefully for LLM consumption
  • Mocked Tests: Full test suite with mocked HTTP responses for fast, reliable CI
  • OpenCode Support: Added OpenCode MCP configuration example to README
  • Expanded Fallback: Added flet, flet-cli, flet-desktop, flet-web to fallback package list
v0.1.1
  • Initial release with 6 MCP tools
  • GitHub Tree API integration with diskcache
  • PyPI verification for ecosystem packages

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flet_mcp_server-0.2.0.tar.gz (80.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flet_mcp_server-0.2.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file flet_mcp_server-0.2.0.tar.gz.

File metadata

  • Download URL: flet_mcp_server-0.2.0.tar.gz
  • Upload date:
  • Size: 80.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for flet_mcp_server-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cab9f1d074a5f181815816ba6ddc4504601e0f3d19768de371d8953ecf31c16a
MD5 8d703ed86ba3f27f746cc082182816b7
BLAKE2b-256 727c041d3cbcd9ffd257e61735878a44a4816b1e472cbe774e6412f4aa0e58f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for flet_mcp_server-0.2.0.tar.gz:

Publisher: publish.yml on Nwokike/flet-mcp-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flet_mcp_server-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: flet_mcp_server-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for flet_mcp_server-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f323f585aafa0628d2188e4cbed90f84c7d590a506733bbc5295d406812cc570
MD5 2b853d8c568037b127bee40884174dc8
BLAKE2b-256 66cee87a6347cd93f4da3d934069a4778433429e384a8c09bd678edb985f23b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for flet_mcp_server-0.2.0-py3-none-any.whl:

Publisher: publish.yml on Nwokike/flet-mcp-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page