这是一个提供与 Mantine UI 组件相关工具的 Model Context Protocol (MCP) 服务器。
# 全局安装
npm install -g @hakxel/mantine-ui-server
# 直接运行服务器
mantine-ui-server
npx @hakxel/mantine-ui-server
在你的 Claude Desktop 配置文件中添加服务器配置:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"mantine": {
"command": "npx",
"args": ["@hakxel/mantine-ui-server"],
"env": {
"MANTINE_VERSION": "7.16.2" // 可选:指定版本
}
}
}
}
添加到你的 VSCode 设置或 Cline 扩展设置中:
{
"mcpServers": {
"mantine": {
"command": "npx",
"args": ["@hakxel/mantine-ui-server"],
"env": {
"MANTINE_VERSION": "7.16.2" // 可选:指定版本
}
}
}
}
get_component_docs(component: "Button", section: "props")
返回 Button 组件的详细文档,特别是其属性部分。
search_components(query: "input")
返回所有匹配搜索词 "input" 的组件列表。
generate_component(
name: "CustomButton",
mantineComponent: "Button",
props: {
size: "md",
variant: "filled"
},
styling: {
useModule: true
}
)
基于 Mantine 的 Button 生成一个新的 CustomButton 组件。
create_theme_config(
extension: "colors",
definitions: {
primary: ["#90CAF9", "#2196F3", "#1976D2"],
secondary: ["#CE93D8", "#9C27B0", "#7B1FA2"]
},
darkMode: true
)
创建适用于浅色模式和深色模式的颜色调板主题配置。
MANTINE_VERSION: 指定用于文档的 Mantine 版本(默认:最新)CACHE_DOCS: 设置为 "false" 以禁用文档缓存CACHE_TTL: 文档缓存的有效时间(秒)CACHE_STORAGE: 缓存存储方法("memory" 或 "file")# 克隆仓库
git clone https://github.com/hakxel/mantine-ui-server.git
cd mantine-ui-server
# 安装依赖
npm install
# 构建服务器
npm run build
# 开发时自动重建
npm run watch
由于 MCP 服务器通过标准 I/O 进行通信,你可以使用 MCP Inspector 进行调试:
npm run inspector
MIT