Skip to main content
Glama

MCP Apps Student Dashboard for Google Antigravity (Python + HTML)

ClassDash is a Python MCP server whose tool returns an interactive HTML dashboard instead of a wall of JSON. It follows the open MCP Apps extension (SEP-1865, io.modelcontextprotocol/ui): the tool points at a ui:// resource served as text/html;profile=mcp-app, and an MCP Apps host such as the Google Antigravity App renders it inline in chat. Text-only clients (Antigravity CLI and IDE, other agents) still get a clean plain-text summary.

The dashboard shows a class marks dataset: subject averages, pass rates, a marks histogram, grade distribution and the students below the pass mark. Change the subject or pass mark and the view calls an app-only tool to refresh itself.

Full tutorial: https://getprojects.org/mcp-apps-antigravity-python/

ClassDash MCP App rendered inline by the local preview host

Features

  • MCP Apps tool → inline UI: show_class_dashboard declares _meta.ui.resourceUri = "ui://classdash/dashboard.html".

  • Antigravity side panel and full page: open_class_dashboard_panel adds _meta["com.google.antigravity/ui"].entrypoints (aux_pane, global).

  • App-only helper: get_subject_stats has visibility: ["app"], so the dashboard can call it but the agent does not see it.

  • Single-file view, no CDN: plain HTML + JavaScript + SVG charts, written against the spec's JSON-RPC-over-postMessage protocol (ui/initialize, ui/notifications/tool-result, tools/call, ui/notifications/size-changed, ui/message, ui/update-model-context). Works under the default-deny CSP.

  • Host theme: reads hostContext.theme and the standard CSS variables (light and dark).

  • Plain-text fallback for clients that do not advertise MCP Apps support (client_supports_apps).

  • Safe by default: read-only tools, datasets addressed by name only (no file paths), CSV validation (0–100 marks, unique rolls, size limits), student names drawn with textContent (no HTML injection).

  • Local preview host (classdash-mcp preview): a tiny MCP Apps host in your browser with a live JSON-RPC log, so you can build and test without Antigravity.

  • Antigravity plugin layout: plugin.json, mcp_config.json (${PLUGIN_ROOT}, ${PLUGIN_DATA}), assets/logo.svg.

  • 98 pytest tests (93 core + 5 headless-Chromium tests of the real view) and GitHub Actions CI.

Related MCP server: widget-studio

Tech stack

Part

Choice

Language

Python 3.10+

MCP

Official MCP Python SDK mcp>=2.3,<3 (MCPServer, mcp.server.apps.Apps)

UI

One HTML file, vanilla JS, inline SVG (no React, no CDN)

Data

CSV (roll,name,<subject>...), pure-Python statistics

Tests

pytest, pytest-asyncio, optional Playwright for the browser tests

Project structure

MCP-Apps-Student-Dashboard-Antigravity-Python/
├── classdash_mcp/
│   ├── server.py          # MCP server: Apps tools, ui:// resource, plain-text fallback
│   ├── datasets.py        # safe CSV loading by dataset name
│   ├── stats.py           # means, medians, pass rates, grades, histogram
│   ├── preview.py         # local MCP Apps test host (HTTP + MCP client bridge)
│   ├── demo.py            # text-only client demo
│   ├── __main__.py        # CLI: serve | preview | demo
│   ├── ui/dashboard.html  # the MCP App view (text/html;profile=mcp-app)
│   ├── ui/preview_host.html
│   └── data/*.csv         # two synthetic sample classes
├── plugin.json            # Antigravity plugin manifest
├── mcp_config.json        # Antigravity plugin MCP server definition
├── scripts/run_server.py  # stdio entry point used by mcp_config.json
├── assets/logo.svg
├── examples/              # custom-server config + a sample CSV
├── tests/                 # 98 tests
└── .github/workflows/tests.yml

Install and run

git clone https://github.com/GetProjectsIdea/MCP-Apps-Student-Dashboard-Antigravity-Python.git
cd MCP-Apps-Student-Dashboard-Antigravity-Python
python -m venv .venv && source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -e ".[dev]"

classdash-mcp demo       # what a text-only MCP client sees
classdash-mcp preview    # opens http://127.0.0.1:8765/ with the interactive view
pytest -q                # 93 passed, 1 skipped (browser tests need Playwright)

Run the browser tests too:

pip install playwright && python -m playwright install chromium
pytest -q                # 98 passed

Preview options: ?dataset=mca-sem2-sample&subject=Data%20Structures&pass_mark=50&theme=dark.

Use it in Google Antigravity

MCP Apps views render in the Antigravity App. The Antigravity CLI and IDE run the same tools as plain-text tools.

Option A: install as a local plugin (needs python3 with pip install "mcp>=2.3,<3"):

agy plugin validate ./MCP-Apps-Student-Dashboard-Antigravity-Python
agy plugin install ./MCP-Apps-Student-Dashboard-Antigravity-Python

mcp_config.json starts scripts/run_server.py with python3 and points CLASSDASH_DATA at the plugin's writable ${PLUGIN_DATA} folder. On Windows, change python3 to python or py.

Option B: add it as a custom MCP server in ~/.gemini/config/mcp_config.json (global) or <workspace>/.agents/mcp_config.json:

{
  "mcpServers": {
    "classdash": {
      "command": "classdash-mcp",
      "args": ["serve", "--data-dir", "/absolute/path/to/your/marks-csv-folder"]
    }
  }
}

Then ask: "Show the class dashboard for cse-sem5-sample".

We tested the server with the MCP Python SDK client over stdio and in-memory, and the view in Chromium through the bundled preview host, which implements the same SEP-1865 host protocol. We did not have the Antigravity App in our test environment, so try it there and open an issue if anything differs.

Use your own class data

Put CSV files in a folder and pass --data-dir (or set CLASSDASH_DATA). The file name without .csv is the dataset name.

roll,name,DBMS,Operating Systems,Computer Networks
21CS001,Student One,78,64,71
21CS002,Student Two,35,52,AB

Marks must be 0–100. An empty cell, AB or ABSENT means absent. Rolls must be unique. Maximum 5,000 students, 20 subjects, 2 MB.

Tools

Tool

Visible to

UI

What it does

show_class_dashboard

agent + app

inline

Class overview + one subject, text + structuredContent

open_class_dashboard_panel

agent + app

side panel / full page

Same data, Antigravity aux_pane and global entrypoints

get_subject_stats

app only

(used by the view)

Refresh for a new dataset, subject or pass mark

list_datasets

agent

none

Datasets, subjects and student counts

student_report

agent

none

One student's marks, rank and backlogs

Sample output (text-only client)

Class dashboard: cse-sem5-sample (48 students, pass mark 40)
Class average 62.75% | all subjects cleared: 33 (68.8%) | hardest subject: Theory of Computation
Per subject (mean / median / pass rate):
  - DBMS: 67.98 / 69.0 / 97.9% (0 absent)
  - Operating Systems: 61.41 / 61.5 / 88.6% (4 absent)
  ...

Text-only MCP client view Dark theme drill-down with JSON-RPC log Architecture pytest

Safe-use notes

  • The sample datasets are synthetic. Real student marks are personal data: keep them on your machine, share dashboards only with people who are allowed to see them, and follow your college's data rules.

  • All tools are read-only. The server never writes to your CSV files.

  • The preview host binds to 127.0.0.1 only and is a development tool, not a production host.

References

License

MIT © 2026 Pardeep Patel. Part of GetProjects.org – make your own projects.

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to render interactive user interfaces such as forms, dashboards, charts, tables, and wizards directly in MCP-compatible clients. Supports structured data collection and richer interactions beyond text responses.
      6
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server that lets agents create, display, and export rich UI widgets (cards, dashboards, charts, forms) inline in conversations, with interactive iframe support in MCP Apps hosts and PNG image fallback for other clients.
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Generates interactive HTML cards (tabs, tables, charts, forms, videos, and more) to render inside desktop chat clients, making conversation content richer and more structured.
      19
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables agents to turn structured tabular data or CSV/XLSX files into interactive charts that render inline in conversations, with client-adaptive output modes and self-contained HTML.
      MIT