Back to MCP directory
publicPublicdnsLocal runtime

BI-Chart-MCP-Server

该项目是一个基于Python实现的BI图表MCP服务,用于数据可视化,包含数据加载、处理和渲染模块。

article

README

🚀 BI 图表 MCP 服务器

本项目运用 Python 实现了 BI 图表 MCP 服务器。此前该功能曾通过 TypeScript 进行原型开发,而当前的维护版本采用 Python 编写。

🚀 快速开始

安装

  1. 克隆仓库。
  2. 创建虚拟环境并激活:
    python -m venv .venv
    .venv\Scripts\activate   # Windows 系统
    
  3. 安装所需的依赖项:
    pip install -r requirements.txt
    

运行服务器

你可以使用提供的脚本启动服务器:

python scripts/run_server.py

或者直接从模块启动服务器:

python -m mcp_bi_visualizer.server

测试

使用你喜欢的测试运行器运行测试。例如,使用 pytest:

pytest

✨ 主要特性

  • 从基于 TypeScript 的实现迁移到 Python,便于维护。

📦 安装指南

  1. 克隆仓库。
  2. 创建虚拟环境并激活:
    python -m venv .venv
    .venv\Scripts\activate   # Windows 系统
    
  3. 安装所需的依赖项:
    pip install -r requirements.txt
    

💻 使用示例

基础用法

启动服务器:

# 使用脚本启动服务器
python scripts/run_server.py

# 或者直接从模块启动服务器
python -m mcp_bi_visualizer.server

高级用法

运行测试:

# 使用 pytest 运行测试
pytest

📚 详细文档

项目结构

  • mcp_bi_visualizer/:包含主服务代码和模块。
    • server.py:启动 MCP 服务器的主要入口点。
    • data/:数据加载和处理模块。
      • loader.py
      • processor.py
    • resources/:管理项目资源的模块。
      • manager.py
      • memo.py
    • visualization/:图表组件。
      • renderer.py
      • vega_lite.py
  • scripts/
    • run_server.py:启动服务器的脚本。
  • tests/:服务端和图表组件的单元测试。
  • 其他文件包括配置文件(例如 pyproject.tomlrequirements.txtsetup.py)和技术文档。

📄 许可证

文档未提及相关信息。

备注

  • 该项目已从基于 TypeScript 的实现迁移到 Python。
  • 如有任何问题或贡献,请参考 CONTRIBUTING.md 文件。

希望你会喜欢这个 BI 图表 MCP 服务器!

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client