Metadata-Version: 2.4
Name: minimax_qa_mcp
Version: 0.2.0
Summary: QA agent service 集合
Author-email: xingyun <xingyun@minimaxi.com>
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: annotated-types>=0.7.0
Requires-Dist: anyio>=4.9.0
Requires-Dist: Authlib>=1.5.2
Requires-Dist: certifi>=2025.1.31
Requires-Dist: cffi>=1.17.1
Requires-Dist: charset-normalizer>=3.4.1
Requires-Dist: classes>=0.4.1
Requires-Dist: click>=8.1.8
Requires-Dist: cryptography>=44.0.2
Requires-Dist: h11>=0.14.0
Requires-Dist: httpcore>=1.0.7
Requires-Dist: httpx>=0.28.1
Requires-Dist: httpx-sse>=0.4.0
Requires-Dist: idna>=3.10
Requires-Dist: jsonpatch>=1.33
Requires-Dist: jsonpointer>=3.0.0
Requires-Dist: langchain-core>=0.3.51
Requires-Dist: langsmith>=0.3.27
Requires-Dist: mcp>=1.6.0
Requires-Dist: numpy>=2.2.4
Requires-Dist: orjson>=3.10.16
Requires-Dist: packaging>=24.2
Requires-Dist: pandas>=2.2.3
Requires-Dist: prettytable>=3.16.0
Requires-Dist: pycparser>=2.22
Requires-Dist: pydantic>=2.11.3
Requires-Dist: pydantic-settings>=2.8.1
Requires-Dist: pydantic_core>=2.33.1
Requires-Dist: python-dateutil>=2.9.0.post0
Requires-Dist: python-dotenv>=1.1.0
Requires-Dist: pytz>=2025.2
Requires-Dist: PyYAML>=6.0.2
Requires-Dist: requests>=2.32.3
Requires-Dist: requests-toolbelt>=1.0.0
Requires-Dist: six>=1.17.0
Requires-Dist: sniffio>=1.3.1
Requires-Dist: sse-starlette>=2.2.1
Requires-Dist: starlette>=0.46.1
Requires-Dist: tabulate>=0.9.0
Requires-Dist: tenacity>=9.1.2
Requires-Dist: typing-inspection>=0.4.0
Requires-Dist: typing_extensions>=4.13.1
Requires-Dist: tzdata>=2025.2
Requires-Dist: urllib3>=2.3.0
Requires-Dist: uvicorn>=0.34.0
Requires-Dist: validators>=0.34.0
Requires-Dist: wcwidth>=0.2.13
Requires-Dist: weaviate>=0.1.2
Requires-Dist: weaviate-client>=3.26.7
Requires-Dist: zstandard>=0.23.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: twine>=4.0.0; extra == "dev"

# QA - agent service 集合

## 项目结构
- `server.py`: MCP接口定义和服务启动入口
- `src/`: 核心功能模块实现
- `conf/`: 配置文件
- `utils/`: 工具函数
- `logs/`: 日志文件夹

## 功能特性
1. 天气服务(demo)：
   - 获取美国各州天气警报信息
   - 基于经纬度获取天气预报

2. 日志检索服务：
   - 从Grafana获取各业务服务的日志
   - 支持按关键字、时间等条件筛选
   - 支持获取服务接口列表

## 环境配置与启动

项目现在使用ux进行构建和打包，提供了多种安装运行方式。

### 1. 从PyPI安装

```shell
# 直接从PyPI安装
pip install minimax-qa-mcp

# 运行服务
minimax-qa-mcp
```

### 2. 开发模式

```shell
# 安装依赖
pip install ux
pip install -r requirements.txt

# 开发模式运行
bash run.sh
# 或
ux run
```

### 3. 构建与发布

```shell
# 构建项目
bash build.sh

# 发布到PyPI
bash publish.sh
```

### 4. 查看启动
```
本地生成 log/agent_log.log文件，且打印 
INFO:     Uvicorn running on http://0.0.0.0:8888 (Press CTRL+C to quit)
```

### 5. 集成到MCP客户端

#### curl
 ```shell
http://0.0.0.0:8888/sse
 ```

#### Python模块方式
```shell
python -m minimax_qa_mcp.server
```

#### Claude Desktop 配置
```json
{
    "agent_name": {
      "command": "minimax-qa-mcp",
      "args": ["--host", "0.0.0.0", "--port", "8888"]
    }
}
```

## API 说明

### 天气服务(demo)
- `get_alerts(state)`: 获取指定州的天气警报
- `get_forecast(latitude, longitude)`: 获取指定位置的天气预报

### 日志服务
- `get_grafana_data(scene, psm, msg, from_time, to_time)`: 获取业务的grafana日志
- `get_top_methods(scene, psm)`: 获取服务存在调用的接口列表
- `get_http_data(scene, psm, api_path, from_time, to_time)`: 获取业务http接口流量日志
- `query_code_segments(query, query_type, limit, exact, advanced, depth, direction, output)`: 查询代码片段
- `gen_case(input_data, pwd)`: 生成link_case
- `get_weaviate_info(input_data)`: 获取业务相关信息
