Skip to main content
Glama
Reflex Docs MCP Server

Reflex Docs MCP Server

Reflex Docs MCP Server

Version 0.2.0 — 14 tools, connection pooling, FTS5 query upgrades, TTL caching

New in 0.2.0

New Tools

  • get_code_examples(topic) — Find Python code examples from docs for a topic

  • decode_error(error_text) — Analyze a Reflex error and find relevant docs

  • get_changelog(version?) — Fetch Reflex release notes from GitHub

  • get_migration_guide(from_version, to_version) — Get migration guidance between versions

  • search_api_reference(symbol) — Look up API reference for a Reflex symbol

  • get_component_props(name) — Get only the props table for a component

  • list_recipes(category?) — Browse recipe/tutorial pages

Enhancements

  • search_docs — New fuzzy flag (prefix expansion), include_content flag (full page content)

  • get_doc — New extract_code flag (return only fenced code blocks)

Performance

  • SQLite connection pooling via threading.local() with persistent per-thread connections

  • WAL journal mode, 64 MB page cache, 256 MB mmap for concurrent reads

  • LRU cache (512 entries) on slug lookups

  • In-process TTL cache (300s default) on search results

  • FTS5 query preprocessor: phrase match + prefix expansion

  • Incremental indexing — skips re-index if git commit unchanged

Ground AI agents in real, up-to-date Reflex docs via a fast, local MCP server.

Python: 3.14 recommended. Compatible with 3.13+.

Related MCP server: LlamaIndex Documentation MCP Server

What It Does

  • Full‑text search over Reflex docs (SQLite FTS5)

  • Section‑level retrieval for precise context

  • Component index for rx.* lookups

  • FastMCP server with stdio and SSE transports

Quickstart

# Create venv
python3.14 -m venv .venv
. .venv/bin/activate

# Install (local checkout)
pip install -e .

# Index docs (clones Reflex docs and builds search index)
python -m reflex_docs_mcp.indexer

# Run MCP server (stdio)
python -m reflex_docs_mcp.server

# Run MCP server over SSE
python -m reflex_docs_mcp.server --transport sse --host 127.0.0.1 --port 8000

Install From PyPI

pip install reflex-docs-mcp

MCP Tools

  • search_docs(query, limit?, include_content?, fuzzy?) — Full-text search with fuzzy matching

  • get_doc(slug, extract_code?) — Retrieve a full doc page by slug

  • list_pages(prefix?, limit?) — List doc pages by slug prefix

  • list_components(category?) — List all Reflex components

  • search_components(query, limit?) — Search components by name/description

  • get_component(name) — Get details about a specific component

  • get_component_props(name, filter?) — Get component props table

  • get_stats() — Database statistics

  • get_code_examples(topic, limit?) — Find Python code examples for a topic

  • decode_error(error_text, context?) — Analyze errors against docs

  • get_changelog(version?, limit?) — Fetch Reflex release notes

  • get_migration_guide(from_version, to_version) — Migration guidance between versions

  • search_api_reference(symbol) — API reference lookup

  • list_recipes(category?) — Browse recipe/tutorial pages

Local MCP Config (VS Code)

The repository includes a ready-to-use config at .vscode/mcp.json that runs the server with the local venv.

Global Install MCP Config (VS Code)

If you install the package globally with pip, use one of these in .vscode/mcp.json:

Using module invocation:

{
  "servers": {
    "reflex-docs": {
      "type": "stdio",
      "command": "python3",
      "args": ["-m", "reflex_docs_mcp.server"],
      "env": {
        "REFLEX_DOCS_AUTO_INDEX": "true"
      }
    }
  },
  "inputs": []
}

Using the CLI entry point:

{
  "servers": {
    "reflex-docs": {
      "type": "stdio",
      "command": "reflex-docs-mcp",
      "args": [],
      "env": {
        "REFLEX_DOCS_AUTO_INDEX": "true"
      }
    }
  },
  "inputs": []
}

Project Layout

├── main.py                 # MCP stdio entry point
├── src/reflex_docs_mcp/
│   ├── models.py           # Pydantic data models
│   ├── database.py         # SQLite + FTS5 operations
│   ├── parser.py           # Markdown parser
│   ├── http.py            # Shared HTTP client with TTL cache
│   ├── indexer.py          # Docs cloning & indexing
│   └── server.py           # MCP server (stdio + SSE)
├── render.yaml             # Render deployment config
├── Procfile                # Process definition
└── test.py                 # Groq + MCP demo client

Demo (Optional)

The demo client uses Groq (OpenAI-compatible API) and the MCP Python client.

pip install reflex-docs-mcp[demo]
cp env.example .env
# Add GROQ_API_KEY to .env
python test.py

Notes

  • env.example contains Groq settings.

  • The indexer writes to data/reflex_docs.db by default.

  • On startup, the server auto-builds the index if missing. Controls:

  • REFLEX_DOCS_AUTO_INDEX (default: true)

  • REFLEX_DOCS_DOCS_SRC (path to clone docs into, default: docs_src)

  • REFLEX_DOCS_SKIP_CLONE / REFLEX_DOCS_FORCE_CLONE

  • REFLEX_DOCS_KEEP_EXISTING

  • REFLEX_DOCS_CACHE_TTL (default: 300) — Seconds for search cache TTL

  • REFLEX_DOCS_HTTP_TIMEOUT (default: 10) — Seconds for outbound HTTP requests

  • REFLEX_DOCS_MAX_SEARCH_LIMIT (default: 30) — Hard cap on search result limit

  • REFLEX_DOCS_ENABLE_LIVE_FETCH (default: true) — If false, disable live HTTP fetches

License

MIT

Available Tools

14 tools
decode_errorA

Analyze a Reflex error and find relevant documentation.

Args: error_text: The error message or traceback text context: Optional additional context about what you were doing

Returns: Dict with error class, rx symbols, relevant docs, and search queries used

Inputs: error_text (required), context. Returns: object

get_changelogA

Fetch Reflex release notes from the changelog.

Args: version: Specific version to fetch (e.g., "0.6.1"). Empty for latest releases. limit: Number of recent releases to return if version is empty (default: 5)

Returns: Dict with requested version, count, source URL, and release sections

Inputs: version, limit. Returns: object

get_code_examplesA

Find Python code examples from Reflex docs related to a topic.

Args: topic: Topic to search for (e.g., "state vars", "event handlers") limit: Maximum number of code examples to return (default: 5)

Returns: Dict with topic, count, and list of code examples with source info

Inputs: topic (required), limit. Returns: object

get_componentA

Get detailed information about a specific Reflex component.

Args: name: Component name (e.g., "rx.box", "rx.button", "box", "button") The "rx." prefix is optional.

Returns: Component info with name, category, description, and documentation URL

Example: get_component("rx.box") get_component("button")

Inputs: name (required). Returns: result

get_component_propsA

Get the props table for a specific Reflex component.

Args: name: Component name (e.g., "rx.button", "button"). The "rx." prefix is optional. filter: Optional filter string to match prop names or descriptions

Returns: Dict with component name, total props count, and filtered props list

Inputs: name (required), filter. Returns: object

get_docA

Retrieve a full documentation page by its slug.

Args: slug: Document slug (e.g., "library/layout/box", "components/rendering_iterables") extract_code: If True, return only fenced code blocks from the page

Returns: Full document with title, URL, and all sections with markdown content

Example: get_doc("library/layout/box") get_doc("state/overview", extract_code=True)

Inputs: slug (required), extract_code. Returns: result

get_migration_guideA

Get migration guidance between two Reflex versions.

Args: from_version: The version you're migrating from (e.g., "0.5.0") to_version: The version you're migrating to (e.g., "0.6.0")

Returns: Dict with breaking changes, relevant docs, and changelog section

Inputs: from_version (required), to_version (required). Returns: object

get_statsA

Get statistics about the indexed documentation.

Returns: Dictionary with counts of pages, sections, and components

Inputs: no named parameters. Returns: object

list_componentsA

List all documented Reflex components.

Args: category: Optional category filter (e.g., "layout", "forms", "data-display")

Returns: List of components with name, category, description, and documentation URL

Example: list_components() list_components("layout") list_components("forms")

Inputs: category. Returns: result

list_pagesA

List documentation pages, optionally filtered by slug prefix.

Args: prefix: Optional slug prefix (e.g., "library/", "state/") limit: Maximum number of results to return (default: 200)

Returns: List of pages with slug, title, and URL

Inputs: prefix, limit. Returns: result

list_recipesA

Browse recipe and tutorial pages from Reflex docs.

Args: category: Optional category filter (e.g., "auth", "database")

Returns: Dict with category filter, count, and list of recipes with summaries

Inputs: category. Returns: object

search_api_referenceA

Look up API reference documentation for a Reflex symbol.

Args: symbol: The symbol to look up (e.g., "rx.State", "rx.button", "EventHandler")

Returns: Dict with symbol info, headings, code blocks, and tables

Inputs: symbol (required). Returns: object

search_componentsA

Search components by name or description.

Args: query: Search query (e.g., "button", "layout", "table") limit: Maximum number of results to return (default: 20)

Returns: List of matching components with name, category, description, and documentation URL

Inputs: query (required), limit. Returns: result

search_docsA

Search Reflex documentation by keyword or natural language query.

Args: query: Search query (e.g., "rx.foreach", "state management", "styling") limit: Maximum number of results to return (default: 10) include_content: If True, include full page content in each result (max 5 results) fuzzy: If True, enable prefix expansion for broader matching (default: True)

Returns: List of matching documentation sections with slug, title, score, snippet, and URL

Example: search_docs("rx.foreach") search_docs("how to style components", fuzzy=True)

Inputs: query (required), limit, include_content, fuzzy. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: error decoding, changelog, code examples, component details, props, full doc pages, migration guides, stats, and various listing/search functions. Even overlapping tools like get_component, list_components, and search_components are complementary with clear boundaries.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with snake_case (e.g., decode_error, get_changelog, list_components, search_docs). No mixing of conventions, making the interface predictable.

    Tool Count5/5

    14 tools is well-scoped for a documentation server. It provides a comprehensive set of operations without being overwhelming, covering error analysis, browsing, searching, and retrieval.

    Completeness5/5

    The tool set covers all major documentation needs: error-assisted lookup, search by keyword/API symbol/component, browsing components/pages/recipes, retrieving full docs and migration guides, and obtaining statistics. No obvious gaps for typical agent interactions with a framework's docs.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers