Mcp-ChatBI

by dynamiclu

MCP Client 18 stars
  • other

基于 Mcp 架构的 ChatBI,是一种数据分析智能体解决方案

About

What is Mcp-ChatBI?

Mcp-ChatBI is a data analysis agent solution built on the MCP architecture, designed to address common ChatBI problems such as data accuracy, multi-metric queries, and automated analysis chains. It runs on Python 3.10–3.12 and is deployed via an API backend and a Gradio web interface.

How to use Mcp-ChatBI?

Clone the repository, install dependencies with pip3 install -r requirements.txt, configure your Qwen model API key and model name in config/config.toml, then start the API with python3 main-api.py and the Gradio interface with python3 main-webui.py.

Key features of Mcp-ChatBI

- Text2Tools approach for 100% data accuracy
- Multi-metric query in a single conversation
- Automated data analysis chain via model reasoning
- Supports Headless BI services or custom APIs
- Gradio web UI for easy interaction

Use cases of Mcp-ChatBI

- Ensuring absolute data accuracy in business intelligence reporting
- Querying multiple metrics (e.g., revenue, users, conversion) in one dialogue
- Automating complex analytical workflows like comparative analysis or root cause attribution

FAQ from Mcp-ChatBI

How does Mcp-ChatBI guarantee data accuracy?

Instead of Text2SQL or Text2Code, it uses a Text2Tools pattern where tools are Headless BI services or APIs, eliminating model hallucination.

Can I query multiple metrics in one conversation?

Yes. The model automatically decomposes the request, plans a task order, and calls the appropriate tools sequentially, returning all results together.

Which large language model does Mcp-ChatBI support?

It is configured to use Qwen models (e.g., qwen-max) via the config/config.toml file, where you set the API key and model name.

What are the deployment requirements?

Python 3.10 to 3.12 and installation of dependencies from requirements.txt. No GPU is explicitly required; it relies on model API calls.

Is Mcp-ChatBI open-source?

Yes. The project is available on GitHub and can be freely cloned and deployed.

Details

Author
dynamiclu
GitHub stars
18
Category
other
Repository
dynamiclu/mcp-chatbi

Mcp-ChatBI

介绍

基于 Mcp 架构的 ChatBI,是一种数据分析智能体解决方案。

本项目主要解决ChatBI常见的三个问题
+ 1、如何保障数据的100%的准确性?

由于模型存在幻觉,无论是Text2SQL、Text2Code,都无法保障数据100%的准确。且数据的准确性又是BI系统的红线,因此,本项目使用Text2Tools的方案,Tools可以是Headless BI的服务,也可是API。

+ 2、一次对话如何查询多个指标?

过去一次对话只能查一个指标,若多个指标需要工程层面去拆解,架构的复杂度非常高,本项目,利用模型的任务规划、推理能力,模型自动拆解多个指标,并按照顺序调用Tools,并返回结果。

+ 3、如何让数据分析的链路自动化?

常见的数据分析方法,如对比分析、多维钻取、归因运算等,它常常伴有复杂的逻辑推理,当前大模型能力突飞猛进,已经具有复杂问题的推理能力,因此,本项目,利用模型推理能力,自动生成数据链路,并逐次调用Tools,返回结果,最后总结分析。

部署

1. 环境配置

+ 确保你的机器安装了 Python 3.10 - 3.12

# 拉取仓库
$ git clone https://github.com/dynamiclu/Mcp-ChatBI.git

进入目录

$ cd Mcp-ChatBI

安装全部依赖

$ pip3 install -r requirements.txt

+ 大模型配置

$ vim config/config.toml
[model]
qwen_api_key = "sk-"
qwen_model_name = "qwen-max"

2. 启动接口

# 启动API
$ python3 main-api.py

3. 启动Gradio

# 启动Gradio
$ python3 main-webui.py

4. 演示

https://www.bilibili.com/video/BV1b95vzPEjf/