Python library for building MCP App UIs — declarative components, themes, and MCP protocol client. Define an app in Python, get self-contained HTML.
Project description
mcpbundles-app-ui
Python library for building MCP App UIs. Define an app declaratively in Python, get self-contained HTML with built-in MCP protocol support and interactive charts.
Installation
pip install mcpbundles-app-ui
Quick Start
from mcpbundles_app_ui import App, LightTheme, Stats, Stat, Card
class MyApp(App):
name = "My App"
subtitle = "Analytics overview"
theme = LightTheme(accent="#3b82f6")
layout = [
Stats(
Stat("preview.total", "Total", primary=True),
Stat("preview.thisWeek", "This Week"),
),
Card(title="Select an option to explore"),
]
# Generate self-contained HTML
html = MyApp().render()
Features
- Declarative components:
Stats,Stat,Card,Grid,Chart.bar(),BarList,RecentList, and more - Theme system:
LightThemeandDarkThemewith customizable accent colors, fonts, and all design tokens - Interactive charts: Built-in canvas chart engine (18 chart types, CSP-safe, zero dependencies) with declarative Python components
- MCP protocol client: Built-in JavaScript for
initializeMCP(),callTool(),sendMessage(),askAI() - Navigation: Breadcrumb system with
setBreadcrumbs(),pushBreadcrumb(),popBreadcrumb() - Loading states:
showLoading(),hideLoading(),withLoading(),paginateAll() - Export utilities:
copyToClipboard(),toCSV(),exportAsCSV() - Toast notifications:
showToast()for success/error feedback - Path-based assets:
custom_headandcustom_scriptsacceptPathobjects for file-based CSS/JS - Zero Python dependencies: Only stdlib. Produces standalone HTML with all CSS/JS inline.
Charts
Charts are defined declaratively in your Python layout using Chart factory methods:
from mcpbundles_app_ui import Chart, Grid
layout = [
Grid(cols=2)(
Chart.bar("data.byMonth", title="Monthly Revenue"),
Chart.comparison("data.thisWeek", "data.lastWeek", title="Week over Week"),
),
Chart.funnel("data.pipeline", title="Sales Pipeline"),
Chart.distribution("data.byCategory", title="Category Breakdown"),
]
The library includes two rendering engines:
- Chart engine — 18 canvas chart types (candlestick, line, area, bar, column, dual axes, scatter, pie, treemap, radar, histogram, heatmap, funnel, table, and 4 card types). Used by chart-driven apps where the user controls views via dropdowns and selectors.
- Tabbed engine — Multi-tool apps where each tab calls a different MCP tool. Charts render within tab content areas with a shared period toolbar.
Charts automatically use the app's theme colors (--chart-1 through --chart-6).
Components
| Component | Description |
|---|---|
App |
Base class for app definitions |
Stats |
Row of statistic cards |
Stat |
Single statistic with data binding |
Card |
Container with optional title |
Grid |
Grid layout (2-4 columns) |
Section |
Named section with header and subtitle |
Chart.bar() |
Bar chart with data binding |
Chart.comparison() |
Side-by-side comparison of two values |
Chart.funnel() |
Pipeline/funnel stage chart |
Chart.distribution() |
Distribution breakdown by category |
ListPicker |
List selection component with callback |
BarList |
Horizontal bar ranking list |
RecentList |
Recent items list |
StageList |
Pipeline stage list with bars |
Raw |
Escape hatch for custom HTML |
CustomScript |
Inject custom JavaScript |
Themes
from mcpbundles_app_ui import LightTheme, DarkTheme
# Custom accent color
theme = LightTheme(accent="#8b5cf6")
# Custom fonts
theme = LightTheme(
accent="#3b82f6",
font_family="'Inter', system-ui, sans-serif",
font_url="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap",
)
File-Based Assets
Load CSS/JS from files instead of inline strings:
from pathlib import Path
from mcpbundles_app_ui import App, LightTheme
class MyApp(App):
name = "My App"
theme = LightTheme()
custom_head = Path(__file__).parent / "assets/styles.html"
custom_scripts = Path(__file__).parent / "assets/app.js"
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcpbundles_app_ui-0.10.3.tar.gz.
File metadata
- Download URL: mcpbundles_app_ui-0.10.3.tar.gz
- Upload date:
- Size: 77.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3114d6870463851aed55ccce950c238f9d4e4772aeaabf6a6f3f0fbcbe6e72cc
|
|
| MD5 |
cee9abccec1aa45ef06aedea4adf63e9
|
|
| BLAKE2b-256 |
65cd73f1f35bb02926ee35cba90ac11164f6e2f7cedf16a1d7944ae4c3736da3
|
Provenance
The following attestation bundles were made for mcpbundles_app_ui-0.10.3.tar.gz:
Publisher:
publish.yml on thinkchainai/mcpbundles-app-ui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcpbundles_app_ui-0.10.3.tar.gz -
Subject digest:
3114d6870463851aed55ccce950c238f9d4e4772aeaabf6a6f3f0fbcbe6e72cc - Sigstore transparency entry: 1338815680
- Sigstore integration time:
-
Permalink:
thinkchainai/mcpbundles-app-ui@2aad824b67ee96ec94345997cc86fb7be05747a4 -
Branch / Tag:
refs/tags/v0.10.3 - Owner: https://github.com/thinkchainai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2aad824b67ee96ec94345997cc86fb7be05747a4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcpbundles_app_ui-0.10.3-py3-none-any.whl.
File metadata
- Download URL: mcpbundles_app_ui-0.10.3-py3-none-any.whl
- Upload date:
- Size: 89.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
841c9c5e089ba3e7aa91f50ce297834732f60e197c526485e7adddb94e056812
|
|
| MD5 |
42ae1e6ea6e6d10f2f0103666826f6eb
|
|
| BLAKE2b-256 |
da906345053e886d058bc7d7f9ff3d25fbe0079dbc6d2697335ddfc6ab613ad9
|
Provenance
The following attestation bundles were made for mcpbundles_app_ui-0.10.3-py3-none-any.whl:
Publisher:
publish.yml on thinkchainai/mcpbundles-app-ui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcpbundles_app_ui-0.10.3-py3-none-any.whl -
Subject digest:
841c9c5e089ba3e7aa91f50ce297834732f60e197c526485e7adddb94e056812 - Sigstore transparency entry: 1338815683
- Sigstore integration time:
-
Permalink:
thinkchainai/mcpbundles-app-ui@2aad824b67ee96ec94345997cc86fb7be05747a4 -
Branch / Tag:
refs/tags/v0.10.3 - Owner: https://github.com/thinkchainai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2aad824b67ee96ec94345997cc86fb7be05747a4 -
Trigger Event:
push
-
Statement type: