Generate HTML Prototypes from Natural Language
MCP server that generates complete, styled HTML prototypes from plain-language descriptions and imports them into a Modao personal space.
1.0.0Add to Favorites
Why it matters
Transform natural language descriptions into fully-featured, modern, and responsive HTML prototypes. This AI server integrates with the Modao workspace to streamline the design and development process.
Outcomes
What it gets done
Generate HTML code from text descriptions.
Create detailed design specifications from user requirements.
Import generated HTML directly into your Modao workspace.
Debug and configure the AI server for custom deployments.
Source
Get it from source
Spark does not host a copy of it.
Open sourceReports
Agent outcome reports
No reports yet
Capabilities
Tools your agent gets
Generates complete HTML code based on user descriptions with modern design and responsive layout.
Generates detailed technical design requirement documents based on user requirements.
Imports generated HTML into the user's personal workspace using the key from gen_html.
Overview
Modao Proto MCP is an MCP server with three tools - gen_html, gen_description, and import_html - that generate complete HTML prototypes from plain-language descriptions, expand short ideas into detailed design specs, and import results into a Modao personal space. Use it to generate and import an HTML prototype from a description via Modao; it requires a Modao account, API token, and sufficient credits for gen_html to run.
What it does
Modao Proto MCP is a Model Context Protocol server for prototype generation, focused on three capabilities: HTML code generation, design description generation, and HTML import. It exposes three tools: gen_html generates complete HTML code from a user description, supporting modern design and responsive layout - it returns full HTML (from to </html>) including real image URLs and necessary CSS automatically included, plus a generated key for later import; gen_description expands a short design idea into a detailed design specification document, supporting pure-text requirements, reference-image requirements, or text-plus-reference-image requirements, and is meant to be used only when the user explicitly asks to expand their design requirements; and import_html saves HTML generated by gen_html into the user's personal space, primarily using the key returned by gen_html (an htmlString parameter exists as a fallback but usually isn't needed). Two documented workflows: a basic one (gen_html then import_html), and an extended one for more detailed design specs (gen_description first, then gen_html using that description as reference, then import_html). Its own changelog, currently at v1.3.7, shows the tool set evolving over four releases: v1.0.0 shipped gen_html alone; v1.1.0 added gen_description; v1.2.0 added import_html and the full generate-to-import workflow; and v1.3.7 optimized the import flow to use the key-based approach, simplified the overall workflow by removing an organize-file-tree feature, and rewrote the README to more accurately reflect actual functionality.
When to use - and when NOT to
Use it when you want an AI assistant to generate a complete, styled HTML prototype from a plain-language description and save it directly into a Modao personal space, optionally first expanding a short idea into a fuller design spec via gen_description. It requires a Modao account and API token to function, obtained by logging into modao.cc or modao.cc/ai and creating a token under account settings, and gen_html specifically requires sufficient account credits - the source's own FAQ names insufficient credits as a documented failure mode for gen_html, fixable only by recharging on modao.cc/ai. It's scoped to HTML prototype generation and import into Modao's own space, not general web development or hosting elsewhere.
Capabilities
gen_html takes a required user_input description, for example "create a modern-style login page", and an optional reference string for extra context or style guidance, and returns complete HTML plus an import key. gen_description takes the same user_input and reference shape but returns an expanded design specification document instead of code. import_html takes a key, the recommended and primary parameter, sourced from a prior gen_html call, or, as a fallback, a raw htmlString. The project is built around a BaseTool abstract class - new tools are added by creating a class under src/tools/, extending BaseTool, implementing getToolDefinition() (the MCP tool spec) and execute() (the core logic), and registering the new tool in src/index.ts's initializeTools() method; helper methods validateRequiredArgs(), createErrorResult(), and formatApiError() handle parameter validation and error formatting consistently across tools.
How to install
Install dependencies with npm install and build with npm run build; run the server directly with node dist/index.js --token YOUR_API_TOKEN, adding --url to point at a non-default API host (default https://modao.cc) or --debug for verbose logging. For MCP clients, add a modao-proto-mcp entry running npx -y @modao-mcp/modao-proto-mcp with the token and url arguments - the same command works across Claude Desktop, Cursor, Windsurf, and Claude Code, each with its own config file location (Claude Desktop's claude_desktop_config.json varies by OS; Cursor's settings.json; Windsurf's ~/.windsurf/config.json; Claude Code's ~/.claude-code/config.json). Its generic client config, quoted verbatim:
{
"mcpServers": {
"modao-proto-mcp": {
"command": "npx",
"args": [
"-y",
"@modao-mcp/modao-proto-mcp",
"--token=YOUR_TOKEN",
"--url=https://modao.cc"
]
}
}
}
Licensed MIT.
Who it's for
Developers or designers who want an AI assistant to turn a plain-language description into a complete, styled HTML prototype and save it straight into their Modao workspace, without hand-writing the HTML or manually managing the design-to-prototype handoff.
Source README
modao-proto-mcp
A prototype generation service based on Model Context Protocol, focused on HTML code generation, design description generation, and HTML import functionality.
Features
- 🚀 HTML Code Generation: Generate complete HTML code based on user descriptions, supporting modern design and responsive layouts
- 📝 Design Description Generation: Generate detailed design specification documents based on user brief requirements
- 📤 HTML Import: Import generated HTML to user personal space via key
- 🛠️ MCP Protocol: Fully compatible with Model Context Protocol standard
- 🔧 Extensible: Easy to add new tools and features
- ⚡ Efficient Processing: Support multiple parameter formats and error handling mechanisms
Installation
npm install
Build
npm run build
Usage
Starting the Service
# Basic usage
node dist/index.js --token YOUR_API_TOKEN
# Specify API address
node dist/index.js --token YOUR_API_TOKEN --url https://modao.cc
# Enable debug mode
node dist/index.js --token YOUR_API_TOKEN --debug
Parameter Reference
--token: Access token for API service (required)--url: API service address (optional, default: https://modao.cc)--debug: Enable debug mode (optional)
MCP Client Configuration
Generic Configuration
Applicable to all MCP-compatible clients:
{
"mcpServers": {
"modao-proto-mcp": {
"command": "npx",
"args": [
"-y",
"@modao-mcp/modao-proto-mcp",
"--token=YOUR_TOKEN",
"--url=https://modao.cc"
]
}
}
}
Claude Desktop
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"modao-proto-mcp": {
"command": "npx",
"args": [
"-y",
"@modao-mcp/modao-proto-mcp",
"--token=YOUR_TOKEN",
"--url=https://modao.cc"
]
}
}
}
Cursor
Add to settings.json:
{
"mcp.servers": {
"modao-proto-mcp": {
"command": "npx",
"args": [
"-y",
"@modao-mcp/modao-proto-mcp",
"--token=YOUR_TOKEN",
"--url=https://modao.cc"
]
}
}
}
Windsurf
Add to ~/.windsurf/config.json:
{
"mcp": {
"servers": {
"modao-proto-mcp": {
"command": "npx",
"args": [
"-y",
"@modao-mcp/modao-proto-mcp",
"--token=YOUR_TOKEN",
"--url=https://modao.cc"
]
}
}
}
}
Claude Code
Add to ~/.claude-code/config.json:
{
"mcpServers": {
"modao-proto-mcp": {
"command": "npx",
"args": [
"-y",
"@modao-mcp/modao-proto-mcp",
"--token=YOUR_TOKEN",
"--url=https://modao.cc"
]
}
}
}
FAQ
Getting a Token: If you encounter a token error, please log in to modao.cc or modao.cc/ai, click the avatar in the top right corner → Token Settings → Create Token
Insufficient Credits: If gen_html cannot generate (insufficient credits), please go to modao.cc/ai to recharge credits
Tools List
1. gen_html
Generate complete HTML code based on user descriptions, supporting modern design and responsive layouts.
Description:
- Generate HTML files that match user design requirements
- Support multiple design styles and layout methods
- Return complete HTML code with real image URLs
- Generated HTML code automatically includes necessary CSS styles
Parameters:
user_input(string, required): User design requirement description, e.g., 'Create a modern-style login page'reference(string, optional): Optional reference information or context
Return Content:
- Complete HTML code (from
<!DOCTYPE html>to</html>) - Generated key (for subsequent import operations)
Example:
{
"name": "gen_html",
"arguments": {
"user_input": "Create a modern-style login page with username and password input fields",
"reference": "Use Material Design style with blue as the primary color"
}
}
2. gen_description
Generate detailed design specification documents based on user brief design requirements.
Description:
- Expand user brief design ideas into detailed design specifications
- Support pure text requirements, reference image requirements, or text + reference image requirements
- Use only when user explicitly requests design requirement expansion
Parameters:
user_input(string, required): User design idea or requirement descriptionreference(string, optional): Optional reference information or context
Example:
{
"name": "gen_description",
"arguments": {
"user_input": "E-commerce product list page",
"reference": "Need to support filtering, sorting, and pagination features"
}
}
3. import_html
Import HTML generated through the gen_html tool to user personal space.
Description:
- Use the key returned by gen_html tool for HTML import operation
- Save generated HTML content to user personal space
- Support optional HTML string parameter as backup option
Parameters:
key(string, recommended): Key parameter obtained from gen_html tool response, this is the main parameter for import operationhtmlString(string, optional): Optional HTML string content, usually not needed
Usage Recommendations:
- Recommended to use the key parameter returned by gen_html tool for import
- The key parameter contains all necessary import information, no need to manually provide HTML content
Example:
{
"name": "import_html",
"arguments": {
"key": "Key value obtained from gen_html tool"
}
}
Complete Workflow
Basic Workflow
- Generate HTML: Use
gen_htmltool to generate HTML code based on requirements - Import HTML: Use
import_htmltool to import generated HTML to personal space
Extended Workflow
If more detailed design specifications are needed:
- Generate Design Description: Use
gen_descriptiontool to expand design requirements - Generate HTML: Use generated design description as reference, call
gen_htmltool - Import HTML: Use
import_htmltool to save to personal space
Complete Example:
# 1. Generate HTML (basic workflow)
{
"name": "gen_html",
"arguments": {
"user_input": "Create a modern-style login page with username and password input fields"
}
}
# 2. Import HTML (using returned key)
{
"name": "import_html",
"arguments": {
"key": "Key value returned by gen_html tool"
}
}
Extended Example (with design description):
# 1. Generate detailed design description
{
"name": "gen_description",
"arguments": {
"user_input": "E-commerce product list page",
"reference": "Need to support filtering, sorting, and pagination features"
}
}
# 2. Generate HTML based on design description
{
"name": "gen_html",
"arguments": {
"user_input": "E-commerce product list page",
"reference": "Detailed design description content from previous step"
}
}
# 3. Import HTML
{
"name": "import_html",
"arguments": {
"key": "Key value returned by gen_html tool"
}
}
Project Structure
modao-proto-mcp/
├── src/
│ ├── tools/
│ │ ├── base-tool.ts # Base tool class providing common functionality
│ │ ├── gen-html.ts # HTML generation tool
│ │ ├── gen-description.ts # Design description generation tool
│ │ └── import-html.ts # HTML import tool
│ ├── http-util.ts # HTTP utility class for handling API requests
│ ├── types.d.ts # TypeScript type definitions
│ └── index.ts # MCP server main entry point
├── bin/
│ └── cli.js # Command line execution file
├── examples/ # Usage examples and documentation
├── scripts/ # Build and publish scripts
├── build.js # Project build configuration
├── package.json # Project dependencies and configuration
├── tsconfig.json # TypeScript configuration
├── API.md # Detailed API documentation
├── README.md # English README
└── README.zh-CN.md # Chinese README
Technical Architecture
User Request → MCP Client → MCP Server → HTTP Utility → Backend API
↓
Response Handling ← Result Formatting ← API Response
Development Guide
Adding New Tools
- Create Tool Class: Create a new tool class file in
src/tools/directory - Inherit Base Class: Inherit from
BaseToolabstract class - Implement Required Methods:
getToolDefinition(): Define tool MCP specificationexecute(): Implement tool core functionality logic
- Register Tool: Register new tool in
initializeTools()method insrc/index.ts
Tool Development Example
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { BaseTool } from './base-tool.js';
import { ToolResult } from '../types.js';
export class MyNewTool extends BaseTool {
getToolDefinition(): Tool {
return {
name: "my_new_tool",
description: "Tool functionality description",
inputSchema: {
type: "object",
properties: {
input_param: {
type: "string",
description: "Parameter description"
}
},
required: ["input_param"]
}
};
}
async execute(args: Record<string, any>): Promise<ToolResult> {
// Implement tool logic
const result = await this.httpUtil.post('/api/endpoint', args);
return this.createSuccessResult(result.data);
}
}
Development Notes
- Parameter Validation: Use
validateRequiredArgs()method to validate required parameters - Error Handling: Use
createErrorResult()andformatApiError()for error handling - HTTP Requests: Send API requests through
this.httpUtil - Debug Mode: Use
--debugparameter to enable detailed logging
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.