The Apache Doris MCP Server provides a Model Context Protocol interface for Apache Doris, enabling seamless integration with compatible AI assistants and tools. It allows you to query your Doris database directly through natural language.
To use the MCP server for Apache Doris, you'll need to set up the environment with the required dependencies.
Cursor is a code editor that can directly integrate with the MCP server. To set up:
Name: doris
Type: command
Command: DORIS_HOST=<doris-host> DORIS_PORT=<port> DORIS_USER=<doris-user> DORIS_PASSWORD=<doris-pwd> uv run --with mcp-doris --python 3.13 mcp-doris
Replace the placeholder values with your actual Doris database credentials:
<doris-host>
: Your Doris server hostname<port>
: The port number for your Doris server<doris-user>
: Your Doris username<doris-pwd>
: Your Doris passwordIf you want to run the MCP server directly:
uv install mcp-doris
export DORIS_HOST=<doris-host>
export DORIS_PORT=<port>
export DORIS_USER=<doris-user>
export DORIS_PASSWORD=<doris-pwd>
python -m mcp_doris.mcp_server
Once your server is running, you can verify it's working by connecting to it with any MCP-compatible client. The server provides:
After connecting to the MCP server, you can use natural language to query your Doris database:
Show me the top 10 sales records from the sales_table
The MCP server will translate this to SQL and execute it against your Doris instance.
You can also ask about the database structure:
What tables are available in the database?
What columns does the customer_table have?
The server will provide structured information about your database schema.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.