open-index/open-npm huggingface dataset:
npm package: @liaoqizhun/icon-cli
Description: icon-cli
Author: liaoqizhun
Latest version: 0.0.6

### @liaoqizhun/icon-cli

iconfont 下载到项目相关文件目录

### 安装

```
npm i @liaoqizhun/icon-cli -D
pnpm add @liaoqizhun/icon-cli -D
```

### 指令

```
icon-cli update

```

### \*config 配置

项目根目录创建 icon-local.json 文件， ⚠️ .gitignore 文件忽略 icon-local.json

| 属性       | 说明                             | 默认值                                                              |
| ---------- | -------------------------------- | ------------------------------------------------------------------- |
| userName   | iconfont 账号名                  | -                                                                   |
| password   | iconfont 密码                    | -                                                                   |
| projectId  | iconfont 对应仓库的 id           | -                                                                   |
| targetPath | iconfont 项目目录 eg：src/styles | 默认根目录创建 \_temp_font 文件储存                                 |
| fileList   | iconfont 需要 copy 的文件        | ['iconfont.css', 'iconfont.ttf', 'iconfont.woff', 'iconfont.woff2'] |
npm package: @liaoyuliang/oneport-ui-mcp-server
Description: A Model Context Protocol (MCP) server for oneport/ui components, providing AI assistants with access to component source code, demos
Author: lyl
Latest version: 1.0.3

# oneport-ui-mcp-server

A minimal [Model Context Protocol (MCP)](https://modelcontextprotocol.org/) server for Cursor integration, designed to fetch and serve component source code, demo code, and metadata from the oneport-ui (oneport-ui) repository.

---

## Features

- List all UI components in the remote registry
- Fetch component source code (from oneport-ui registry, decoded)
- Fetch and extract demo code snippets for each component
- Provide component metadata (name, path, dependencies, etc.)
- Expose all features as MCP tools, auto-discoverable by Cursor

---

## Dependencies

- `@modelcontextprotocol/sdk`
- `axios`
- `zod`
- `joi`
- Dev: `@types/node`, `typescript`

---

## Getting Started

### 1. 安装依赖

```bash
pnpm install
# 或
npm install
```

### 2. 构建项目

```bash
pnpm build
# 或
npm run build
```

### 3. 启动 MCP Server

```bash
pnpm start
# 或
node build/index.js
```

你应该会看到日志输出 `Server started successfully`。

---

## MCP 工具用法

### 1. 通过脚本直接启动服务

  ```bash
  npx @liaoyuliang/oneport-ui-mcp-serve 
  ```


### 2. 通过 Cursor 调用

- 确保 `.cursor/mcp.json` 配置了本地 MCP server（见下方配置示例）。
- 在 Cursor 命令面板输入 `/get_component button` 或 `/oneport-ui button的组件源码`，即可获取源码。
- 输入 `/get_component_demo button` 获取 demo 示例。

---

## MCP 配置示例

在 `~/.cursor/mcp.json` 

```json
{
  "mcpServers": {
     "oneport-ui": {
      "command": "npx",
      "args": ["@liaoyuliang/oneport-ui-mcp-server"]
    }
  }
}
```

---

## 目录结构

- `src/tools/components/` MCP 工具实现
- `src/utils/axios.ts` 远程拉取 oneport-ui 组件源码和 demo
- `test-get-button.ts`、`test-get-button-demo.ts` 脚本测试工具功能
- `build/` 目录为编译后产物

---

## TODO

- [ ] 支持更多组件元数据
- [ ] 更丰富的错误处理和日志
- [ ] 支持自定义组件仓库
- [ ] 完善 API 文档

---

如需详细开发文档或遇到问题，请查阅源码或联系维护者。