doris-mcp-server

doris-mcp-server

9

Doris MCP Server is a powerful backend service that connects with Apache Doris databases, transforming natural language queries to SQL via LLM integration. It supports flexible interaction modes and facilitates metadata management and analysis, making it a robust tool for business intelligence applications.

Doris MCP Server

Doris MCP Server is a backend service built with Python and FastAPI, implementing the Model Control Panel (MCP) protocol. It primarily connects with the Apache Doris database to transform natural language queries into SQL using a large language model (LLM), execute queries, and conduct metadata management and analysis.

Core Features

  • MCP Protocol Implementation: Offers a standardized MCP interface supporting tool calls, resource management, and prompt interaction.
  • Multiple Communication Modes: Supports SSE (Server-Sent Events), Streamable HTTP, and optionally Stdio for interaction.
  • Tool Interface: Encapsulates core functionalities as MCP tools that clients can invoke as needed, such as NL2SQL, SQL execution, metadata management, and document Q&A.
  • LLM Integration: Uses a large language model for natural language understanding, SQL generation, interpretation, and analysis.
  • Database Interaction: Capable of connecting to Apache Doris or other compatible databases to execute queries.
  • Flexible Configuration: Supports configuration via an .env file for database connections, LLM providers, API keys, and more.

System Requirements

  • Python 3.9+
  • Database connection details (Doris Host, Port, User, Password, Database)
  • LLM service configuration (Provider, Model, API Key/Endpoint)

Quick Start

  1. Clone the repository.
  2. Install dependencies.
  3. Configure environment variables.

Available MCP Tools

Offers various tools such as refresh_metadata, sql_optimize, fix_sql, health check, exec_query, generate_sql, etc.

Usage

Interact with the Doris MCP Server using an MCP client that connects to the server's endpoints and sends requests as per the MCP protocol.

Contributing

Contributions via Issues or Pull Requests are welcome.

License

This project is licensed under the MIT License.