By apacheCreated 16 days ago
starstarstarstarstar

MCP Server for Apache Doris, an MPP-based real-time data warehouse.

Visit Project
Share this MCP:
X (Formerly Twitter)RedditblueskyThreads by Instagram

Category

Official MCP Server

Tags

Data WarehouseApache DorisMppSql ExecutorDatabase Tool

What is Doris MCP Server?

Doris MCP Server is a backend service for Apache Doris, an MPP-based real-time data warehouse. It implements the MCP (Model Context Protocol) allowing clients to interact with Apache Doris databases, with potential integration with Large Language Models (LLMs) for tasks like converting natural language queries to SQL (NL2SQL), executing queries, and performing metadata management and analysis.

How to use Doris MCP Server?

  1. Installation from PyPI:
    pip install mcp-doris-server
    
  2. Start Streamable HTTP Mode (Web Service):

doris-mcp-server
--transport http
--host 0.0.0.0
--port 3000
--db-host 127.0.0.1
--db-port 9030
--db-user root
--db-password your_password ``` 3. Configure Environment Variables: Set database connection details and security options in the .env file. 4. Connect with MCP Client: Use an MCP client to interact with the server's Streamable HTTP endpoint.

Key Features of Doris MCP Server

  • MCP Protocol Implementation: Standard MCP interfaces supporting tool calls, resource management, and prompt interactions.
  • Streamable HTTP Communication: Unified HTTP endpoint supporting request/response and streaming.
  • Stdio Communication: Standard input/output mode for direct integration with MCP clients like Cursor.
  • Enterprise-Grade Architecture: Modular design with comprehensive functionality, including:
    • Tools Manager: Centralized tool registration and routing
    • Enhanced Monitoring Tools Module: Advanced memory tracking and metrics collection
    • Query Execution: High-performance SQL execution with advanced caching
    • Security Management: Comprehensive SQL security validation and data masking
    • Metadata Extraction: Comprehensive database metadata with catalog federation support
  • Catalog Federation Support: Full support for multi-catalog environments (internal Doris tables and external data sources like Hive, MySQL, etc.).
  • Enterprise Security: Authentication, authorization, SQL injection protection, and data masking capabilities.
  • Unified Configuration Framework: Centralized configuration management through config.py with comprehensive validation and smart defaults.

Use Cases of Doris MCP Server

  1. Data Analysis and Query Execution: Execute SQL queries and analyze results using MCP tools like exec_query and integrated query analysis tools.
  2. Metadata Management: Access and manage database metadata with tools like get_table_schema, get_db_table_list, and get_table_column_comments.
  3. Performance Monitoring: Monitor query performance and database metrics with get_sql_explain, get_sql_profile, and monitoring tools.
  4. Security Management: Implement enterprise-level security with SQL validation, data masking, and authentication/authorization features.
  5. Integration with Large Language Models (LLMs): Convert natural language queries to SQL, execute them, and process results for LLM-based applications.

FAQ from Doris MCP Server

  • Q: Why do Qwen3-32b and other small parameter models always fail when calling tools?

This is due to insufficient guidance for using MCP tools. Add explicit instruction prompts for the model to improve tool usage.

  • Q: How to configure different database connections?

Use environment variables, command line arguments, or the configuration file to set database connection details.

  • Q: How to use SQL Explain/Profile files with LLM for optimization?

The tools provide truncated content for immediate review and full file paths for comprehensive analysis with LLMs.

  • Q: How to enable data security and masking features?

Set environment variables ENABLE_MASKING=true, configure authentication with AUTH_TYPE and TOKEN_SECRET, and set MAX_RESULT_ROWS for data protection.

  • Q: What's the difference between Stdio mode and HTTP mode?

Stdio mode is suitable for direct integration with MCP clients (like Cursor), where the client manages the server process. HTTP mode is an independent web service supporting multiple client connections, suitable for production environments.