Skip to content

cdgmx/insight-bridge

Repository files navigation

InsightBridge

Turn your AI assistant into a data analyst in 2 minutes.

Connect Cline, Cursor, Claude Desktop, or any AI tool to your data sources. Ask questions in plain English, get insights from your data instantly.

What You Can Do

  • "Show me error logs from the last hour" → Get instant insights from telemetry data
  • "Which customers generated the most revenue this month?" → Analyze business metrics effortlessly
  • "Find all failed authentication attempts" → Investigate security incidents with AI help
  • "Summarize system performance trends" → Get automated analysis of monitoring data

No more writing complex queries. Just ask your AI assistant natural questions about your data.

Quick Setup

For Claude Code Users

Run this terminal command to install:

claude mcp add insightbridge -- npx -y insightbridge@latest

For Cline Users

Add this to your cline_mcp_settings.json file:

{
  "mcpServers": {
    "insightbridge": {
      "command": "npx",
      "args": ["-y", "insightbridge@latest"],
      "env": {},
      "disabled": false,
      "autoApprove": [
        "connect",
        "list-tables",
        "describe-table",
        "run-query"
      ]
    }
  }
}

For Cursor Users

Add this to your VS Code settings.json:

{
  "mcp": {
    "servers": {
      "insightbridge": {
        "type": "stdio",
        "command": "npx",
        "args": ["-y", "insightbridge"]
      }
    }
  }
}

For Claude Desktop Users

Add this to your Claude Desktop configuration file:

{
  "mcpServers": {
    "insightbridge": {
      "command": "npx",
      "args": ["-y", "insightbridge"]
    }
  }
}

Authentication Setup

  1. Install Azure CLI (if you haven't already):

    # Windows
    winget install Microsoft.AzureCLI
    
    # macOS
    brew install azure-cli
    
    # Linux
    curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
  2. Login to Azure:

    az login
  3. That's it! Your AI assistant can now connect to your data sources.

Test It Works

Ask your AI assistant:

"Connect to my Azure Data Explorer cluster at https://your-cluster.kusto.windows.net and show me the available tables"

You should see your AI successfully connect and list your database tables.

Supported AI Tools

  • Claude Code - One-command setup with native MCP support
  • Cline - Full support with auto-approval
  • Cursor - Complete integration
  • Claude Desktop - Native MCP support
  • VS Code with MCP - Built-in compatibility
  • Any MCP-compatible tool - Universal support

Available Tools

Tool Description
connect Connect to a data source
list-tables List tables in the current database
describe-table Show table schema and columns
run-query Execute queries with intelligent result limiting
list-functions List functions in the current database
describe-function Show function details and code

Environment Variables

Variable Description
INSIGHTBRIDGE_ADX_CLUSTER_URL ADX cluster URL for auto-connection
INSIGHTBRIDGE_DEFAULT_DATABASE Default database for auto-connection
INSIGHTBRIDGE_ADX_AUTH_METHOD Auth method: azure-identity or azure-cli
INSIGHTBRIDGE_QUERY_TIMEOUT_MS Query timeout in milliseconds
INSIGHTBRIDGE_RESPONSE_FORMAT Response format: json or markdown
INSIGHTBRIDGE_MAX_ROWS Maximum response character count
INSIGHTBRIDGE_ENABLE_QUERY_STATISTICS Enable query statistics (true/false)
INSIGHTBRIDGE_ENABLE_PROMPTS Enable MCP prompts (true/false)
INSIGHTBRIDGE_MARKDOWN_MAX_CELL_LENGTH Max characters per markdown cell
INSIGHTBRIDGE_MIN_RESPONSE_ROWS Minimum rows to return

Common Issues

🔒 Permission denied?

  • Run az login and make sure you have access to the Azure Data Explorer cluster
  • Verify you're logged into the correct Azure tenant

🔌 Can't connect to cluster?

  • Double-check the cluster URL format: https://your-cluster.kusto.windows.net
  • Ensure the cluster is accessible from your network

❓ AI doesn't see the tools?

  • Restart your AI assistant after adding the configuration
  • Check that the JSON configuration is valid (use a JSON validator)

How It Works

Architecture Overview

graph TB
    subgraph "AI Tools"
        A1[Claude Code]
        A2[Cline]
        A3[Cursor]
        A4[Claude Desktop]
        A5[Any MCP Client]
    end

    subgraph "MCP Protocol"
        MCP[Stdio Transport]
    end

    subgraph "InsightBridge Server"
        Server[MCP Server]
        Tools[Tool Handlers]
        Registry[Provider Registry]
        Limiter[Result Limiter]
        Prompts[Prompt Manager]
    end

    subgraph "Data Providers"
        ADX[Azure Data Explorer]
        Future[More Providers...]
    end

    subgraph "Your Data"
        DB[(ADX Cluster)]
    end

    A1 & A2 & A3 & A4 & A5 --> MCP
    MCP --> Server
    Server --> Tools
    Tools --> Registry
    Tools --> Limiter
    Tools --> Prompts
    Registry --> ADX
    ADX --> Future
    ADX --> DB
Loading

Request Flow

sequenceDiagram
    participant User as User
    participant AI as AI Assistant
    participant MCP as InsightBridge MCP Server
    participant Provider as Data Provider
    participant DB as Database

    User->>AI: Ask natural question
    AI->>MCP: Call tool (e.g., run-query)
    MCP->>Provider: Execute query
    Provider->>DB: Send KQL query
    DB-->>Provider: Return raw results
    Provider-->>MCP: QueryResult
    MCP->>MCP: Limit response size
    MCP-->>AI: Formatted results
    AI-->>User: Natural language answer
Loading

Tool Execution Pipeline

flowchart LR
    subgraph "Input"
        A[User Question]
    end

    subgraph "Processing"
        B{Tool Selection}
        C[Validate Input]
        D[Check Connection]
        E[Execute Operation]
        F[Limit Results]
        G[Format Output]
    end

    subgraph "Output"
        H[Response to AI]
    end

    A --> B
    B -->|connect| C
    B -->|list-tables| D
    B -->|describe-table| D
    B -->|run-query| D
    B -->|list-functions| D
    B -->|describe-function| D

    C --> E
    D -->|Connected| E
    D -->|Not Connected| X[Error: Connect first]

    E --> F
    F --> G
    G --> H
Loading

Provider Architecture

classDiagram
    class InsightProvider {
        <<interface>>
        +connect(input) ConnectionHandle
        +listTables(handle) TableInfo[]
        +describeTable(handle) TableSchema
        +runQuery(handle) QueryResult
        +listFunctions(handle) FunctionInfo[]
        +describeFunction(handle) FunctionDetails
    }

    class AdxProvider {
        -clusterUrl: string
        -database: string
        +connect(input) ConnectionHandle
        +listTables(handle) TableInfo[]
        +describeTable(handle) TableSchema
        +runQuery(handle) QueryResult
        +listFunctions(handle) FunctionInfo[]
        +describeFunction(handle) FunctionDetails
    }

    class ProviderRegistry {
        -providers: Map
        +register(provider)
        +get(id) InsightProvider
        +list() InsightProvider[]
    }

    class MCPTools {
        +connect()
        +listTables()
        +describeTable()
        +runQuery()
        +listFunctions()
        +describeFunction()
    }

    InsightProvider <|.. AdxProvider
    ProviderRegistry --> InsightProvider : manages
    MCPTools --> InsightProvider : calls
Loading

What's Under the Hood

InsightBridge is a provider-based MCP analytics server. Azure Data Explorer (ADX) is the first supported provider, with more planned.

The server provides your AI assistant with tools to:

  • Initialize connections to data sources
  • Browse database tables and schemas
  • Execute queries with intelligent result limiting
  • Handle authentication securely through Azure CLI
  • Format results appropriately for AI context windows

Advanced Configuration

Need custom settings? Check out our Configuration Guide for:

  • Response format options (JSON vs Markdown)
  • Query timeout settings
  • Result size limiting
  • OpenTelemetry integration

For Developers

Building, testing, or contributing? See our Developer Documentation for:

  • Building from source
  • Running tests
  • Project structure
  • Contributing guidelines

License

MIT


💡 Pro tip: Start by asking your AI to "show me the tables in my database" to explore what data you have available, then ask natural language questions about specific tables.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors