Extensibleapp
Extensible React platform with Module Federation, SDK, and MCP server for power user page development with Claude Code
Ask AI about Extensibleapp
Powered by Claude Β· Grounded in docs
I know everything about Extensibleapp. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Extensible Web Application Prototype
A plugin-based React application where power users can build custom pages using Claude Code, an SDK, and an MCP server β and have those pages dynamically loaded into the main shell app via Module Federation.
Architecture
extensibleapp/
βββ shell/ # Main React app (host)
β βββ src/
β β βββ App.tsx # Routes + dynamic page mounting
β β βββ main.tsx # Entry point with providers
β β βββ api-server.ts # Express API wrapping the SQLite DB
β β βββ components/
β β β βββ Shell.tsx # Layout + sidebar nav
β β β βββ RemotePageLoader.tsx # Dynamic module federation loader
β β βββ lib/
β β β βββ loadRemoteModule.ts # Runtime federation loading
β β β βββ useRemotePages.ts # Registry + dev remote discovery
β β βββ pages/
β β βββ HomePage.tsx # Dashboard
β β βββ BuildingsPage.tsx
β βββ vite.config.ts
β
βββ sdk/ # @yourco/sdk β shared components + hooks
β βββ src/
β βββ components/ # PageLayout, BuildingSelector, Card, StatCard, etc.
β βββ hooks/ # useBuildings, useBuildingEnergy, useSensors, etc.
β βββ contexts/ # AuthContext, ApiContext
β βββ types.ts # Shared TypeScript types
β
βββ mcp-server/ # MCP server for Claude Code data discovery
β βββ src/
β βββ index.ts # MCP tools: list_buildings, get_energy_usage, etc.
β βββ db.ts # SQLite database connection
β βββ seed.ts # Generate synthetic building/sensor/energy data
β
βββ page-template/ # Template for user-built pages
βββ src/
β βββ Page.tsx # Example page using SDK components
βββ vite.config.ts # Module Federation remote config
βββ page.manifest.json
βββ CLAUDE.md # Instructions for Claude Code
βββ .claude/
βββ settings.json # MCP server configuration
Quick Start
Prerequisites
- Node.js 18+
- npm (or pnpm/yarn with workspaces)
1. Install dependencies
npm install
2. Seed the database
cd mcp-server
npx tsx src/seed.ts
cd ..
This creates mcp-server/data.db with synthetic data:
- 8 buildings across Portland, Seattle, and Eugene
- Sensors (temperature, humidity, CO2, occupancy, light, power) per floor
- 7 days of hourly sensor readings
- 90 days of daily energy usage
- Alerts per building
3. Start the shell
cd shell
npm run dev
This starts:
- Vite dev server on http://localhost:3000 (React app)
- Express API on http://localhost:4000 (data endpoints)
4. Start a custom page (in another terminal)
cd page-template
npm run dev
This starts the federated page dev server on http://localhost:3001.
5. Connect the custom page to the shell
Open in browser:
http://localhost:3000?devRemote=http://localhost:3001&devPageLabel=Energy%20Overview&devPageIcon=bolt
The "Energy Overview" page will appear in the sidebar under "Custom Pages".
Building a New Page with Claude Code
- Copy the
page-templatedirectory to a new location - Open it in Claude Code β the MCP server is pre-configured in
.claude/settings.json - Claude Code can use MCP tools to discover available data (buildings, sensors, energy, etc.)
- Edit
src/Page.tsxβ use SDK hooks and components - Run
npm run devand connect to the shell
Example prompt for Claude Code:
"Build a page that shows a comparison of electricity usage across all Portland buildings for the last 30 days, with a bar chart and a summary table. Use the SDK components for layout and the BuildingSelector for filtering."
MCP Server
The MCP server exposes these tools for Claude Code:
| Tool | Description |
|---|---|
list_buildings | List buildings with optional city/type filter |
get_building | Get building details with floors |
list_sensors | List sensors for a building |
get_sensor_readings | Time-series sensor data (raw/hourly/daily) |
get_energy_usage | Energy data (daily/weekly/monthly) |
compare_buildings_energy | Cross-building comparison |
list_alerts | Alerts by building/severity |
get_building_summary | Full building overview |
list_available_metrics | Discover all data types |
Running the MCP server standalone
cd mcp-server
npx tsx src/index.ts
It communicates over stdio (standard MCP transport).
SDK Reference
Components
<PageLayout>β Page wrapper with title, description, actions<BuildingSelector>β Building dropdown with filtering<Card>β Container card with title/subtitle<StatCard>β Metric display card<DataTable>β Configurable data table<Badge>β Status badge (info/warning/critical/success)<LoadingSpinner>β Loading indicator
Hooks
useBuildings(options?)β List buildingsuseBuildingEnergy(buildingId, options?)β Energy usage datauseSensors(buildingId, options?)β Building sensorsuseSensorReadings(sensorId, options?)β Sensor time-seriesuseAlerts(buildingId?, options?)β AlertsuseAuth()β Current user context
Providers (set up by the shell)
<AuthProvider>β Authentication context<ApiProvider baseUrl="">β API base URL context
