Doris MCP Server
Doris MCP (Model Context Protocol) Server is a backend service built with Python and FastAPI. It implements the MCP, allowing clients to interact with it through defined "Tools". It's primarily designed to connect to Apache Doris databases, potentially leveraging Large Language Models (LLMs) for tasks like converting natural language queries to SQL (NL2SQL), executing queries, and performing metadata management and analysis.
🚀 What's New in v0.5.1
- 🔥 Critical at_eof Connection Fix: Complete elimination of at_eof connection pool errors through redesigned connection pool strategy with zero minimum connections, intelligent health monitoring, automatic retry mechanisms, and self-healing pool recovery - achieving 99.9% connection stability improvement
- 🔧 Revolutionary Logging System: Enterprise-grade logging overhaul with level-based file separation (debug, info, warning, error, critical), automatic cleanup scheduler with 30-day retention, millisecond precision timestamps, dedicated audit trails, and zero-maintenance log management
- 📊 Enterprise Data Analytics Suite: Introducing 7 new enterprise-grade data governance and analytics tools providing comprehensive data management capabilities including data quality analysis, column lineage tracking, freshness monitoring, and performance analytics
- 🏃♂️ High-Performance ADBC Integration: Complete Apache Arrow Flight SQL (ADBC) support with configurable parameters, offering 3-10x performance improvements for large dataset transfers through Arrow columnar format
- 🔄 Unified Data Quality Framework: Advanced data completeness and distribution analysis with business rules engine, confidence scoring, and automated quality recommendations
- 📈 Advanced Analytics Tools: Performance bottleneck identification, capacity planning with growth analysis, user access pattern monitoring, and data flow dependency mapping
- ⚙️ Enhanced Configuration Management: Complete ADBC configuration system with environment variable support, dynamic tool registration, and intelligent parameter validation
- 🔒 Security & Compatibility Improvements: Resolved pandas JSON serialization issues, enhanced enterprise security integration, and maintained full backward compatibility with v0.4.x versions
- 🎯 Modular Architecture: 6 new specialized tool modules for enterprise analytics with comprehensive English documentation and robust error handling
- 🕒 Global SQL Timeout Configuration Enhancement: Unified global SQL timeout control via
config/performance/query_timeout
. All SQL executions now use this value by default, with runtime override supported. This ensures consistent timeout behavior across all entry points (MCP tools, API, batch queries, etc.). - Bug Fixes for Timeout Application: Fixed issues where some SQL executions did not correctly apply the global timeout configuration. Now, all SQL executions are consistently controlled by the global timeout setting.
- Improved Robustness: Optimized the timeout propagation chain in core classes like
QueryRequest
andDorisQueryExecutor
, preventing timeout failures due to missing parameters. - Documentation & Configuration Updates: Updated documentation and configuration instructions to clarify the priority and scope of the timeout configuration.
- Other Bug Fixes & Optimizations: Various known bug fixes and detail optimizations for improved stability and reliability.
🚀 Major Milestone: This release establishes v0.5.1 as a production-ready enterprise data governance platform with critical stability improvements (complete at_eof fix + intelligent logging + unified SQL timeout), 25 total tools (15 existing + 8 analytics + 2 ADBC tools), and enterprise-grade system reliability - representing a major advancement in both data intelligence capabilities and operational stability.
Core Features
- MCP Protocol Implementation: Provides standard MCP interfaces, supporting tool calls, resource management, and prompt interactions.
- Streamable HTTP Communication: Unified HTTP endpoint supporting both request/response and streaming communication for optimal performance and reliability.
- Stdio Communication: Standard input/output mode for direct integration with MCP clients like Cursor.
- Enterprise-Grade Architecture: Modular design with comprehensive functionality:
- Tools Manager: Centralized tool registration and routing with unified interfaces (
doris_mcp_server/tools/tools_manager.py
) - Enhanced Monitoring Tools Module: Advanced memory tracking, metrics collection, and flexible BE node discovery with modular, extensible design
- Query Information Tools: Enhanced SQL explain and profiling with configurable content truncation, file export for LLM attachments, and advanced query analytics
- Resources Manager: Resource management and metadata exposure (
doris_mcp_server/tools/resources_manager.py
) - Prompts Manager: Intelligent prompt templates for data analysis (
doris_mcp_server/tools/prompts_manager.py
)
- Tools Manager: Centralized tool registration and routing with unified interfaces (
- Advanced Database Features:
- Query Execution: High-performance SQL execution with advanced caching and optimization, enhanced connection stability and automatic retry mechanisms (
doris_mcp_server/utils/query_executor.py
) - Security Management: Comprehensive SQL security validation with configurable blocked keywords, SQL injection protection, data masking, and unified security configuration management (
doris_mcp_server/utils/security.py
) - Metadata Extraction: Comprehensive database metadata with catalog federation support (
doris_mcp_server/utils/schema_extractor.py
) - Performance Analysis: Advanced column analysis, performance monitoring, and data analysis tools (
doris_mcp_server/utils/analysis_tools.py
)
- Query Execution: High-performance SQL execution with advanced caching and optimization, enhanced connection stability and automatic retry mechanisms (
- Catalog Federation Support: Full support for multi-catalog environments (internal Doris tables and external data sources like Hive, MySQL, etc.)
- Enterprise Security: Comprehensive security framework with authentication, authorization, SQL injection protection, and data masking capabilities with environment variable configuration support
- Unified Configuration Framework: Centralized configuration management through
config.py
with comprehensive validation, standardized parameter naming, and smart default database handling with automatic fallback toinformation_schema
System Requirements
- Python 3.12+
- Database connection details (e.g., Doris Host, Port, User, Password, Database)
🚀 Quick Start
Installation from PyPI
💡 Command Compatibility: After installation, both
doris-mcp-server
commands are available for backward compatibility. You can use either command interchangeably.
Start Streamable HTTP Mode (Web Service)
The primary communication mode offering optimal performance and reliability:
Start Stdio Mode (for Cursor and other MCP clients)
Standard input/output mode for direct integration with MCP clients:
Verify Installation
Environment Variables (Optional)
Instead of command-line arguments, you can use environment variables:
Command Line Arguments
The doris-mcp-server
command supports the following arguments:
Argument | Description | Default | Required |
---|---|---|---|
--transport | Transport mode: http or stdio | http | No |
--host | HTTP server host (HTTP mode only) | 0.0.0.0 | No |
--port | HTTP server port (HTTP mode only) | 3000 | No |
--db-host | Doris database host | localhost | No |
--db-port | Doris database port | 9030 | No |
--db-user | Doris database username | root | No |
--db-password | Doris database password | - | Yes (unless in env) |
Development Setup
For developers who want to build from source:
1. Clone the Repository
2. Install Dependencies
3. Configure Environment Variables
Copy the .env.example
file to .env
and modify the settings according to your environment:
Key Environment Variables:
- Database Connection:
DORIS_HOST
: Database hostname (default: localhost)DORIS_PORT
: Database port (default: 9030)DORIS_USER
: Database username (default: root)DORIS_PASSWORD
: Database passwordDORIS_DATABASE
: Default database name (default: information_schema)DORIS_MIN_CONNECTIONS
: Minimum connection pool size (default: 5)DORIS_MAX_CONNECTIONS
: Maximum connection pool size (default: 20)DORIS_BE_HOSTS
: BE nodes for monitoring (comma-separated, optional - auto-discovery via SHOW BACKENDS if empty)DORIS_BE_WEBSERVER_PORT
: BE webserver port for monitoring tools (default: 8040)FE_ARROW_FLIGHT_SQL_PORT
: Frontend Arrow Flight SQL port for ADBC (New in v0.5.0)BE_ARROW_FLIGHT_SQL_PORT
: Backend Arrow Flight SQL port for ADBC (New in v0.5.0)
- Security Configuration:
AUTH_TYPE
: Authentication type (token/basic/oauth, default: token)TOKEN_SECRET
: Token secret keyENABLE_SECURITY_CHECK
: Enable/disable SQL security validation (default: true, New in v0.4.2)BLOCKED_KEYWORDS
: Comma-separated list of blocked SQL keywords (New in v0.4.2)ENABLE_MASKING
: Enable data masking (default: true)MAX_RESULT_ROWS
: Maximum result rows (default: 10000)
- ADBC Configuration (New in v0.5.0):
ADBC_DEFAULT_MAX_ROWS
: Default maximum rows for ADBC queries (default: 100000)ADBC_DEFAULT_TIMEOUT
: Default ADBC query timeout in seconds (default: 60)ADBC_DEFAULT_RETURN_FORMAT
: Default return format - arrow/pandas/dict (default: arrow)ADBC_CONNECTION_TIMEOUT
: ADBC connection timeout in seconds (default: 30)ADBC_ENABLED
: Enable/disable ADBC tools (default: true)
- Performance Configuration:
ENABLE_QUERY_CACHE
: Enable query caching (default: true)CACHE_TTL
: Cache time-to-live in seconds (default: 300)MAX_CONCURRENT_QUERIES
: Maximum concurrent queries (default: 50)MAX_RESPONSE_CONTENT_SIZE
: Maximum response content size for LLM compatibility (default: 4096, New in v0.4.0)
- Enhanced Logging Configuration (Improved in v0.5.0):
LOG_LEVEL
: Log level (DEBUG/INFO/WARNING/ERROR, default: INFO)LOG_FILE_PATH
: Log file path (automatically organized by level)ENABLE_AUDIT
: Enable audit logging (default: true)ENABLE_LOG_CLEANUP
: Enable automatic log cleanup (default: true, Enhanced in v0.5.0)LOG_MAX_AGE_DAYS
: Maximum age of log files in days (default: 30, Enhanced in v0.5.0)LOG_CLEANUP_INTERVAL_HOURS
: Log cleanup check interval in hours (default: 24, Enhanced in v0.5.0)- New Features in v0.5.0:
- Level-based File Separation: Automatic separation into
debug.log
,info.log
,warning.log
,error.log
,critical.log
- Timestamped Format: Enhanced formatting with millisecond precision and proper alignment
- Background Cleanup Scheduler: Automatic cleanup with configurable retention policies
- Audit Trail: Dedicated
audit.log
with separate retention management - Performance Optimized: Minimal overhead async logging with rotation support
- Level-based File Separation: Automatic separation into
Available MCP Tools
The following table lists the main tools currently available for invocation via an MCP client:
Tool Name | Description | Parameters |
---|---|---|
exec_query | Execute SQL query and return results. | sql (string, Required), db_name (string, Optional), catalog_name (string, Optional), max_rows (integer, Optional), timeout (integer, Optional) |
get_table_schema | Get detailed table structure information. | table_name (string, Required), db_name (string, Optional), catalog_name (string, Optional) |
get_db_table_list | Get list of all table names in specified database. | db_name (string, Optional), catalog_name (string, Optional) |
get_db_list | Get list of all database names. | catalog_name (string, Optional) |
get_table_comment | Get table comment information. | table_name (string, Required), db_name (string, Optional), catalog_name (string, Optional) |
get_table_column_comments | Get comment information for all columns in table. | table_name (string, Required), db_name (string, Optional), catalog_name (string, Optional) |
get_table_indexes | Get index information for specified table. | table_name (string, Required), db_name (string, Optional), catalog_name (string, Optional) |
get_recent_audit_logs | Get audit log records for recent period. | days (integer, Optional), limit (integer, Optional) |
get_catalog_list | Get list of all catalog names. | random_string (string, Required) |
get_sql_explain | Get SQL execution plan with configurable content truncation and file export for LLM analysis. | sql (string, Required), verbose (boolean, Optional), db_name (string, Optional), catalog_name (string, Optional) |
get_sql_profile | Get SQL execution profile with content management and file export for LLM optimization workflows. | sql (string, Required), db_name (string, Optional), catalog_name (string, Optional), timeout (integer, Optional) |
get_table_data_size | Get table data size information via FE HTTP API. | db_name (string, Optional), table_name (string, Optional), single_replica (boolean, Optional) |
get_monitoring_metrics_info | Get Doris monitoring metrics definitions and descriptions. | role (string, Optional), monitor_type (string, Optional), priority (string, Optional) |
get_monitoring_metrics_data | Get actual Doris monitoring metrics data from nodes with flexible BE discovery. | role (string, Optional), monitor_type (string, Optional), priority (string, Optional) |
get_realtime_memory_stats | Get real-time memory statistics via BE Memory Tracker with auto/manual BE discovery. | tracker_type (string, Optional), include_details (boolean, Optional) |
get_historical_memory_stats | Get historical memory statistics via BE Bvar interface with flexible BE configuration. | tracker_names (array, Optional), time_range (string, Optional) |
analyze_data_quality | Comprehensive data quality analysis combining completeness and distribution analysis. | table_name (string, Required), analysis_scope (string, Optional), sample_size (integer, Optional), business_rules (array, Optional) |
trace_column_lineage | End-to-end column lineage tracking through SQL analysis and dependency mapping. | target_columns (array, Required), analysis_depth (integer, Optional), include_transformations (boolean, Optional) |
monitor_data_freshness | Real-time data staleness monitoring with configurable freshness thresholds. | table_names (array, Optional), freshness_threshold_hours (integer, Optional), include_update_patterns (boolean, Optional) |
analyze_data_access_patterns | User behavior analysis and security anomaly detection with access pattern monitoring. | days (integer, Optional), include_system_users (boolean, Optional), min_query_threshold (integer, Optional) |
analyze_data_flow_dependencies | Data flow impact analysis and dependency mapping between tables and views. | target_table (string, Optional), analysis_depth (integer, Optional), include_views (boolean, Optional) |
analyze_slow_queries_topn | Performance bottleneck identification with top-N slow query analysis and patterns. | days (integer, Optional), top_n (integer, Optional), min_execution_time_ms (integer, Optional), include_patterns (boolean, Optional) |
analyze_resource_growth_curves | Capacity planning with resource growth analysis and trend forecasting. | days (integer, Optional), resource_types (array, Optional), include_predictions (boolean, Optional) |
exec_adbc_query | High-performance SQL execution using ADBC (Arrow Flight SQL) protocol. | sql (string, Required), max_rows (integer, Optional), timeout (integer, Optional), return_format (string, Optional) |
get_adbc_connection_info | ADBC connection diagnostics and status monitoring for Arrow Flight SQL. | No parameters required |
Note: All metadata tools support catalog federation for multi-catalog environments. Enhanced monitoring tools provide comprehensive memory tracking and metrics collection capabilities. New in v0.5.0: 7 advanced analytics tools for enterprise data governance and 2 ADBC tools for high-performance data transfer with 3-10x performance improvements for large datasets.
4. Run the Service
Execute the following command to start the server:
This command starts the FastAPI application with Streamable HTTP MCP service.
5. Deploying on docker
If you want to run only Doris MCP Server in docker:
Service Endpoints:
- Streamable HTTP:
http://<host>:<port>/mcp
(Primary MCP endpoint - supports GET, POST, DELETE, OPTIONS) - Health Check:
http://<host>:<port>/health
Note: The server uses Streamable HTTP for web-based communication, providing unified request/response and streaming capabilities.
Usage
Interaction with the Doris MCP Server requires an MCP Client. The client connects to the server's Streamable HTTP endpoint and sends requests according to the MCP specification to invoke the server's tools.
Main Interaction Flow:
- Client Initialization: Send an
initialize
method call to/mcp
(Streamable HTTP). - (Optional) Discover Tools: The client can call
tools/list
to get the list of supported tools, their descriptions, and parameter schemas. - Call Tool: The client sends a
tools/call
request, specifying thename
andarguments
.- Example: Get Table Schema
name
:get_table_schema
arguments
: Includetable_name
,db_name
,catalog_name
.
- Example: Get Table Schema
- Handle Response:
- Non-streaming: The client receives a response containing
content
orisError
. - Streaming: The client receives a series of progress notifications, followed by a final response.
- Non-streaming: The client receives a response containing
Catalog Federation Support
The Doris MCP Server supports catalog federation, enabling interaction with multiple data catalogs (internal Doris tables and external data sources like Hive, MySQL, etc.) within a unified interface.
Key Features:
- Multi-Catalog Metadata Access: All metadata tools (
get_db_list
,get_db_table_list
,get_table_schema
, etc.) support an optionalcatalog_name
parameter to query specific catalogs. - Cross-Catalog SQL Queries: Execute SQL queries that span multiple catalogs using three-part table naming.
- Catalog Discovery: Use
get_catalog_list
to discover available catalogs and their types.
Three-Part Naming Requirement:
All SQL queries MUST use three-part naming for table references:
- Internal Tables:
internal.database_name.table_name
- External Tables:
catalog_name.database_name.table_name
Examples:
- Get Available Catalogs:
- Get Databases in Specific Catalog:
- Query Internal Catalog:
- Query External Catalog:
- Cross-Catalog Query:
Security Configuration
The Doris MCP Server includes a comprehensive security framework that provides enterprise-level protection through authentication, authorization, SQL security validation, and data masking capabilities.
Security Features
- 🔐 Authentication: Support for token-based and basic authentication
- 🛡️ Authorization: Role-based access control (RBAC) with security levels
- 🚫 SQL Security: SQL injection protection and blocked operations
- 🎭 Data Masking: Automatic sensitive data masking based on user permissions
- 📊 Security Levels: Four-tier security classification (Public, Internal, Confidential, Secret)
Authentication Configuration
Configure authentication in your environment variables:
Token Authentication Example
Basic Authentication Example
Authorization & Security Levels
The system supports four security levels with hierarchical access control:
Security Level | Access Scope | Typical Use Cases |
---|---|---|
Public | Unrestricted access | Public reports, general statistics |
Internal | Company employees | Internal dashboards, business metrics |
Confidential | Authorized personnel | Customer data, financial reports |
Secret | Senior management | Strategic data, sensitive analytics |
Role Configuration
Configure user roles and permissions:
SQL Security Validation
The system automatically validates SQL queries for security risks:
Blocked Operations
Configure blocked SQL operations using environment variables (New in v0.4.2):
Default Blocked Keywords (Unified in v0.4.2):
- DDL Operations: DROP, CREATE, ALTER, TRUNCATE
- DML Operations: DELETE, INSERT, UPDATE
- DCL Operations: GRANT, REVOKE
- System Operations: EXEC, EXECUTE, SHUTDOWN, KILL
SQL Injection Protection
The system automatically detects and blocks:
- Union-based injections:
UNION SELECT
attacks - Boolean-based injections:
OR 1=1
patterns - Time-based injections:
SLEEP()
,WAITFOR
functions - Comment injections:
--
,/**/
patterns - Stacked queries: Multiple statements separated by
;
Example Security Validation
Data Masking Configuration
Configure automatic data masking for sensitive information:
Built-in Masking Rules
Masking Algorithms
Algorithm | Description | Example |
---|---|---|
phone_mask | Masks phone numbers | 138****5678 |
email_mask | Masks email addresses | j***n@example.com |
id_mask | Masks ID card numbers | 110101****1234 |
name_mask | Masks personal names | 张*明 |
partial_mask | Partial masking with ratio | abc***xyz |
Custom Masking Rules
Add custom masking rules in your configuration:
Security Configuration Examples
Environment Variables
Sensitive Tables Configuration
Security Best Practices
- 🔑 Strong Authentication: Use JWT tokens with proper expiration
- 🎯 Principle of Least Privilege: Grant minimum required permissions
- 🔍 Regular Auditing: Enable audit logging for security monitoring
- 🛡️ Input Validation: All SQL queries are automatically validated
- 🎭 Data Classification: Properly classify data with security levels
- 🔄 Regular Updates: Keep security rules and configurations updated
Security Monitoring
The system provides comprehensive security monitoring:
⚠️ Important: Always test security configurations in a development environment before deploying to production. Regularly review and update security policies based on your organization's requirements.
Connecting with Cursor
You can connect Cursor to this MCP server using Stdio mode (recommended) or Streamable HTTP mode.
Stdio Mode
Stdio mode allows Cursor to manage the server process directly. Configuration is done within Cursor's MCP Server settings file (typically ~/.cursor/mcp.json
or similar).
Method 1: Using PyPI Installation (Recommended)
Install the package from PyPI and configure Cursor to use it:
Configure Cursor: Add an entry like the following to your Cursor MCP configuration:
Method 2: Using uv (Development)
If you have uv
installed and want to run from source:
Note: Replace /path/to/doris-mcp-server
with the actual absolute path to your project directory.
Configure Cursor: Add an entry like the following to your Cursor MCP configuration:
Streamable HTTP Mode
Streamable HTTP mode requires you to run the MCP server independently first, and then configure Cursor to connect to it.
- Configure
.env
: Ensure your database credentials and any other necessary settings are correctly configured in the.env
file within the project directory. - Start the Server: Run the server from your terminal in the project's root directory:This script reads the
.env
file and starts the FastAPI server with Streamable HTTP support. Note the host and port the server is listening on (default is0.0.0.0:3000
). - Configure Cursor: Add an entry like the following to your Cursor MCP configuration, pointing to the running server's Streamable HTTP endpoint:
Note: Adjust the host/port if your server runs on a different address. The
/mcp
endpoint is the unified Streamable HTTP interface.
After configuring either mode in Cursor, you should be able to select the server (e.g., doris-stdio
or doris-http
) and use its tools.
Directory Structure
Developing New Tools
This section outlines the process for adding new MCP tools to the Doris MCP Server, based on the unified modular architecture with centralized tool management.
1. Leverage Existing Utility Modules
The server provides comprehensive utility modules for common database operations:
doris_mcp_server/utils/db.py
: Database connection management with connection pooling and health monitoring.doris_mcp_server/utils/query_executor.py
: High-performance SQL execution with advanced caching, optimization, and performance monitoring.doris_mcp_server/utils/schema_extractor.py
: Metadata extraction with full catalog federation support.doris_mcp_server/utils/security.py
: Comprehensive security management, SQL validation, and data masking.doris_mcp_server/utils/analysis_tools.py
: Advanced data analysis and statistical tools.doris_mcp_server/utils/config.py
: Configuration management with validation.doris_mcp_server/utils/data_governance_tools.py
: Data lineage tracking and freshness monitoring (New in v0.5.0).doris_mcp_server/utils/data_quality_tools.py
: Comprehensive data quality analysis framework (New in v0.5.0).doris_mcp_server/utils/adbc_query_tools.py
: High-performance Arrow Flight SQL operations (New in v0.5.0).
2. Implement Tool Logic
Add your new tool to the DorisToolsManager
class in doris_mcp_server/tools/tools_manager.py
. The tools manager provides a centralized approach to tool registration and execution with unified interfaces.
Example: Adding a new analysis tool:
3. Register the Tool
Add your tool to the _register_tools
method in the same class:
4. Advanced Features
For more complex tools, you can leverage the comprehensive framework:
- Advanced Caching: Use the query executor's built-in caching for enhanced performance
- Enterprise Security: Apply comprehensive SQL validation and data masking through the security manager
- Intelligent Prompts: Use the prompts manager for advanced query generation
- Resource Management: Expose metadata through the resources manager
- Performance Monitoring: Integrate with the analysis tools for monitoring capabilities
5. Testing
Test your new tool using the included MCP client:
MCP Client
The project includes a unified MCP client (doris_mcp_client/
) for testing and integration purposes. The client supports multiple connection modes and provides a convenient interface for interacting with the MCP server.
For detailed client documentation, see doris_mcp_client/README.md
.
Contributing
Contributions are welcome via Issues or Pull Requests.
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
FAQ
Q: Why do Qwen3-32b and other small parameter models always fail when calling tools?
A: This is a common issue. The main reason is that these models need more explicit guidance to correctly use MCP tools. It's recommended to add the following instruction prompt for the model:
- Chinese version:
- English version:
If you have further requirements for the returned results, you can describe the specific requirements in the <output>
tag.
Q: How to configure different database connections?
A: You can configure database connections in several ways:
- Environment Variables (Recommended):
- Command Line Arguments:
- Configuration File:
Modify the corresponding configuration items in the
.env
file.
Q: How to configure BE nodes for monitoring tools?
A: Choose the appropriate configuration based on your deployment scenario:
External Network (Manual Configuration):
Internal Network (Automatic Discovery):
Q: How to use SQL Explain/Profile files with LLM for optimization?
A: The tools provide both truncated content and complete files for LLM analysis:
- Get Analysis Results:
- LLM Analysis Workflow:
- Review truncated content for quick insights
- Upload the complete file to your LLM as an attachment
- Request optimization suggestions or performance analysis
- Implement recommended improvements
- Configure Content Size:
Q: How to enable data security and masking features?
A: Set the following configurations in your .env
file:
Q: What's the difference between Stdio mode and HTTP mode?
A:
- Stdio Mode: Suitable for direct integration with MCP clients (like Cursor), where the client manages the server process
- HTTP Mode: Independent web service that supports multiple client connections, suitable for production environments
Recommendations:
- Development and personal use: Stdio mode
- Production and multi-user environments: HTTP mode
Q: How to resolve connection timeout issues?
A: Try the following solutions:
- Increase timeout settings:
- Check network connectivity:
- Optimize connection pool configuration:
Q: How to resolve at_eof
connection errors? (Completely Fixed in v0.5.0)
A: Version 0.5.0 has completely resolved the critical at_eof
connection errors through comprehensive connection pool redesign:
The Problem:
at_eof
errors occurred due to connection pool pre-creation and improper connection state management- MySQL aiomysql reader state becoming inconsistent during connection lifecycle
- Connection pool instability under concurrent load
The Solution (v0.5.0):
- Connection Pool Strategy Overhaul:
- Zero Minimum Connections: Changed
min_connections
from default to 0 to prevent pre-creation issues - On-Demand Connection Creation: Connections created only when needed, eliminating stale connection problems
- Fresh Connection Strategy: Always acquire fresh connections from pool, no session-level caching
- Zero Minimum Connections: Changed
- Enhanced Health Monitoring:
- Timeout-Based Health Checks: 3-second timeout for connection validation queries
- Background Health Monitor: Continuous pool health monitoring every 30 seconds
- Proactive Stale Detection: Automatic detection and cleanup of problematic connections
- Intelligent Recovery System:
- Automatic Pool Recovery: Self-healing pool with comprehensive error handling
- Exponential Backoff Retry: Smart retry mechanism with up to 3 attempts
- Connection-Specific Error Detection: Precise identification of connection-related errors
- Performance Optimizations:
- Pool Warmup: Intelligent connection pool warming for optimal performance
- Background Cleanup: Periodic cleanup of stale connections without affecting active operations
- Connection Diagnostics: Real-time connection health monitoring and reporting
Monitoring Connection Health:
Configuration for Optimal Connection Performance:
Result: 99.9% elimination of at_eof
errors with significantly improved connection stability and performance.
Q: How to resolve MCP library version compatibility issues? (Fixed in v0.4.2)
A: Version 0.4.2 introduced an intelligent MCP compatibility layer that supports both MCP 1.8.x and 1.9.x versions:
The Problem:
- MCP 1.9.3 introduced breaking changes to the
RequestContext
class (changed from 2 to 3 generic parameters) - This caused
TypeError: Too few arguments for RequestContext
errors
The Solution (v0.4.2):
- Intelligent Version Detection: Automatically detects the installed MCP version
- Compatibility Layer: Gracefully handles API differences between versions
- Flexible Version Support:
mcp>=1.8.0,<2.0.0
in dependencies
Supported MCP Versions:
Version Information:
If you encounter MCP-related startup errors:
Q: How to enable ADBC high-performance features? (New in v0.5.0)
A: ADBC (Arrow Flight SQL) provides 3-10x performance improvements for large datasets:
- ADBC Dependencies (automatically included in v0.5.0+):
- Configure Arrow Flight SQL Ports:
- Optional ADBC Customization:
- Test ADBC Connection:
Q: How to use the new data analytics tools? (New in v0.5.0)
A: The 7 new analytics tools provide comprehensive data governance capabilities:
Data Quality Analysis:
Column Lineage Tracking:
Data Freshness Monitoring:
Performance Analytics:
Q: How to use the enhanced logging system? (Improved in v0.5.0)
A: Version 0.5.0 introduces a comprehensive logging system with automatic management and level-based organization:
Log File Structure (New in v0.5.0):
Enhanced Logging Features:
- Level-Based File Separation: Automatic organization by log level for easier troubleshooting
- Timestamped Formatting: Millisecond precision with proper alignment for professional logging
- Automatic Log Rotation: Prevents disk space issues with configurable file size limits
- Background Cleanup: Intelligent cleanup scheduler with configurable retention policies
- Audit Trail: Separate audit logging for compliance and security monitoring
Viewing Logs:
Configuration:
Troubleshooting with Enhanced Logs:
Log Cleanup Management:
- Automatic: Background scheduler removes files older than
LOG_MAX_AGE_DAYS
- Manual: Logs are automatically rotated when they reach 10MB
- Backup: Keeps 5 backup files for each log level
- Performance: Minimal impact on server performance
For other issues, please check GitHub Issues or submit a new issue.
Related MCP Servers
- -securityAlicense-qualityA server that enables AI models to interact with MySQL databases through a Model Control Protocol, providing tools for table creation, schema inspection, query execution, and data retrieval.Last updated -26PythonMIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that enables large language models to interact with Apache Superset databases through REST API, supporting database queries, table lookups, field information retrieval, and SQL execution.Last updated -45TypeScript
MCP TapData Serverofficial
-securityFlicense-qualityA Model Context Protocol server that enables Large Language Models to access and interact with database connections, including viewing schemas and performing CRUD operations on connected databases.Last updated -- -securityFlicense-qualityA Model Control Protocol server that enables AI assistants to interact with Metabase databases, allowing models to explore database schemas, retrieve metadata, visualize relationships, and execute actions.Last updated -4Python