feat(mfg-data-agent): 添加制造业数据智能体v2版本
新增基于MCP协议的制造业数据智能体服务器,支持从JSON配置文件动态生成查询工具, 具备灵活配置、完整日志、中文支持等功能特性,专注于制造业数据分析与智能决策场景。 包含详细的README文档、依赖配置和使用示例。
This commit is contained in:
138
lzwcai_mcpskills_mfg_data_agentv2/README.md
Normal file
138
lzwcai_mcpskills_mfg_data_agentv2/README.md
Normal file
@@ -0,0 +1,138 @@
|
||||
# lzwcai-mcpskills-mfg-data-agent (制造业数据智能体)
|
||||
|
||||
一个基于 MCP (Model Context Protocol) 的制造业数据智能体服务器,支持从 JSON 配置文件动态生成查询工具。
|
||||
|
||||
## 功能特性
|
||||
|
||||
- 🚀 动态工具生成:从 `businessQueries.json` 自动生成 MCP 工具
|
||||
- 🔧 灵活配置:支持自定义业务查询和参数验证
|
||||
- 📝 完整日志:详细的操作日志记录
|
||||
- 🌐 中文支持:工具名称自动转换为拼音
|
||||
- 🏭 制造业场景:专注于制造业数据分析与智能决策
|
||||
|
||||
## 安装
|
||||
|
||||
### 使用 pip 安装
|
||||
|
||||
```bash
|
||||
pip install lzwcai-mcpskills-mfg-data-agent
|
||||
```
|
||||
|
||||
### 从源码安装
|
||||
|
||||
```bash
|
||||
git clone <repository-url>
|
||||
cd lzwcai_mcpskills_mfg_data_agent
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
### 使用 uv 安装(推荐)
|
||||
|
||||
```bash
|
||||
uv pip install lzwcai-mcpskills-mfg-data-agent
|
||||
```
|
||||
|
||||
## 使用方法
|
||||
|
||||
### 命令行启动
|
||||
|
||||
安装后,可以直接通过命令启动:
|
||||
|
||||
```bash
|
||||
lzwcai-mcpskills-mfg-data-agent
|
||||
```
|
||||
|
||||
### 作为 Python 模块运行
|
||||
|
||||
```bash
|
||||
python -m lzwcai_mcpskills_mfg_data_agent.main
|
||||
```
|
||||
|
||||
### 配置到 MCP 客户端
|
||||
|
||||
在你的 MCP 客户端配置文件中添加:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"mfg-data-agent": {
|
||||
"command": "lzwcai-mcpskills-mfg-data-agent"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 配置说明
|
||||
|
||||
### businessQueries.json
|
||||
|
||||
在 `businessQueries.json` 中定义你的业务查询:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "query-001",
|
||||
"businessName": "生产订单查询",
|
||||
"businessDescription": "根据订单ID查询生产订单信息",
|
||||
"sqlTemplate": "SELECT * FROM production_orders WHERE order_id = {{orderId}}",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"required": ["orderId"],
|
||||
"properties": {
|
||||
"orderId": {
|
||||
"type": "string",
|
||||
"description": "生产订单的唯一标识符",
|
||||
"examples": ["PO-2024-001"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
## 开发
|
||||
|
||||
### 依赖项
|
||||
|
||||
- Python >= 3.13
|
||||
- httpx >= 0.28.1
|
||||
- mcp[cli] >= 1.10.1
|
||||
- pypinyin >= 0.53.0
|
||||
|
||||
### 本地开发
|
||||
|
||||
```bash
|
||||
# 克隆仓库
|
||||
git clone <repository-url>
|
||||
cd lzwcai_mcpskills_mfg_data_agent
|
||||
|
||||
# 安装开发依赖
|
||||
pip install -e .
|
||||
|
||||
# 运行服务器
|
||||
python -m lzwcai_mcpskills_mfg_data_agent.main
|
||||
```
|
||||
|
||||
## 构建与发布
|
||||
|
||||
### 使用 build 构建
|
||||
|
||||
```bash
|
||||
pip install build
|
||||
python -m build
|
||||
```
|
||||
|
||||
### 发布到 PyPI
|
||||
|
||||
```bash
|
||||
pip install twine
|
||||
twine upload dist/*
|
||||
```
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
|
||||
## 作者
|
||||
|
||||
lzwcai
|
||||
Reference in New Issue
Block a user