Skip to main content

数据分析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

Metadata

Release files for data-analysis-mcp 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for data-analysis-mcp 0.1.8
File Size Uploaded Provenance
data_analysis_mcp-0.1.8.tar.gz 7.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for data-analysis-mcp 0.1.8
File Interpreter ABI Platform
data_analysis_mcp-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / data_analysis_mcp-0.1.8.tar.gz

Download URL data_analysis_mcp-0.1.8.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7501b389415fa8bcef961f13abb83dba0d8972e94c19f5927bbd5856a5a08049
BLAKE2b-256 checksum
How to use checksums
059fb74016584afb77553b87367572b6414221dff70383ca860e0248fda5bc45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / data_analysis_mcp-0.1.8-py3-none-any.whl

Download URL data_analysis_mcp-0.1.8-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d88293c2d94021d415cce8c97175e93c7453314093b5c0d5aeea96a25cf470b
BLAKE2b-256 checksum
How to use checksums
d68451414196422d9f96dccd68633c61845e44788e8844b40cb50f8d9d27db71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Security for data-analysis-mcp 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page