Doris MCP Server
OfficialThe Doris MCP Server enables interaction with Apache Doris databases through a set of predefined tools:
Execute SQL Queries: Run SQL commands with customizable options for database selection, row limits, and timeouts
Retrieve Database Metadata: Get lists of databases, tables, and detailed table structures
Access Table Information: Fetch table and column comments, plus index details
Query Audit Logs: Retrieve recent audit records with configurable time frames and record limits
Flexible Communication: Supports multiple communication modes, including Server-Sent Events (SSE) and Streamable HTTP
Customizable Configuration: Configure database connections and server behavior via environment variables
Provides tools for interacting with Apache Doris databases, enabling database metadata retrieval, SQL query execution, schema exploration, and audit log retrieval through a standardized Model Control Panel interface.
Uses .ENV files for flexible configuration of database connections, server settings, logging preferences, and other environment variables.
Implemented using FastAPI to provide both SSE and HTTP streaming endpoints for clients to interact with the MCP protocol, supporting tool calls and prompt interactions.
Built with Python (3.12+) as the underlying language, providing the runtime environment for the MCP server implementation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Doris MCP Server show me the top 10 customers by revenue this month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Apache Doris MCP Server
Apache Doris MCP Server exposes read-only Apache Doris capabilities to MCP
Hosts and AI agents over MCP 2026-07-28. Version 1.0 replaces a large flat
tool surface with eight stable domains and fifty-five progressively disclosed
child capabilities, while keeping runtime availability, authorization, input
schemas, output schemas, and failure behavior explicit.
Release status
The package version is 1.0.0. MCP 2026-07-28 protocol compatibility on
master is Generally Available (GA) on Streamable HTTP and stdio.
This GA statement is scoped to protocol compatibility; the Python package
classifier remains Beta, and the documented deployment limits still apply.
Before upgrading, read the 1.0 release notes, the 1.0 migration guide, and the generated 8-domain/55-child registry. The detailed release record is Issue #189.
Related MCP server: StarRocks MCP Server
Architecture at a glance
MCP Host
-> stdio or Streamable HTTP
-> transport security and authentication
-> MCP protocol validation and authorization
-> stable domain discovery
-> route-aware Doris capability detection
-> exact child dispatch and read-only runtime
-> request-specific Doris route and RBAC
-> bounded, schema-validated resultThe default hierarchical mode exposes these domains:
Domain | Children | Responsibility |
| 5 | catalogs, databases, tables, table context, size |
| 7 | query, explain, profile, diagnosis, slow queries, explicit ADBC |
| 11 | nodes, tasks, metrics, memory, cache, compaction, workloads |
| 5 | ingestion, materialized views, freshness, dependencies |
| 4 | text/vector/hybrid search, analyzers, indexes, diagnosis |
| 8 | quality, storage, lineage, audit, UDFs, auth mapping |
| 3 | external catalogs, lakehouse tables, Variant |
| 12 | optional Apache Ossie grounding and MetricFlow consumption |
Call a domain with {} to discover its authorized children and exact schemas.
Call the same domain again with child_tool, arguments, and the returned
manifest_version. Hosts that cannot use progressive disclosure may set
MCP_TOOL_EXPOSURE_MODE=flat before startup; this exposes the same 55 children
under collision-free formal names and does not restore pre-1.0 aliases.
See Architecture, Request lifecycle, and Tool domains.
Quick start
Requirements:
Python 3.12 or later;
Apache Doris 2.0.0 or later;
network access to the Doris FE MySQL endpoint, normally port
9030.
Install the pinned release:
pip install doris-mcp-server==1.0.0doris-mcp-server starts the Server. doris-mcp-client is a separate client;
the two commands are not interchangeable.
Configure a Doris route:
export DORIS_HOST=127.0.0.1
export DORIS_PORT=9030
export DORIS_USER=mcp_reader
export DORIS_PASSWORD='replace-me'
export DORIS_DATABASE=information_schemaStart Streamable HTTP on loopback:
doris-mcp-server \
--transport http \
--host 127.0.0.1 \
--port 3000Endpoints:
MCP:
POST http://127.0.0.1:3000/mcplegacy MCP (opt-in):
POST http://127.0.0.1:3000/mcp/legacyliveness:
GET http://127.0.0.1:3000/liveDoris-backed readiness:
GET http://127.0.0.1:3000/ready
Hosts limited to handshake-era Streamable HTTP, including Dify 1.16.1 with
MCP 2025-06-18, must set ENABLE_LEGACY_HTTP_ADAPTER=true and connect to
/mcp/legacy. The adapter changes only the protocol boundary; it preserves the
same 1.0 tools, authorization, capability gates, and read-only execution.
Or run stdio for a local Host:
doris-mcp-server --transport stdioSee the complete Quick start and Host integration guide.
Security boundary
The built-in 1.0 catalog is read-only;
doris_adminis reserved and not registered.Static tokens, JWT, external OAuth/OIDC, and Doris-backed OAuth are supported under mutually validated configuration boundaries.
Domain discovery and child execution use exact authorization identifiers.
Doris RBAC remains the final authority for visible objects and data.
SQL shape, identifiers, parameters, timeout, rows, bytes, and result schemas are bounded before data leaves the Server.
Secrets and backend errors are redacted from public results and logs.
Non-loopback HTTP requires authentication unless an explicit dangerous development override is enabled.
Read the Security and permission model and the Doris fine-grained access guide.
Reliability boundary
The Server uses deterministic manifests and errors, signed expiring cursors,
route-aware capability snapshots, bounded stale fallback, request-specific
connection routing, multi-FE failover, liveness/readiness separation, output
Schema validation, and sanitized trace propagation. Unsupported or
misconfigured capabilities remain discoverable with callable=false and fail
closed when called.
Current limits include process-local Doris-backed OAuth, explicit-only ADBC that is disabled by default and fail-closed on token-bound routes, optional read-only Ossie grounding, an optional MetricFlow compiler sidecar whose SQL must execute through the bounded MCP query runtime, and best-effort native lineage delivery. See Reliability and limits.
Documentation
The root README is intentionally an entry point. The bilingual documentation system is indexed at:
Primary guides:
Development
git clone https://github.com/apache/doris-mcp-server.git
cd doris-mcp-server
uv sync --group dev
uv run pytestGenerated artifacts must remain synchronized:
uv run python generate_tool_catalog.py --check
uv lock --checkSee Contributing and verification.
License
Apache License 2.0. See LICENSE.txt and NOTICE.
Available Tools
8 toolsexec_queryB
[Function Description]: Execute SQL query and return result command (executed by the client).
[Parameter Content]:
sql (string) [Required] - SQL statement to execute
db_name (string) [Optional] - Target database name, defaults to the current database
max_rows (integer) [Optional] - Maximum number of rows to return, default 100
timeout (integer) [Optional] - Query timeout in seconds, default 30
Inputs: sql (required), db_name, max_rows, timeout.
get_db_listC
[Function Description]: Get a list of all database names on the server.
[Parameter Content]:
random_string (string) [Required] - Unique identifier for the tool call
Inputs: no named parameters.
get_db_table_listB
[Function Description]: Get a list of all table names in the specified database.
[Parameter Content]:
db_name (string) [Optional] - Target database name, defaults to the current database
Inputs: db_name.
get_recent_audit_logsC
[Function Description]: Get audit log records for a recent period.
[Parameter Content]:
days (integer) [Optional] - Number of recent days of logs to retrieve, default is 7
limit (integer) [Optional] - Maximum number of records to return, default is 100
Inputs: days, limit.
get_table_column_commentsC
[Function Description]: Get comment information for all columns in the specified table.
[Parameter Content]:
table_name (string) [Required] - Name of the table to query
db_name (string) [Optional] - Target database name, defaults to the current database
Inputs: table_name (required), db_name.
get_table_commentC
[Function Description]: Get the comment information for the specified table.
[Parameter Content]:
table_name (string) [Required] - Name of the table to query
db_name (string) [Optional] - Target database name, defaults to the current database
Inputs: table_name (required), db_name.
get_table_indexesB
[Function Description]: Get index information for the specified table. [Parameter Content]:
table_name (string) [Required] - Name of the table to query
db_name (string) [Optional] - Target database name, defaults to the current database
Inputs: table_name (required), db_name.
get_table_schemaB
[Function Description]: Get detailed structure information of the specified table (columns, types, comments, etc.).
[Parameter Content]:
table_name (string) [Required] - Name of the table to query
db_name (string) [Optional] - Target database name, defaults to the current database
Inputs: table_name (required), db_name.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose with no ambiguity. exec_query handles SQL execution, get_db_list retrieves database names, get_db_table_list lists tables, get_recent_audit_logs fetches logs, and the remaining tools (get_table_column_comments, get_table_comment, get_table_indexes, get_table_schema) each target specific table metadata aspects without overlap.
All tools follow a consistent verb_noun pattern using snake_case. The naming is highly predictable: exec_query, get_db_list, get_db_table_list, get_recent_audit_logs, get_table_column_comments, get_table_comment, get_table_indexes, and get_table_schema all adhere to the same convention.
With 8 tools, this server is well-scoped for database interaction and metadata exploration. Each tool earns its place by covering distinct aspects like query execution, database/table listing, audit logs, and detailed table metadata, without being overly sparse or bloated.
The toolset provides strong coverage for querying and inspecting databases, including CRUD-like operations via exec_query and comprehensive metadata retrieval. Minor gaps exist, such as no explicit tools for creating/dropping databases or tables, but agents can work around this using exec_query for such operations.
Maintenance
Related MCP Connectors
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
MCP server for AI dialogue using various LLM models via AceDataCloud
A full backend your AI coding agent can set up over MCP
The BigQuery remote MCP server is a fully managed service that uses the Model Context Protocol to connect AI applications and LLMs to BigQuery data sources. It provides secure, standardized tools for AI agents to list datasets and tables, retrieve schemas, generate and execute SQL queries through natural language, and analyze data—enabling direct access to enterprise analytics data without requiring manual SQL coding.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceThis MCP server provides connection to Starrocks allows you to explore this query engine with minimum effort.1MIT
- FlicenseNot gradedqualityNot gradedmaintenanceA TypeScript implementation of a Model Context Protocol server that enables interaction with StarRocks databases, supporting SQL operations like queries, table creation, and data manipulation through standardized MCP tools.1-
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to explore database schemas, execute read-only SQL queries, and perform data analysis on Apache Doris or MySQL-compatible databases through a standardized MCP interface with built-in analytical prompts.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language querying of Apache Doris databases via LLM-powered SQL generation, execution, and metadata management through the MCP protocol.9Apache 2.0