A comprehensive Model Context Protocol (MCP) server for Apache Druid that provides extensive tools, resources, and prompts for managing and analyzing Druid clusters.
Created 3 months ago
A comprehensive Model Context Protocol (MCP) server for Apache Druid that provides extensive tools, resources, and prompts for managing and analyzing Druid clusters.
development
location
documentation
public
MCP
Apache Druid
What is A comprehensive Model Context Protocol (MCP) server for Apache Druid that provides extensive tools, resources, and prompts for managing and analyzing Druid clusters.?
This MCP server implements a feature-based architecture where each package represents a distinct functional area of Druid management. The server provides three main types of MCP components: Tools, Resources, and Prompts. It supports integration with AI agents for data exploration and analysis, and offers a variety of features including customizable prompt templates and comprehensive error handling.
Documentation
Druid MCP Server
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 feature-based architecture where each package represents a distinct functional area of Druid management. 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
Features
Spring AI MCP Server integration
Tool-based architecture for MCP protocol compliance
STDIO and SSE transport support
Comprehensive error handling
Customizable prompt templates
Feature-based package organization
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# Prerequisites
Java 24
Maven 3.6+
Apache Druid cluster running with router on port 8888
Build and Run
mvn clean package -DskipTests
# Run the application
java -jar target/druid-mcp-server-1.0.0.jar
The server will start on port 8080 by default.
For detailed build instructions, testing, Docker setup, and development guidelines, see development.md.
Installation from Maven Central
If you prefer to use the pre-built JAR without building from source, you can download and run it directly from Maven Central.
Prerequisites
Java 24 JRE only
Download and Run
mkdir druid-mcp-server && cd druid-mcp-server
# Download the JAR from Maven Central
curl -L -o druid-mcp-server-1.0.0.jar \
"https://repo.maven.apache.org/maven2/com/iunera/druid-mcp-server/1.0.0/druid-mcp-server-1.0.0.jar"
# Run with SSE Transport (HTTP-based, default)
java -jar druid-mcp-server-1.0.0.jar
# OR run with STDIO Transport (recommended for LLM clients)
java -Dspring.ai.mcp.server.stdio=true \
- Dspring.main.web-application-type=none \
- Dlogging.pattern.console= \
- jar druid-mcp-server-1.0.0.jar
Installation with Docker
If you prefer to use Docker, you can run the pre-built Docker image directly from Docker Hub without any local Java installation.
Prerequisites
Docker installed and running
Pull and Run
docker pull iunera/druid-mcp-server:latest
# Run with SSE Transport (HTTP-based, default)
docker run -p 8080:8080 \
- e DRUID_BROKER_URL=http://your-druid-broker:8082 \
- e DRUID_COORDINATOR_URL=http://your-druid-coordinator:8081 \
iunera/druid-mcp-server:latest
# OR run with STDIO Transport (recommended for LLM clients)
docker run --rm -i \
- e SPRING_AI_MCP_SERVER_STDIO=true \
- e SPRING_MAIN_WEB_APPLICATION_TYPE=none \
- e LOGGING_PATTERN_CONSOLE= \
- e DRUID_BROKER_URL=http://your-druid-broker:8082 \
- e DRUID_COORDINATOR_URL=http://your-druid-coordinator:8081 \
iunera/druid-mcp-server:latest
Replace your-druid-broker and your-druid-coordinator with your actual Druid cluster endpoints.
For Developers
For detailed development information including build instructions, testing guidelines, architecture details, and contributing guidelines, see development.md.
Available Tools by Feature# Data Management
Feature
Tool
Description
Parameters
Datasource
listDatasources
List all available Druid datasource names
None
Datasource
showDatasourceDetails
Show detailed information for a specific datasource including column information
datasourceName (String)
Datasource
killDatasource
Kill a datasource permanently, removing all data and metadata
datasourceName (String), interval (String)
Lookup
listLookups
List all available Druid lookups from the coordinator
Configure your Druid connection in src/main/resources/application.properties:
spring.ai.mcp.server.name=druid-mcp-server
spring.ai.mcp.server.version=1.0.0
# Druid configuration
druid.router.url=http://localhost:8888
# Server configuration
server.port=8080
# NOTE: Banner and console logging must be disabled for STDIO transport
spring.main.banner-mode=off
Environment Variables Configuration
For sensitive credentials like username and password, you can use environment variables instead of hardcoding them in properties files.
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## STDIO Transport (Recommended for LLM clients)
Complete Docker Compose configuration for running a full Apache Druid cluster locally. Perfect for development, testing, and learning about Druid cluster architecture.
Features:
Full Druid cluster with all components (Coordinator, Broker, Historical, MiddleManager, Router)
PostgreSQL metadata storage and ZooKeeper coordination
Pre-configured with sample data and ingestion examples
Configuration examples for running the Druid MCP Server using Docker with STDIO transport mode. This approach combines the convenience of Docker deployment with STDIO transport for LLM client integration.
Features:
Docker-based MCP configuration files for development and production
No Java installation required on client machines
Docker Compose setup for simplified deployment
Environment variable configuration for Druid connections
Authentication and SSL support via Docker environment variables
Configuration examples for SSE (Server-Sent Events) transport mode, providing HTTP-based communication suitable for web applications and REST API integrations.
Features:
HTTP-based MCP server configuration
Custom port and production deployment examples
Web client integration patterns
Comparison with STDIO transport mode
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
Readonly Mode: Implement a Readonly Mode (R) for Druid and disallow the Create, Update, Delete on all tools.
Authentication on SSE Mode: Introduce Oauth Authentication
Druid Auto Compaction: Intelligent automatic compaction configuration
MCP Auto Completion: Enhanced autocomplete functionality with sampling
Proper Observability: Comprehensive metrics and tracing
Enhanced Monitoring: Advanced cluster monitoring and alerting capabilities
Advanced Analytics: Machine learning-powered insights and recommendations
Security Enhancements: Advanced authentication and authorization features
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.
For more information about our services and solutions, visit www.iunera.com.