aigroup-econ-mcp 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of aigroup-econ-mcp might be problematic. Click here for more details.
- aigroup_econ_mcp/__init__.py +19 -0
- aigroup_econ_mcp/cli.py +78 -0
- aigroup_econ_mcp/server.py +442 -0
- aigroup_econ_mcp/tools/__init__.py +7 -0
- aigroup_econ_mcp/tools/regression.py +214 -0
- aigroup_econ_mcp/tools/statistics.py +134 -0
- aigroup_econ_mcp/tools/time_series.py +260 -0
- aigroup_econ_mcp-0.1.0.dist-info/METADATA +226 -0
- aigroup_econ_mcp-0.1.0.dist-info/RECORD +12 -0
- aigroup_econ_mcp-0.1.0.dist-info/WHEEL +4 -0
- aigroup_econ_mcp-0.1.0.dist-info/entry_points.txt +2 -0
- aigroup_econ_mcp-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aigroup-econ-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: 专业计量经济学MCP工具 - 让大模型直接进行数据分析
|
|
5
|
+
Project-URL: Homepage, https://github.com/aigroup/aigroup-econ-mcp
|
|
6
|
+
Project-URL: Repository, https://github.com/aigroup/aigroup-econ-mcp.git
|
|
7
|
+
Project-URL: Issues, https://github.com/aigroup/aigroup-econ-mcp/issues
|
|
8
|
+
Author-email: AIGroup <jackdark425@gmail.com>
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: data-analysis,economics,mcp,regression,statistics
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Requires-Dist: click>=8.0.0
|
|
24
|
+
Requires-Dist: matplotlib>=3.5.0
|
|
25
|
+
Requires-Dist: mcp>=1.0.0
|
|
26
|
+
Requires-Dist: numpy>=1.21.0
|
|
27
|
+
Requires-Dist: pandas>=1.5.0
|
|
28
|
+
Requires-Dist: pydantic>=2.0.0
|
|
29
|
+
Requires-Dist: scipy>=1.7.0
|
|
30
|
+
Requires-Dist: statsmodels>=0.13.0
|
|
31
|
+
Requires-Dist: uvicorn>=0.20.0
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# AIGroup 计量经济学 MCP 工具
|
|
35
|
+
|
|
36
|
+
专业计量经济学MCP工具 - 让大模型直接进行数据分析
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+

|
|
40
|
+

|
|
41
|
+
|
|
42
|
+
## 功能特性
|
|
43
|
+
|
|
44
|
+
- 📊 **描述性统计分析** - 自动计算均值、方差、偏度、峰度等统计量
|
|
45
|
+
- 📈 **回归分析** - OLS回归、逐步回归、模型诊断
|
|
46
|
+
- 🧪 **假设检验** - t检验、F检验、卡方检验、ADF检验
|
|
47
|
+
- ⏰ **时间序列分析** - 平稳性检验、ARIMA模型、预测
|
|
48
|
+
- 🔄 **结构化输出** - 完整的Pydantic模型支持
|
|
49
|
+
- 🎯 **上下文管理** - 进度报告、日志记录、错误处理
|
|
50
|
+
|
|
51
|
+
## 快速开始
|
|
52
|
+
|
|
53
|
+
### 使用uvx安装运行(推荐)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# 一键安装和运行
|
|
57
|
+
uvx aigroup-econ-mcp
|
|
58
|
+
|
|
59
|
+
# 指定端口运行
|
|
60
|
+
uvx aigroup-econ-mcp --port 8080 --debug
|
|
61
|
+
|
|
62
|
+
# 使用不同的传输协议
|
|
63
|
+
uvx aigroup-econ-mcp --transport streamable-http --host 0.0.0.0 --port 8000
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 本地开发
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# 克隆项目
|
|
70
|
+
git clone https://github.com/aigroup/aigroup-econ-mcp
|
|
71
|
+
cd aigroup-econ-mcp
|
|
72
|
+
|
|
73
|
+
# 开发模式运行
|
|
74
|
+
uv run aigroup-econ-mcp --port 8000 --debug
|
|
75
|
+
|
|
76
|
+
# 或使用uvx
|
|
77
|
+
uvx -p . aigroup-econ-mcp
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## 与Claude Desktop集成
|
|
81
|
+
|
|
82
|
+
在Claude Desktop的配置文件中添加:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"mcpServers": {
|
|
87
|
+
"aigroup-econ-mcp": {
|
|
88
|
+
"command": "uvx",
|
|
89
|
+
"args": ["aigroup-econ-mcp", "--transport", "stdio"]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## 使用示例
|
|
96
|
+
|
|
97
|
+
### 描述性统计分析
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
# 计算基础统计量
|
|
101
|
+
result = await descriptive_statistics({
|
|
102
|
+
"GDP": [100, 110, 120, 115, 125],
|
|
103
|
+
"Inflation": [2.1, 2.3, 1.9, 2.4, 2.0]
|
|
104
|
+
})
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### OLS回归分析
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
# 回归分析
|
|
111
|
+
result = await ols_regression(
|
|
112
|
+
y_data=[100, 110, 120, 115, 125],
|
|
113
|
+
x_data=[[2.1, 4.5], [2.3, 4.2], [1.9, 4.0], [2.4, 4.3], [2.0, 4.1]],
|
|
114
|
+
feature_names=["inflation", "unemployment"]
|
|
115
|
+
)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 假设检验
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
# 假设检验
|
|
122
|
+
result = await hypothesis_testing(
|
|
123
|
+
data1=[100, 110, 120, 115, 125],
|
|
124
|
+
data2=[95, 105, 115, 120, 130],
|
|
125
|
+
test_type="t_test"
|
|
126
|
+
)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 时间序列分析
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
# 时间序列分析
|
|
133
|
+
result = await time_series_analysis([100, 110, 120, 115, 125, 130, 128, 135])
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## 可用资源
|
|
137
|
+
|
|
138
|
+
### 示例数据集
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
resource://dataset/sample/economic_growth
|
|
142
|
+
resource://dataset/sample/stock_returns
|
|
143
|
+
resource://dataset/sample/time_series
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 提示模板
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
prompt://economic_analysis?data_description=...&analysis_type=descriptive
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## 项目结构
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
aigroup-econ-mcp/
|
|
156
|
+
├── src/aigroup_econ_mcp/
|
|
157
|
+
│ ├── __init__.py # 包初始化
|
|
158
|
+
│ ├── server.py # MCP服务器核心
|
|
159
|
+
│ ├── cli.py # 命令行入口
|
|
160
|
+
│ └── tools/
|
|
161
|
+
│ ├── __init__.py
|
|
162
|
+
│ ├── statistics.py # 统计分析工具
|
|
163
|
+
│ ├── regression.py # 回归分析工具
|
|
164
|
+
│ └── time_series.py # 时间序列工具
|
|
165
|
+
├── pyproject.toml # 项目配置
|
|
166
|
+
├── README.md
|
|
167
|
+
└── examples/
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## 依赖要求
|
|
171
|
+
|
|
172
|
+
- Python 3.8+
|
|
173
|
+
- pandas >= 1.5.0
|
|
174
|
+
- numpy >= 1.21.0
|
|
175
|
+
- statsmodels >= 0.13.0
|
|
176
|
+
- scipy >= 1.7.0
|
|
177
|
+
- matplotlib >= 3.5.0
|
|
178
|
+
- mcp >= 1.0.0
|
|
179
|
+
|
|
180
|
+
## 开发
|
|
181
|
+
|
|
182
|
+
### 环境设置
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# 安装开发依赖
|
|
186
|
+
uv add --dev pytest pytest-asyncio black isort mypy ruff
|
|
187
|
+
|
|
188
|
+
# 运行测试
|
|
189
|
+
uv run pytest
|
|
190
|
+
|
|
191
|
+
# 代码格式化
|
|
192
|
+
uv run black src/
|
|
193
|
+
uv run isort src/
|
|
194
|
+
|
|
195
|
+
# 类型检查
|
|
196
|
+
uv run mypy src/
|
|
197
|
+
|
|
198
|
+
# 代码检查
|
|
199
|
+
uv run ruff check src/
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### 构建和发布
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# 构建包
|
|
206
|
+
uv build
|
|
207
|
+
|
|
208
|
+
# 发布到PyPI
|
|
209
|
+
uv publish
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## 许可证
|
|
213
|
+
|
|
214
|
+
MIT License
|
|
215
|
+
|
|
216
|
+
## 贡献
|
|
217
|
+
|
|
218
|
+
欢迎贡献代码!请查看[贡献指南](CONTRIBUTING.md)了解详情。
|
|
219
|
+
|
|
220
|
+
## 支持
|
|
221
|
+
|
|
222
|
+
如有问题或建议,请通过[GitHub Issues](https://github.com/aigroup/aigroup-econ-mcp/issues)联系我们。
|
|
223
|
+
|
|
224
|
+
## 致谢
|
|
225
|
+
|
|
226
|
+
感谢Model Context Protocol (MCP)社区提供的优秀工具和文档。
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
aigroup_econ_mcp/__init__.py,sha256=z14iciYc9LvvPliqwqkOx4lOuAcJFQL9iIQeHo9JF5Y,472
|
|
2
|
+
aigroup_econ_mcp/cli.py,sha256=3Cq2W9GMMcv3lsHwQkRcNJv5GbJo8pQZylopXyQPOF4,2193
|
|
3
|
+
aigroup_econ_mcp/server.py,sha256=jBPJNUP5rAGsE0EuPBLglNaXt5eIsDjWzFMbwZSfMiQ,14918
|
|
4
|
+
aigroup_econ_mcp/tools/__init__.py,sha256=o_mAyxeUVxh-xBrggUzS5Yg0uO9FjKvroLXQhFO6ezg,141
|
|
5
|
+
aigroup_econ_mcp/tools/regression.py,sha256=d-WiOSRSPIw5p7nFE6JE34ktQrBBXmZp6eQPfHXTFvA,6230
|
|
6
|
+
aigroup_econ_mcp/tools/statistics.py,sha256=arw5ahGBH4d4pS-wRHh_5z35Yf4LMpiUblR_TLZSbZ0,3415
|
|
7
|
+
aigroup_econ_mcp/tools/time_series.py,sha256=YFGBsKKA1a1FIH3x6gphw4bhVjgw8c-72ibJ4wOeDEM,8122
|
|
8
|
+
aigroup_econ_mcp-0.1.0.dist-info/METADATA,sha256=gSaDlcS73fcUcJJcX-AVlyZkfvC4XGG-v7a0W-HGbiw,5333
|
|
9
|
+
aigroup_econ_mcp-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
10
|
+
aigroup_econ_mcp-0.1.0.dist-info/entry_points.txt,sha256=j5ZJYOc4lAZV-X3XkAuGhzHtIRcJtZ6Gz8ZKPY_QTrM,62
|
|
11
|
+
aigroup_econ_mcp-0.1.0.dist-info/licenses/LICENSE,sha256=x4onvmayh9xPtyeLWVwM9av5hlduofabbcq2z45BbPY,1063
|
|
12
|
+
aigroup_econ_mcp-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 AIGroup
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|