Skip to main content

xtai-mcp-data-analysis

一个基于MCP协议的数据分析和可视化 MCP server,支持CSV和Excel格式的数据文件处理。

功能特性

  • 数据概览:获取数据的表头信息、字段类型、数据条数等基本信息
  • 数据汇总分析:计算数值列的平均值、中位数、方差等统计指标
  • 多维数据透视可视化:生成柱状图、饼图、热力图、堆叠图等多种可视化图表
  • 灵活的聚合函数:支持求和(sum)、平均(mean)、计数(count)、最大值(max)、最小值(min)等多种聚合方式

如何在客户端引用

在MCP客户端配置中添加如下配置:

{
  "mcpServers": {
    "xtai-mcp-data-analysis": {
      "command": "uvx",
      "args": ["xtai-mcp-data-analysis"]
    }
  }
}

提供的工具

1. data_overview

获取数据的基本概览信息。

参数:

  • data_path: 数据文件路径,支持.csv、.xlsx、.xls格式

示例:

{
  "name": "data_overview",
  "arguments": {
    "data_path": "./sales_data.csv"
  }
}

2. data_summary

获取数据的汇总分析情况,包括数值列统计、类别列统计和缺失值统计。

参数:

  • data_path: 数据文件路径,支持.csv、.xlsx、.xls格式

示例:

{
  "name": "data_summary",
  "arguments": {
    "data_path": "./sales_data.xlsx"
  }
}

3. visualize_data

通过数据透视的方式可视化数据。

参数:

  • data_path: 数据文件路径,支持.csv、.xlsx、.xls格式
  • index: 数据透视的索引列名列表,支持1-2个维度,如['城市','季度']
  • values: 需要聚合的数值列名列表,如['销量','销售额']
  • aggfunc (可选): 聚合函数,支持sum | mean | count | max | min | median | std | var,默认是sum
  • output_dir (可选): 聚合图表的保存目录,默认./output

示例:

{
  "name": "visualize_data",
  "arguments": {
    "data_path": "./sales_data.csv",
    "index": ["城市"],
    "values": ["销售额"],
    "aggfunc": "sum",
    "output_dir": "./charts"
  }
}

支持的文件格式

  • CSV (逗号分隔值文件)
  • XLSX (Excel 2007+ 文件)
  • XLS (旧版 Excel 文件)

输出图表类型

根据输入参数的不同,服务器会自动生成多种类型的图表:

  • 单维度分析:柱状图、饼图
  • 双维度分析:热力图、堆叠柱状图、分组柱状图
  • 多值对比:多指标对比柱状图

所有生成的图表都会以PNG格式保存到指定的输出目录中,并返回图表路径和对应的数据信息。

Metadata

Release files for xtai-mcp-data-analysis 0.1.0

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

Source distribution (sdist)

Source distribution for xtai-mcp-data-analysis 0.1.0
File Size Uploaded Provenance
xtai_mcp_data_analysis-0.1.0.tar.gz 9.2 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 19.0 kB

Release files / xtai_mcp_data_analysis-0.1.0.tar.gz

Download URL xtai_mcp_data_analysis-0.1.0.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
794927bb73e2124c68017a440d58b3e3e14cc7a742d99cf61c9a0990eb601a22
BLAKE2b-256 checksum
How to use checksums
2705a3ed5e77f769124965a802eaaf8930c3e512a68e7a3546878501d67e6be8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release files / xtai_mcp_data_analysis-0.1.0-py3-none-any.whl

Download URL xtai_mcp_data_analysis-0.1.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec0c7c803f823bd8cd33fa18d5207f44b23ab26cba064d4fc8b83a3c17bd7a5e
BLAKE2b-256 checksum
How to use checksums
f095f9fca8908d5f45fed4de01f3171162f7b02abedc0d4065822454279a2de1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Security for xtai-mcp-data-analysis 0.1.0

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.0 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