An AI-powered MCP server for Apache Druid cluster management and analytics. It provides tools, resources, and prompts aimed at managing and analyzing Druid clusters, organized around an “intent-based architecture” with profiles selecting an intent and the corresponding area of Druid usage.
🛠️ Key Features
Model Context Protocol (MCP) server
Apache Druid cluster management tools
Analytics capabilities for Druid
Tools, resources, and prompts
Intent-based architecture using profiles and Druid usage areas
A comprehensive Model Context Protocol (MCP) server for Apache Druid that provides extensive tools, resources, and prompts for managing and analyzing Druid clusters.
Developed by iunera - Advanced AI and Data Analytics Solutions
Overview
This MCP server implements a intend-based architecture where profiles picture their usaae intend and the corresponding area of Druid usage. The server provides three main types of MCP components:
Tools - Executable functions for performing operations
Resources - Data providers for accessing information
Prompts - AI-assisted guidance templates
Video Walkthrough
Learn how to integrate AI agents with Apache Druid using the MCP server. This tutorial demonstrates time series data exploration, statistical analysis, and data ingestion using natural language with AI assistants like Claude, ChatGPT, and Gemini.
Click the thumbnail above to watch the video on YouTube
🌊 Y̊pipe: AI-Powered UI for Druid
Experience your data like never before with Y̊pipe (formerly Data-Philter), a local desktop application that makes offline AI practical, designed by iunera. It leverages this Druid MCP Server to provide a seamless, conversational interface for your Druid cluster.
Natural Language Queries: Ask questions in plain English and get results instantly.
Local & Secure: Runs completely locally with support for offline models (CPU/GPU).
Plug & Play: Works out-of-the-box with the Development Druid Installation.
Multiple Transport Modes: STDIO, SSE, and Streamable HTTP support including Oauth
Real-time Communication: Server-Sent Events with streaming capabilities
Comprehensive error handling
Customizable Prompt Templates: AI-assisted guidance with template customization
Comprehensive Error Handling: Graceful error handling with meaningful responses
Enterprise Ready: Production-grade configuration and security features
MCP Inspector Interface
When connected to an MCP client, you can inspect the available tools, resources, and prompts through the MCP inspector interface:
Available Tools
The tools interface shows all available Druid management functions organized by feature areas including data management, ingestion management, and monitoring & health.
Available Resources
The resources interface displays all accessible Druid data sources and metadata that can be retrieved through the MCP protocol.
Available Prompts
The prompts interface shows all AI-assisted guidance templates available for various Druid management tasks and data analysis workflows.
Quick Start
MCP Configuration for LLMs
A ready-to-use MCP configuration file is provided at mcp-servers-config.json that can be used with LLM clients to connect to this Druid MCP server.
Examples
The configuration includes multiple integration and transport options:
STDIO (default): see examples/stdio/README.md - server is spawned by the MCP client over STDIO.
Ypipe Blueprint: see examples/ypipe/README.md - configure and run the Druid MCP Server inside the Ypipe desktop client using the druid.ypipe blueprint.
For detailed development information including build instructions, testing guidelines, architecture details, and contributing guidelines, see development.md.
Available Tools by Feature
The MCP server activates tools dynamically based on active Spring profiles (SPRING_PROFILES_ACTIVE). The default configuration runs the server in STDIO mode with the query profile enabled.
Profile: query (Default Active Profile)
Provides safe, read-only data querying and browsing capabilities.
Tool
Description
Parameters
Druid API Endpoint / Functionality
getDatasources
List all available Apache Druid datasources or get detailed schema for a specific datasource.
The application can be configured using environment variables, which is the recommended approach for production environments. Below is a comprehensive list of supported environment variables derived from the application.yaml configuration file.
Druid Connection
DRUID_ROUTER_URL: The URL of the Druid router.
DRUID_AUTH_USERNAME: The username for Druid authentication.
DRUID_AUTH_PASSWORD: The password for Druid authentication.
DRUID_SSL_ENABLED: Enables or disables SSL for Druid connections (true/false).
DRUID_MCP_SQL_SYNTAX_CORRECTION_ENABLED: Enables or disables automatic SQL syntax correction (default: true). When enabled, automatically formats queries, corrects casing, and quotes identifiers for Druid.
DRUID_MCP_SQL_SYNTAX_CORRECTION_CACHE_TTL_MS: The Time-To-Live (TTL) in milliseconds for the cached table and column metadata loaded from Druid (default: 300000 / 5 minutes).
MCP Server Configuration
DRUID_MCP_SECURITY_OAUTH2_ENABLED: Enables or disables OAuth2 security for HTTP client authentication (true/false).
SPRING_PROFILES_ACTIVE: Comma-separated list of profiles to activate (e.g. query, ops, permissions, health for tools capabilities, or http to enable HTTP server transport instead of default STDIO).
SPRING_AI_MCP_SERVER_NAME: The name of the MCP server.
SPRING_AI_MCP_SERVER_PROTOCOL: The protocol used by the MCP server (e.g., streamable).
General Server Configuration
SERVER_PORT: The port the server listens on.
SERVER_SERVLET_SESSION_COOKIE_NAME: The name of the session cookie.
SPRING_APPLICATION_NAME: The name of the application.
SPRING_MAIN_BANNER_MODE: The mode for the startup banner (e.g., off).
Logging
LOGGING_FILE_NAME: The name of the log file.
LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_SECURITY: The log level for Spring Security (e.g., DEBUG).
SSL-Encrypted Cluster with Authentication
This section provides comprehensive guidance on connecting to SSL-encrypted Druid clusters with username and password authentication.
Prerequisites
SSL-enabled Druid cluster with HTTPS endpoints
Valid username and password credentials for Druid authentication
SSL certificates properly configured (or ability to skip verification for testing)
Configuration Methods
Method 1: Environment Variables (Recommended for Production)
Set the following environment variables before starting the MCP server:
bash
# Druid cluster URL with HTTPSexport DRUID_ROUTER_URL="https://your-druid-cluster.example.com:8888"# Authentication credentialsexport DRUID_AUTH_USERNAME="your-username"export DRUID_AUTH_PASSWORD="your-password"# SSL configurationexport DRUID_SSL_ENABLED="true"export DRUID_SSL_SKIP_VERIFICATION="false"# Use "true" only for testing# Start the MCP server
java -jar target/druid-mcp-server-2.0.1.jar
This server uses Spring AI's MCP Server framework and supports both STDIO and SSE transports. The tools, resources, and prompts are automatically registered and exposed through the MCP protocol.
Transport Modes
The Druid MCP Server supports multiple transport modes compliant with MCP 2025-06-18 specification:
Streamable HTTP Transport (Recommended)
The new Streamable HTTP transport provides enhanced performance and scalability with support for multiple concurrent clients:
bash
# Default configuration with Streamable HTTP
java -Dspring.profiles.active=http \
-jar target/druid-mcp-server-2.0.1.jar
# Server available at http://localhost:8080/mcp (configurable endpoint)
Features:
Single Endpoint: One HTTP endpoint handles both POST and GET requests
Multiple Clients: Support for concurrent client connections
Optional SSE Streaming: Server-Sent Events for real-time updates
Enhanced Security: Origin header validation and authentication
Backwards Compatibility: Automatic fallback for older MCP clients
Keep-alive: Configurable connection health monitoring
Security
The Streamable HTTP and SSE modes are secured with OAuth by default. Your MCP client must obtain and send a valid bearer token when connecting.
Still supported for backwards compatibility. It is no longer the default and may be removed in a future version.
Note: The SSE endpoint is secured with OAuth by default. Clients must include a valid bearer token when connecting. For SSO integration support, see Contact & Support.
Metrics Collection
To enhance the product and understand usage patterns, this server collects anonymous usage metrics. This data helps prioritize new features and improvements. You can opt-out of anonymous metrics collection by setting the druid.mcp.metrics.enabled to `false.
🐳 Development Druid Installation
For local development, testing, and learning, a complete Docker Compose setup for running a full Apache Druid cluster is available at iunera/druid-local-cluster-installer.
This setup is the recommended way to get a Druid cluster running for use with this MCP server.
Key Features:
Complete Druid Cluster: Includes all core Druid services (Coordinator, Broker, Historical, MiddleManager, Router).
One-Command Install: Automated scripts for macOS, Linux, and Windows.
Cross-Platform: Runs anywhere Docker is available.
Pre-configured: Sensible defaults for local development.
Basic Security Enabled: Pre-configured admin user (admin/password).
Ready for Ypipe: Designed to work out-of-the-box with iunera/ypipe.
Related Projects
This Druid MCP Server is part of a comprehensive ecosystem of Apache Druid tools and extensions developed by iunera. These complementary projects enhance different aspects of Druid cluster management and data ingestion:
Advanced configuration management and deployment tools for Apache Druid clusters. This project provides:
Automated Cluster Setup: Streamlined configuration templates for different deployment scenarios
Configuration Management: Best practices and templates for production Druid clusters
Deployment Automation: Tools and scripts for consistent cluster deployments
Environment-Specific Configs: Optimized configurations for development, staging, and production environments
Integration with Druid MCP Server: The cluster configurations provided by this project work seamlessly with the monitoring and management capabilities of the Druid MCP Server, enabling comprehensive cluster lifecycle management.
A specialized Apache Druid extension for ingesting and analyzing code-related data and metrics. This extension enables:
Code Metrics Ingestion: Specialized parsers for code analysis data and software metrics
Developer Analytics: Tools for analyzing code quality, complexity, and development patterns
CI/CD Integration: Seamless integration with continuous integration and deployment pipelines
Custom Data Formats: Support for various code analysis tools and formats
Integration with Druid MCP Server: This extension expands the ingestion capabilities that can be managed through the MCP server's ingestion management tools, providing specialized support for code analytics use cases.
Why Use These Together?
Complete Ecosystem: From cluster setup to specialized data ingestion and management
Consistent Architecture: All projects follow similar design principles and integration patterns
Enhanced Capabilities: Each project extends different aspects of the Druid ecosystem
Production Ready: Battle-tested configurations and extensions for enterprise deployments
Roadmap
Druid Auto Compaction: Intelligent automatic compaction configuration
MCP Auto Completion: Enhanced autocomplete functionality with sampling using McpComplete
MCP Notifications: Real-time notifications for MCP operations
Proper Observability: Comprehensive metrics and tracing
Enhanced Monitoring: Advanced cluster monitoring and alerting capabilities
Advanced Analytics: Machine learning-powered insights and recommendations
Kubernetes Support: Proper deployment on Kubernetes
About iunera
This Druid MCP Server is developed and maintained by iunera, a leading provider of advanced AI and data analytics solutions.
iunera specializes in:
AI-Powered Analytics: Cutting-edge artificial intelligence solutions for data analysis
Enterprise Data Platforms: Scalable data infrastructure and analytics platforms (Druid, Flink, Kubernetes, Kafka, Spring)
Model Context Protocol (MCP) Solutions: Advanced MCP server implementations for various data systems
Custom AI Development: Tailored AI solutions for enterprise needs
As veterans in Apache Druid iunera deployed and maintained a large number of solutions based on Apache Druid in productive enterprise grade scenarios.
Need Expert Apache Druid Consulting?
Maximize your return on data with professional Druid implementation and optimization services. From architecture design to performance tuning and AI integration, our experts help you navigate Druid's complexity and unlock its full potential.
Need Enterprise MCP Server Development Consulting?
ENTERPRISE AI INTEGRATION & CUSTOM MCP (MODEL CONTEXT PROTOCOL) SERVER DEVELOPMENT
Iunera specializes in developing production-grade AI agents and enterprise-grade LLM solutions, helping businesses move beyond generic AI chatbots. They build secure, scalable, and future-ready AI infrastructure, underpinned by the Model Context Protocol (MCP), to connect proprietary data, legacy systems, and external APIs to advanced AI models.