Skip to main content

数据分析MCP服务

Project description

数据分析MCP服务

这是一个基于MCP(Model Control Panel)框架的数据分析服务,提供数据分析和公司信息查询功能。

功能

  • 公司算账经营数据分析
  • 公司信息查询

环境要求

  • Python 3.8+
  • UV包管理器

安装

  1. 克隆仓库:
git clone https://github.com/yourusername/data_analysis_mcp.git
cd data_analysis_mcp
  1. 使用UV创建虚拟环境并安装依赖:
uv venv
source .venv/bin/activate  # Linux/Mac
# 或
.venv\Scripts\activate  # Windows

uv pip install -e .

配置

  1. 复制环境变量示例文件并修改:
cp .env.example .env
  1. 编辑.env文件,设置你的环境变量:
OPENAI_API_KEY=your_api_key_here

运行

python run.py

打包

使用UV打包应用:

uv pip build

这将在dist目录下生成wheel包。

部署

安装生成的wheel包:

uv pip install dist/data_analysis_mcp-0.1.0-py3-none-any.whl

使用Docker部署

  1. 构建Docker镜像:
docker build -t data-analysis-mcp:latest .
  1. 运行容器:
docker run -p 8000:8000 -e OPENAI_API_KEY=your_api_key_here data-analysis-mcp:latest

接口文档

分析数据

analyze_data(query: str) -> dict

参数:

  • query: 用户的查询内容,例如"请分析1-6月份边际贡献最高的5家分公司"

查询公司信息

query_company_info(query: str) -> str

参数:

  • query: 用户的查询内容,例如"欧冶金诚服务有限公司"

许可证

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

data_analysis_mcp-0.1.8.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

data_analysis_mcp-0.1.8-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file data_analysis_mcp-0.1.8.tar.gz.

File metadata

  • Download URL: data_analysis_mcp-0.1.8.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for data_analysis_mcp-0.1.8.tar.gz
Algorithm Hash digest
SHA256 7501b389415fa8bcef961f13abb83dba0d8972e94c19f5927bbd5856a5a08049
MD5 76944b555da8881a4ee11aac77a143ad
BLAKE2b-256 059fb74016584afb77553b87367572b6414221dff70383ca860e0248fda5bc45

See more details on using hashes here.

File details

Details for the file data_analysis_mcp-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for data_analysis_mcp-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5d88293c2d94021d415cce8c97175e93c7453314093b5c0d5aeea96a25cf470b
MD5 ffa2e8d4cf10e5eaf2b9a25fb93af2ef
BLAKE2b-256 d68451414196422d9f96dccd68633c61845e44788e8844b40cb50f8d9d27db71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page