Doris-MCP-Lite
About
A lightweight MCP server for connecting to Apache Doris and other MySQL-compatible databases, providing tools and prompts for LLM applications.
Details
- Author
- nomotok
- Categories
- Database, AI
Jump to
Option 3 Clone The Source And Install Manually
Recommended if you want to modify the server
git clone https://github.com/YOUR_USERNAME/doris-mcp-lite.git cd doris-mcp-lite
- Set up a local Python environment using](https://github.com/NomotoK/doris-mcp-lite/blob/HEAD/setup.sh)uv:
uv venv # Create a virtual environment uv sync # Install dependencies # Activate the virtual environment source .venv/bin/activate # On Windows: .venv\Scripts\activate uv pip install
- Add this server to your LLM client or Run the server:
uv run server doris://user:pass@localhost:9030/mydb
uv pip install 'git+https://github.com/NomotoK/doris-mcp-lite.git' uv sync source .venv/bin/activate # On Windows: .venv\Scripts\activate uv pip install -e . uv run server doris://user:pass@localhost:9030/mydb
Use the .env file to permanently save your database connection information in the MCP server, so you do not need to enter the database connection every time you run the MCP server with CLI. Of course,this step is not necessary, if you are using a MCP-capatible LLM client, you can alsoset up a database connection in the configuration fileof the MCP client later (See step2). Please follow these steps to finish configuration:
This is the most recommended and easiest way to setup. Please refer toDoris MCP install guide.
After installing, navigate to thedoris_mcp_lite/config/directory inside your project directory. If you are using pip, your package will be installed in Python site-packages:
-
Mac/Linux:/Users/YOUR_USERNAME/.local/lib/python3.x/site-packages/doris_mcp_lite/config/
Windows:C:\Users\YOUR_USERNAME\AppData\Local\Programs\Python\Python3x\Lib\site-packages\doris_mcp_lite\config\
You can run the following command to locate pip install location:
- Edit .env to set yourDorisdatabase connection information:
DB_HOST=your-doris-host DB_PORT=9030 DB_USER=your-username DB_PASSWORD=your-password DB_NAME=your-database MCP_SERVER_NAME=DorisAnalytics DEBUG=false
[!NOTE] If.envis missing, the server will attempt to auto-create it from.env.examplebut you must manually fill in correct credentials.
To connect this server to an MCP-compatible client (e.g., Claude Desktop, CherryStudio, Cline), you need to modify your MCP client configuration JSON.
- name: doris-mcp-lite
- type: stdio
- command: absolute/path/to/your/uv
- arguments:
--directory /Users/hailin/dev/Doris-MCP-Lite run server doris://user:pass@localhost:9030/mydb
Example if you are installing with pip (mcp_setting.json):
{ "mcpServers": { "DorisAnalytics": { "command": "server", "args": ["doris://user:pass@localhost:9030/mydb"], "transportType": "stdio" } } }
If you are installing with source code/uv or usingsetup.sh:
{ "mcpServers": { "DorisAnalytics": { "disabled": false, "timeout": 60, "command": "absolute/path/to/uv", "args": [ "--directory", "absolute/path/to/mcp/server", "run", "server" "doris://user:pass@localhost:9030/mydb" ], "transportType": "stdio" } } }
Note that you can useuvandserverinstead of passing absolute path in config file, but you need to make sure thatuvis in yourPATH.
Remember to replacedoris://user:pass@localhost:9030/mydbwith your actual database connection string.
For more information on how to configure your client, please refer to :
[For Server Developers - Model Context Protocol - Claude
✅ Now your LLM client will discover Doris Analytics tools, prompts, and resources through the MCP server.
Before you start, you can run thetest.pyin the projectsrc/doris-mcp-litedirectory to directly call the MCP Server functional interface to test database connection, resources, tools, etc. without using LLM (such as Claude, GPT, etc. models). You can control what functions to test by passing arguments through the command line.
Test all resources exposed by the server:
python test.py --server server.py --test resources
or test all the tools provided by the server:
python test.py --server server.py --test tools
python test.py --server "doris://user:pass@localhost:9030/mydb" --test dbconfig
or test all functions of resources, tools, and prompt words at one time:
python test.py --server server.py --test all
A lightweightMCP serverdesigned for connecting toApache Dorisor otherMySQL compatibledatabase 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 anissue. The official Apache Doris MCP server is available atapache/doris-mcp-server
- Executeread-only SQL queriesagainst your Doris database.
- Performdata analysis operationssuch as retrieving yearly, monthly, and daily usage data.
- Query metadata such asdatabase schemas,table structures, andresource usage.
- Connection Pooling: Efficientconnection management with poolingto optimize performance.
- Asynchronous Execution: Support forasynchronous queryexecution to improve responsiveness.
- Built-in prompt templates to assist LLMs in askinganalytics questions.
- Support formulti-role promptingto enhance the interaction between LLMs and the Doris database.
- Support foruser-definedandgeneral-purposeSQL analysis prompts.
- Expose your Dorisdatabase schemaasstructured resources.
- Allow LLMs tocontextually accesstable and field definitions to improve query understanding.
We recommend usinguvto manage your Python environment.
Recommended for personal and server deployment
This is the easiest way to install. Please copy thesetup.shfile in project and run it locally. For more information please refer:Doris MCP install guide
- Copy thesetup.shto local.
- Make the script executable:
The script will automatically install the server and help you walk through database configuration.
✅ After installation, the command-line tool server will be available to launch the MCP server.
Option 3: Clone the source and install manually
Recommended if you want to modify the server
git clone https://github.com/YOUR_USERNAME/doris-mcp-lite.git cd doris-mcp-lite
- Set up a local Python environment usinguv:
uv venv # Create a virtual environment uv sync # Install dependencies # Activate the virtual environment source .venv/bin/activate # On Windows: .venv\Scripts\activate uv pip install
- Add this server to your LLM client or Run the server:
uv run server doris://user:pass@localhost:9030/mydb
uv pip install 'git+https://github.com/NomotoK/doris-mcp-lite.git' uv sync source .venv/bin/activate # On Windows: .venv\Scripts\activate uv pip install -e . uv run server doris://user:pass@localhost:9030/mydb
Use the .env file to permanently save your database connection information in the MCP server, so you do not need to enter the database connection every time you run the MCP server with CLI. Of course,this step is not necessary, if you are using a MCP-capatible LLM client, you can alsoset up a database connection in the configuration fileof the MCP client later (See step2). Please follow these steps to finish configuration:
This is the most recommended and easiest way to setup. Please refer toDoris MCP install guide.
After installing, navigate to thedoris_mcp_lite/config/directory inside your project directory. If you are using pip, your package will be installed in Python site-packages:
-
Mac/Linux:/Users/YOUR_USERNAME/.local/lib/python3.x/site-packages/doris_mcp_lite/config/
Windows:C:\Users\YOUR_USERNAME\AppData\Local\Programs\Python\Python3x\Lib\site-packages\doris_mcp_lite\config\
You can run the following command to locate pip install location:
- Edit .env to set yourDorisdatabase connection information:
DB_HOST=your-doris-host DB_PORT=9030 DB_USER=your-username DB_PASSWORD=your-password DB_NAME=your-database MCP_SERVER_NAME=DorisAnalytics DEBUG=false
[!NOTE] If.envis missing, the server will attempt to auto-create it from.env.examplebut you must manually fill in correct credentials.
To connect this server to an MCP-compatible client (e.g., Claude Desktop, CherryStudio, Cline), you need to modify your MCP client configuration JSON.
- name: doris-mcp-lite
- type: stdio
- command: absolute/path/to/your/uv
- arguments:
--directory /Users/hailin/dev/Doris-MCP-Lite run server doris://user:pass@localhost:9030/mydb
Example if you are installing with pip (mcp_setting.json):
{ "mcpServers": { "DorisAnalytics": { "command": "server", "args": ["doris://user:pass@localhost:9030/mydb"], "transportType": "stdio" } } }
If you are installing with source code/uv or usingsetup.sh:
{ "mcpServers": { "DorisAnalytics": { "disabled": false, "timeout": 60, "command": "absolute/path/to/uv", "args": [ "--directory", "absolute/path/to/mcp/server", "run", "server" "doris://user:pass@localhost:9030/mydb" ], "transportType": "stdio" } } }
Note that you can useuvandserverinstead of passing absolute path in config file, but you need to make sure thatuvis in yourPATH.
Remember to replacedoris://user:pass@localhost:9030/mydbwith your actual database connection string.
For more information on how to configure your client, please refer to :
For Server Developers - Model Context Protocol - Claude
✅ Now your LLM client will discover Doris Analytics tools, prompts, and resources through the MCP server.
Before you start, you can run thetest.pyin the projectsrc/doris-mcp-litedirectory to directly call the MCP Server functional interface to test database connection, resources, tools, etc. without using LLM (such as Claude, GPT, etc. models). You can control what functions to test by passing arguments through the command line.
Test all resources exposed by the server:
python test.py --server server.py --test resources
or test all the tools provided by the server:
python test.py --server server.py --test tools
python test.py --server "doris://user:pass@localhost:9030/mydb" --test dbconfig
or test all functions of resources, tools, and prompt words at one time:
python test.py --server server.py --test all
Testing Database connection and run server
Launch the MCP server by running the command:
server doris://user:pass@localhost:9030/mydb
python -m doris_mcp_lite.server doris://user:pass@localhost:9030/mydb
The server immediately attempts to connect to the database. If the connection is successful, after startup, you should see:
🚀 Doris MCP Server is starting... [DorisConnector] Connected to 127.0.0.1:9030 ✅ Database connection successful. [DorisConnector] Connection closed.
You can now use the tools and prompts inside your MCP client.
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
This project is licensed under theMIT License.
- Built using theMCP 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 are welcome! Feel free to open issues or submit pull requests.
Hydrolix time-series datalake integration providing schema exploration and query capabilities to LLM-based workflows.
614 million contacts, live SMTP-verified. Invalid emails cost you $0. Connect Argorant with any Agent through CLI, MCP or API and build verified lists in Claude, GPT or Hermes.
Chinese writing toolbox for Claude Code: text analysis, outline generation, GB/T 7714 references,character frequency
C# SQL Agent MCP server featuring raw SQL input, strict AST validation, and an embedded Admin UI. Eliminates LLM hallucinations and security risks across 6 major databases.
Build and access a personal LLM knowledge base from your editor or client without any infrastructure setup.
Mantora is a local-first MCP observer: a lightweight UI + proxy for inspecting LLM data access (sessions, tool calls, results) with protective defaults.
Biologically-inspired memory for Claude. Hebbian plasticity, dream cycles, and temporal decay for persistent knowledge synthesis.
Access the Quran API from alquran.cloud to retrieve accurate Quranic text and reduce LLM hallucinations.
An MCP server for local Tabular Models like PowerBI. It allows LLM clients to debug, analyze, and compose DAX queries by connecting to a local Tabular model instance.
Interact with Verodat AI Ready Data platform
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



