Labsco
NomotoK logo

Doris-MCP-Lite

β˜… 1

from NomotoK

A lightweight MCP server for connecting to Apache Doris and other MySQL-compatible databases, providing tools and prompts for LLM applications.

πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

πŸ“– Doris-MCP-Lite

A lightweight MCP server designed for connecting to Apache Doris or other MySQL compatible database schemas, providing tools and prompts for LLM applications.

This server enables LLMs and MCP clients to explore database schemas, run read-only SQL queries, and leverage pre-built analytical prompts β€” all through a standardized, secure MCP interface.

[!WARNING] This is an early developer version of doris-mcp-lite. Some functions may not operate properly and minor bugs may exist. If you have any quesions, please open an issue. The official Apache Doris MCP server is available at apache/doris-mcp-server

πŸš€ Features

πŸ› οΈ Tools

  • Execute read-only SQL queries against your Doris database.
  • Perform data analysis operations such as retrieving yearly, monthly, and daily usage data.
  • Query metadata such as database schemas, table structures, and resource usage.
  • Connection Pooling: Efficient connection management with pooling to optimize performance.
  • Asynchronous Execution: Support for asynchronous query execution to improve responsiveness.

🧠 Prompts

  • Built-in prompt templates to assist LLMs in asking analytics questions.
  • Support for multi-role prompting to enhance the interaction between LLMs and the Doris database.
  • Support for user-defined and general-purpose SQL analysis prompts.

πŸ—‚οΈ Resources

  • Expose your Doris database schema as structured resources.
  • Allow LLMs to contextually access table and field definitions to improve query understanding.

πŸ“š Project Structure Overview

src/
└── doris_mcp_lite/
	β”œβ”€β”€ config/             # Configuration files
	β”‚   β”œβ”€β”€ __init__.py
	β”‚   β”œβ”€β”€ config.py       # Loads environment variables
	β”‚   β”œβ”€β”€ .env.example    # Environment variables template
	β”‚   └── .env            # Stores your database credentials
	β”‚
	β”œβ”€β”€ db/                 # Database interaction logic
	β”‚   β”œβ”€β”€ __init__.py
	β”‚   β”œβ”€β”€ db.py           # Doris database connection class
	β”‚   └── tools.py        # SQL query execution tools
	β”‚
	β”œβ”€β”€ res/                # Resource definitions (e.g., schemas)
	β”‚   β”œβ”€β”€ __init__.py
	β”‚   └── resources.py
	β”‚
	β”œβ”€β”€ prompts/            # Prebuilt prompt templates
	β”‚   β”œβ”€β”€ __init__.py
	β”‚   β”œβ”€β”€ general_prompts.py
	β”‚   └── customize_prompts.py
	β”‚
	β”œβ”€β”€ __init__.py         # Main entry point to start the MCP server
	β”œβ”€β”€ server.py           # Server launcher
	β”œβ”€β”€ mcp_app.py          # MCP server instance
	└── test.py             # Unit test script
README.md                   # Documentation
INSTALL.md                  # Installation guide
LISENCE                     # Lisence
setup.sh                    # Auto setup wizard
pyproject.toml              # Project build configuration
.gitignore                  # Git ignore settings

πŸ“œ License

This project is licensed under the MIT License.

🌟Acknowledgements

  • Built using the MCP Python SDK.
  • Based on: MCP: The Model Context Protocol, a standard for LLMs to interact with external data sources.
  • Apache Doris: An open-source, high-performance, real-time analytical database.
  • Apache Doris Official MCP Server: The official MCP server for Apache Doris.
  • PyMySQL: A Python MySQL client library for database interaction.
  • Inspired by MCP official examples and best practices.

🀝 Contributions

Contributions are welcome! Feel free to open issues or submit pull requests.