M8 Codex MCP
An AI-powered toolkit for the M8 mobile development framework that enables automated generation of Vue pages, low-code components, and mock data. It provides real-time code standard validation and a comprehensive UI component knowledge base to streamline development in AI editors.
README
m8-generator-mcp
M8 框架智能辅助工具 - 基于 MCP (Model Context Protocol) 协议
专门为 M8 移动端开发框架设计的 AI 辅助工具集,集成了开发规范、代码生成、规范检查等核心能力。支持通过 Cursor、Windsurf 等 AI 编辑器无缝调用。
✨ 核心功能
- 🚀 一站式页面生成 (
create_page): 只需描述需求,自动完成规范加载、代码生成(Vue/SCSS/JS)、Mock 数据创建,并输出规范检查报告。 - 🧩 IOC 组件生成 (
create_ioc_page): 专为低码平台设计,自动生成符合 IOC 规范的组件结构(Config/Mock/Vue/Plugin)。 - 🔍 规范自动验证 (
validate_code_standards): 实时检查代码是否符合 M8 开发规范(文件头注释、全局变量使用、样式穿透语法等)。 - 🤖 AI 配置助手 (
get_prompt): 获取最佳 System Prompt,让你的 AI 助手瞬间变身 M8 专家。
🛠️ 安装与配置
在 IDE (Cursor/VSCode/Windsurf) 的 MCP 配置文件中添加:
{
"mcpServers": {
"m8-codex-mcp": {
"command": "npx",
"args": ["-y", "m8-codex-mcp@latest"]
}
}
}
🧰 工具详解
1. create_page (创建页面)
一站式生成符合 M8 规范的业务页面。
参数说明:
module_name(必填): 模块名称(小写下划线,如user_list)vue_version(必填): Vue 版本,"2"或"3"description(必填): 页面功能描述page_name: 页面名称,默认为indexpage_type: 页面类型 (form|list|detail|custom),默认为customrequirements: 具体需求细节(如:包含搜索框、下拉刷新等)components: 需要使用的组件列表(如['em-button', 'em-field'])
示例:
"使用 create_page 工具创建请假申请页面:
- module_name: "leave_apply"
- vue_version: "2"
- page_type: "form"
- description: "请假申请"
- requirements: "请假类型(单选:事假/病假/年假)、开始日期(日期选择)、结束日期(日期选择)、请假原因(textarea)、提交按钮"
2. create_ioc_page (创建低码组件)
生成符合 M8 低码平台 (IOC) 规范的组件结构。
参数说明:
component_name(必填): 组件名 (PascalCase,如ProductCard)display_name(必填): 中文显示名description(必填): 功能描述config_options: 自定义属性配置列表custom_events: 自定义事件列表
示例:
"使用 create_ioc_page 工具创建商品卡片组件:
- component_name: "ProductCard"
- display_name: "商品卡片"
- description: "展示商品图片、名称、价格,支持点击跳转"
- config_options: [{"name": "titleColor", "displayName": "标题颜色", "type": "color"}, {"name": "showPrice", "displayName": "显示价格", "type": "boolean", "defaultValue": true}]
- custom_events: [{"name": "onBuyClick", "displayName": "点击购买"}]
💡 组件复用:开发时优先使用 M8 组件库(em-*)
"查询 em-field 组件用法"
"em-popup 有哪些 Props"
3. validate_code_standards (规范验证)
检查已有代码是否符合 M8 规范。
支持检查项:
- ✅ 全局变量 (Util/Config) 禁止 import
- ✅ Vue2/Vue3 样式穿透语法 (
::v-deepvs:deep()) - ✅ Vue3
<script setup>语法强制 - ✅ 文件头部注释完整性
- ✅ 样式文件分离 (@import scss)
4. get_prompt (获取 AI 配置)
获取专为 M8 开发优化的 System Prompt。
建议将返回的内容复制到项目的 .cursorrules 或 .windsurfrules 文件中,以提升 AI 的编码准确率。
📚 包含的知识库
- UI 组件库: 70+ 组件文档(直接问 AI "查询 em-xxx 用法" 即可)
- 开发规范: 完整的 M8 前端开发规范 (01-project 到 07-router)
- 最佳实践: Vue2/Vue3 差异化处理方案
Development
# Install dependencies
npm install
# Build the project
npm run build
# Watch for changes
npm run watch
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.