Skip to main content

This tool supports the extraction of text, images, and other elements from various document formats.

Project description

mcp-polaris-ai-datainsight

Polaris AI DataInsight is an API service that easily converts documents in various formats into structured data (such as JSON).

This tool supports the extraction of text, images, and other elements from various document formats (e.g. .docx, .pptx, .xlsx, .hwp, .hwpx).

For more details, please refer to the documentation.

Features

1. Extract content from document

Extract text, images, and other elements from various document formats.

  • Supported document formats : docx, xlsx, pptx, hwpx, hwp
  • Supported elements types : text, table, image, chart, shape, header, footer, caption
  • Images in the document are stored on local storage, and the corresponding image paths are included in the JSON output.
  • Tables are represented in JSON format, as illustrated in this example.

2. List files in allowed directories

List the files in the directory path set in the POLARIS_AI_DATA_INSIGHT_RESOURCES_DIR environment variable (in the case of Docker, the path mounted to /app/readable).

  • Used to retrieve file paths to be passed as arguments to the "Extract content from document" Tool.

Installation and Setup

Prerequisites

To use this server, follow these steps:

  1. Generate an API key.

  2. Install uv.

  3. Create a writable directory for storing extraction-result resources(e.g. images in files), and set its path in the POLARIS_AI_DATA_INSIGHT_RESOURCES_DIR environment variable.

After that, choose one of the installation methods below and start the server.

Method 1: Manual Configuration

If you prefer a manual setup, add the following configuration to your IDE's MCP config file:

{
  "mcpServers": {
    "datainsight": {
      "command": "uvx",
      "args": [
        "--no-cache", 
        "mcp-polaris-ai-datainsight@latest",
        "/path/to/directory_1/containing/document/files",
        "/path/to/directory_2/containing/document/files",
        "..."
      ],
      "env": {
        "POLARIS_AI_DATA_INSIGHT_API_KEY": "your-api-key",
        "POLARIS_AI_DATA_INSIGHT_RESOURCES_DIR": "/path/to/save/images/in/document"
      }
    }
  }
}

Or, edit the claude_desktop_config.json to run with Claude Desktop:

{
  "mcpServers": {
    "datainsight": {
      "command": "uv",
      "args": [
        "--directory",
        "/your/repo/mcp-polaris-ai-datainsight",
        "run",
        "mcp_polaris_ai_datainsight/server.py"],
      "env": {
        "POLARIS_AI_DATA_INSIGHT_API_KEY": "your-api-key",
        "POLARIS_AI_DATA_INSIGHT_RESOURCES_DIR": "/path/to/save/resources",
        "PYTHONUTF8": "1"
      }
    }
  }
}

Method 2: Docker Container

  1. Clone repository
    git clone --branch main https://github.com/PolarisOffice/PolarisAIDataInsight.git
    
    If you want to clone only mcp-polaris-ai-datainsight directory:
    # Git Version >= 2.25
    git clone --filter=blob:none --sparse --branch main https://github.com/PolarisOffice/PolarisAIDataInsight.git
    
    cd PolarisAIDataInsight
    
    git sparse-checkout set mcp-polaris-ai-datainsight
    
  2. Build Docker image:
    cd mcp-polaris-ai-datainsight
    
    docker build -t mcp/datainsight .
    
  3. Use this MCP Server config: Note: All readable files must be mounted to /app/readable by default.
    {
      "mcpServers": {
        "datainsight": {
          "command": "docker",
          "args": [
            "run",
            "-i",
            "--rm",
            "-e",
            "POLARIS_AI_DATA_INSIGHT_API_KEY=your-api-key",
            "--mount", "type=bind,src=/path/to/allowed/directory_1,dst=/app/readable/directory_1,ro",
            "--mount", "type=bind,src=/path/to/allowed/directory_2,dst=/app/readable/directory_2,ro",
            "--mount", "type=bind,src=/path/to/your/file.txt,dst=/app/readable/file.txt,ro",
            "mcp-polaris-ai-datainsight",
          ]
        }
      }
    }
    

Method 3: Clone git repository

[!] Important: uv and poetry must be pre-installed.

  1. Clone git repository
  2. Install python dependencies in virtual environment
    cd mcp-polaris-ai-datainsight
    
    uv venv .venv
    
    # Linux
    source .venv/bin/activate
    # Windows
    .venv\bin\activate
    
    
    poetry install --no-root
    
  3. Set API Key and Resources Directory as environment values and Run server
    # Linux
    export POLARIS_AI_DATA_INSIGHT_API_KEY="your-api-key"
    export POLARIS_AI_DATA_INSIGHT_RESOURCES_DIR="/path/to/save/resources"
    # Windows
    set POLARIS_AI_DATA_INSIGHT_API_KEY="your-api-key"
    set POLARIS_AI_DATA_INSIGHT_RESOURCES_DIR="/path/to/save/resources"
    
    python -m mcp_polaris_ai_datainsight.server /path/to/allowed/directory_1 /path/to/allowed/directory_2 ...
    

Output

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_polaris_ai_datainsight-0.0.10.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_polaris_ai_datainsight-0.0.10-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file mcp_polaris_ai_datainsight-0.0.10.tar.gz.

File metadata

  • Download URL: mcp_polaris_ai_datainsight-0.0.10.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.11 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for mcp_polaris_ai_datainsight-0.0.10.tar.gz
Algorithm Hash digest
SHA256 56a4c27662d6ff2d54fe1c6ce8da51de6f7d68f957e4272ef7b9aeb62166d453
MD5 0717ef4110b0893415bb411317af93b2
BLAKE2b-256 103e82f4a02a60fb9bcef7e0517144a24dc50f8c726db4bae80c30c45bcc9424

See more details on using hashes here.

File details

Details for the file mcp_polaris_ai_datainsight-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_polaris_ai_datainsight-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 e410ed14df6660aeeac89681b5696d83c08568298f0695e1abc5da062d4fa3d6
MD5 e83bd0dcd667c4e0988bfbc0ade15822
BLAKE2b-256 8078c4983773feda21f425fb1fab833c208d90fb11c69e1fe33cc8cf719f9deb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page