mcp-embedded-ui¶
A cross-language specification, shared assets, and SDKs for embedding a browser-based tool explorer into any MCP (Model Context Protocol) server.
Official SDKs: Python (PyPI) | TypeScript (npm) | Rust (crates.io) | [Go (Coming Soon)]
Quick Start¶
SDK: python/
SDK: typescript/
SDK: rust/
use std::sync::Arc;
use mcp_embedded_ui::{create_mount, ToolsProvider, UiConfig};
// Mount the explorer UI at /explorer (pass Some("/ui") for a custom prefix)
let tools: Arc<dyn ToolsProvider> = Arc::new(my_tools);
let app = create_mount(None, tools, my_handler, UiConfig::default());
// Visit http://localhost:8000/explorer/
What is this?¶
If you build an MCP server, your users interact with tools through JSON — no visual feedback, no schema browser, no quick way to test. mcp-embedded-ui solves this by defining a standard set of HTTP endpoints and a self-contained HTML page that any MCP server can serve, in any language.
┌───────────────────────────────────┐
│ Browser │
│ Tool list → Schema → Try it │
└──────────────┬────────────────────┘
│ HTTP / JSON
┌──────────────▼────────────────────┐
│ Your MCP Server │
│ + mcp-embedded-ui library │
│ (Python / TypeScript / Go / …) │
└───────────────────────────────────┘
One import. One mount. Full UI.
Key Features¶
The embedded explorer page provides:
- Tool list — browse all registered tools with descriptions and annotations.
- Schema inspector — expand any tool to view its full JSON Schema (
inputSchema). - Try-it console — type JSON arguments, execute the tool, see results instantly.
- cURL export — copy a ready-made cURL command for any execution.
- Auth support — enter a Bearer token in the UI, sent with all requests.
No build step. No CDN. No external dependencies. The entire UI is a single HTML string embedded in your server binary/package.
Documentation for Developers¶
| Document | Description |
|---|---|
| Protocol Spec | Endpoint spec, data shapes, cross-language abstraction mapping. |
| Feature Manifest | Implementation roadmap and dependency graph for new SDKs. |
| HTML Template | The shared "source of truth" HTML file used by all SDKs. |
Feature Deep Dives¶
- F1: HTML Frontend
- F2: Tool Discovery API
- F3: Tool Execution API
- F4: Auth Hook
- F5: Framework Integration
- F6: Try-It Console
How to Add a New Language¶
- Read the Protocol Specification — the authoritative source for endpoints and data shapes.
- Follow the Feature Manifest implementation order: F1 → F2 → F3 → F4 → F6 → F5.
- Use the explorer.html template (do not modify the HTML content).
- Ensure you follow the Security Checklist.
- Open a PR to add your implementation to this list!
Working on the Shared Template¶
Edit docs/explorer.html, not the embedded SDK copies. From the repository root:
make sync-html # refresh all three embedded copies
make check-html # verify byte-for-byte equality without writing files
Commit the source and refreshed copies together. CI runs make check-html.
No sibling checkout or Git hook is needed. If you installed the old hook and
git config --local --get core.hooksPath reports .githooks, remove that
setting with git config --local --unset core.hooksPath.
SDK History¶
Run git log -- python/ (or typescript/ or rust/) to see commits from
before the migration. Migration sources
records the original repositories and commit IDs. Package versions and
publishing remain independent.
Design Principles¶
- Zero frontend build — No npm/webpack/CDN. Just one HTML string.
- Framework-agnostic — Standard HTTP routes that mount anywhere.
- Cross-language consistency — Identical UX across Python, TS, Go, etc.
- Secure by default — XSS protection and auth sanitization built-in.
License¶
Apache-2.0