Skip to content

Commit 404b154

Browse files
authored
Merge branch 'main' into carlos/bg-search
2 parents 5523757 + dabdd7b commit 404b154

File tree

4 files changed

+134
-9
lines changed

4 files changed

+134
-9
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Installation
2+
3+
```python exec
4+
import reflex as rx
5+
```
6+
7+
To use the Reflex MCP integration, you'll need to configure your AI assistant or coding tool to connect to the Reflex MCP server. No additional Python packages are required on your local machine - the server is hosted and ready to use.
8+
9+
## Prerequisites
10+
11+
- An MCP-compatible AI tool (Claude Desktop, Windsurf, Codex, etc.)
12+
- Internet connection to access the hosted MCP server
13+
- Valid Reflex account for OAuth 2.1 authentication
14+
15+
## Authentication
16+
17+
The Reflex MCP server uses OAuth 2.1 protocol for secure authentication. You'll need a valid Reflex account, and authentication is handled automatically through your MCP client configuration when you provide your Reflex credentials.
18+
19+
## IDE and Coding Assistant Integration
20+
21+
### Claude Desktop
22+
23+
Add the Reflex MCP server to your Claude Desktop configuration by editing your configuration file:
24+
25+
```json
26+
{
27+
"mcpServers": {
28+
"reflex": {
29+
"command": "npx",
30+
"args": ["-y", "@modelcontextprotocol/server-proxy"],
31+
"env": {
32+
"MCP_PROXY_URL": "https://mcp.reflex.dev/mcp"
33+
}
34+
}
35+
}
36+
}
37+
```
38+
39+
### Windsurf/Cascade
40+
41+
Create a `.vscode/mcp.json` file in your project root:
42+
43+
```json
44+
{
45+
"mcpServers": {
46+
"reflex": {
47+
"serverType": "http",
48+
"url": "https://mcp.reflex.dev/mcp"
49+
}
50+
}
51+
}
52+
```
53+
54+
### Codex
55+
56+
Add this configuration to your `~/.codex/config.toml` file:
57+
58+
```toml
59+
[mcp_servers.reflex]
60+
command = "npx"
61+
args = ["-y", "@modelcontextprotocol/server-proxy"]
62+
env = { "MCP_PROXY_URL" = "https://mcp.reflex.dev/mcp" }
63+
```
64+
65+
Note: Codex requires MCP servers to communicate over stdio. The `@modelcontextprotocol/server-proxy` adapter bridges the connection to the HTTP-based Reflex MCP server.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Overview
2+
3+
```python exec
4+
import reflex as rx
5+
```
6+
7+
The Reflex [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) integration provides AI assistants and coding tools with structured access to Reflex framework documentation and component information. This enables intelligent assistance while developing Reflex applications.
8+
9+
The Reflex MCP server is deployed at `https://mcp.reflex.dev/mcp` and provides access to component documentation and Reflex documentation through standardized MCP tools.
10+
11+
## Available Tools
12+
13+
The Reflex MCP server provides tools for accessing component documentation and Reflex documentation through standardized MCP capabilities.
14+
15+
## Enterprise Use
16+
17+
For enterprise customers requiring on-premises deployment of the Reflex MCP server, please [book a demo](https://reflex.dev/pricing/) to discuss your requirements.

pcweb/components/docpage/sidebar/sidebar.py

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pcweb.constants import ENTERPRISE_DOCS_URL
99
from pcweb.styles.colors import c_color
1010

11-
from .sidebar_items.ai import ai_builder_overview_items
11+
from .sidebar_items.ai import ai_builder_overview_items, mcp_items
1212
from .sidebar_items.component_lib import component_lib, graphing_libs
1313
from .sidebar_items.enterprise import (
1414
enterprise_items,
@@ -383,6 +383,7 @@ def sidebar_comp(
383383
recipes_index: list[int],
384384
enterprise_usage_index: list[int],
385385
enterprise_component_index: list[int],
386+
mcp_index: list[int],
386387
#
387388
cli_ref_index: list[int],
388389
ai_builder_overview_index: list[int],
@@ -420,6 +421,12 @@ def sidebar_comp(
420421
"bot",
421422
0,
422423
),
424+
sidebar_category(
425+
"MCP",
426+
"/docs/ai-builder/integrations/mcp-overview",
427+
"plug",
428+
1,
429+
),
423430
class_name="flex flex-col items-start gap-1 w-full list-none",
424431
),
425432
# If the path doesn't start with /docs/cloud, check for general docs
@@ -489,15 +496,34 @@ def sidebar_comp(
489496
),
490497
rx.cond( # pyright: ignore [reportCallIssue]
491498
rx.State.router.page.path.startswith("/docs/ai-builder/"),
492-
rx.el.ul(
493-
create_sidebar_section(
494-
"Overview",
495-
ai_builder_pages.overview.what_is_reflex_build.path,
496-
ai_builder_overview_items,
497-
ai_builder_overview_index,
498-
url,
499+
rx.match( # pyright: ignore [reportCallIssue]
500+
SidebarState.sidebar_index,
501+
(
502+
0,
503+
rx.el.ul(
504+
create_sidebar_section(
505+
"Overview",
506+
ai_builder_pages.overview.what_is_reflex_build.path,
507+
ai_builder_overview_items,
508+
ai_builder_overview_index,
509+
url,
510+
),
511+
class_name="flex flex-col items-start gap-6 p-[0px_1rem_0px_0.5rem] w-full list-none list-style-none",
512+
),
513+
),
514+
(
515+
1,
516+
rx.el.ul(
517+
create_sidebar_section(
518+
"MCP Integration",
519+
ai_builder_pages.integrations.mcp_overview.path,
520+
mcp_items,
521+
mcp_index,
522+
url,
523+
),
524+
class_name="flex flex-col items-start gap-6 p-[0px_1rem_0px_0.5rem] w-full list-none list-style-none",
525+
),
499526
),
500-
class_name="flex flex-col items-start gap-6 p-[0px_1rem_0px_0.5rem] w-full list-none list-style-none",
501527
),
502528
rx.cond( # pyright: ignore [reportCallIssue]
503529
rx.State.router.page.path.startswith("/docs/"),
@@ -643,6 +669,7 @@ def sidebar(url=None, width: str = "100%") -> rx.Component:
643669

644670
cli_ref_index = calculate_index(cli_ref, url)
645671
ai_builder_overview_index = calculate_index(ai_builder_overview_items, url)
672+
mcp_index = calculate_index(mcp_items, url)
646673

647674
return rx.box(
648675
sidebar_comp(
@@ -659,6 +686,7 @@ def sidebar(url=None, width: str = "100%") -> rx.Component:
659686
enterprise_component_index=enterprise_component_index,
660687
ai_builder_overview_index=ai_builder_overview_index,
661688
cli_ref_index=cli_ref_index,
689+
mcp_index=mcp_index,
662690
#
663691
width=width,
664692
),

pcweb/components/docpage/sidebar/sidebar_items/ai.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,19 @@ def get_sidebar_items_ai_builder_overview():
4545
]
4646

4747

48+
def get_sidebar_items_mcp():
49+
from pcweb.pages.docs import ai_builder
50+
51+
return [
52+
create_item(
53+
"MCP Integration",
54+
children=[
55+
ai_builder.integrations.mcp_overview,
56+
ai_builder.integrations.mcp_installation,
57+
],
58+
),
59+
]
60+
61+
4862
ai_builder_overview_items = get_sidebar_items_ai_builder_overview()
63+
mcp_items = get_sidebar_items_mcp()

0 commit comments

Comments
 (0)