BI Chart MCP Server

BI Chart MCP Server

By c-cf GitHub

An MCP (Model Context Protocol) server for data transformation and BI charts will allow AI assistants to connect to your data sources, transform data, and generate high-quality visualizations through natural language requests.

Overview

What is Data BI MCP Server?

Data BI MCP Server is a Model Context Protocol (MCP) server designed for transforming data into high-quality Business Intelligence (BI) charts. It allows AI assistants to connect to various data sources, perform data transformations, and generate visualizations through natural language requests.

How to use Data BI MCP Server?

To use the server, clone the repository, install the dependencies, and start the server. Connect to it using an MCP-compatible AI assistant and issue natural language commands to interact with your data.

Key features of Data BI MCP Server?

  • Data Source Connections: Connects to databases (PostgreSQL, MySQL, SQLite) and files (CSV, Excel, JSON).
  • Data Transformation: Capable of filtering, aggregating, joining, and sorting data.
  • BI Visualizations: Generates various types of charts including bar charts, line charts, pie charts, and scatter plots.
  • MCP Compatibility: Works seamlessly with any MCP-compatible AI assistant.

Use cases of Data BI MCP Server?

  1. Connecting to a PostgreSQL database to visualize sales data.
  2. Loading and transforming CSV data for analysis.
  3. Generating visual reports for business intelligence.

FAQ from Data BI MCP Server?

  • Can I connect to multiple data sources?

Yes! The server supports connections to various databases and file types.

  • Is there a specific AI assistant I need to use?

No, as long as the assistant is MCP-compatible, it can connect to the server.

  • How do I customize the server's port?

You can set the PORT environment variable to change the default port.

Content

BI Chart MCP Server

This project implements the BI Chart MCP Server using Python. Previously, the functionality was prototyped with TypeScript, but the current and maintained version is built with Python.

Project Structure

  • mcp_bi_visualizer/: Contains the main server code and modules.
    • server.py: Main entry point for starting the MCP server.
    • data/: Data loading and processing modules.
      • loader.py
      • processor.py
    • resources/: Modules to manage project resources.
      • manager.py
      • memo.py
    • visualization/: Visualization components.
      • renderer.py
      • vega_lite.py
  • scripts/
    • run_server.py: A script to launch the server.
  • tests/: Unit tests for the server and visualization components.
  • Other files include configuration files (e.g., pyproject.toml, requirements.txt, setup.py) and documentation.

Installation

  1. Clone the repository.
  2. Create a virtual environment and activate it:
    python -m venv .venv
    .venv\Scripts\activate   # On Windows
    
  3. Install the required dependencies:
    pip install -r requirements.txt
    

Running the Server

You can run the server using the provided script:

python scripts/run_server.py

Alternatively, you can start the server directly from the module:

python -m mcp_bi_visualizer.server

Testing

Run the tests using your preferred test runner. For example, with pytest:

pytest

Notes

  • The project has been migrated from a TypeScript-based implementation to Python.
  • For any issues or contributions, please refer to the CONTRIBUTING.md file.

Enjoy using the BI Chart MCP Server!

No tools information available.
No content found.