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
Metadata
Release files for mcpbundles-app-ui 0.10.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcpbundles_app_ui-0.10.4.tar.gz | 79.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcpbundles_app_ui-0.10.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 169.7 kB
Release files / mcpbundles_app_ui-0.10.4.tar.gz
| Download URL | mcpbundles_app_ui-0.10.4.tar.gz |
|---|---|
| Size | 79.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
418835817e6454fb7d57dbf981ee4e2d4fa6febe881e3e96408820911eaa837d
|
|
BLAKE2b-256 checksum How to use checksums |
15d5237b982e0c32b907a22ce196f68582e249c2c696b72b415ee2b9728f0015
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.
Transparency logRelease files / mcpbundles_app_ui-0.10.4-py3-none-any.whl
| Download URL | mcpbundles_app_ui-0.10.4-py3-none-any.whl |
|---|---|
| Size | 90.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e8c1acd1f6b4422ddd52efd1ef713efd1fcd66d789eaa6b6fa23ab89a4b46fd1
|
|
BLAKE2b-256 checksum How to use checksums |
076519ada5ab1e998d1f66b9c287f0cbb72b43a3218048bdad94823703ebe74b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.
Transparency logSecurity for mcpbundles-app-ui 0.10.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for mcpbundles_app_ui-0.10.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.