
dremio python mcp
实现 Dremio 的模型上下文协议 (MCP),标准化与 Dremio 数据库的交互方式。
Repository Info
About This Server
实现 Dremio 的模型上下文协议 (MCP),标准化与 Dremio 数据库的交互方式。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Dremio Model-Context Protocol (MCP)
This project implements a Model-Context Protocol (MCP) server for Dremio. It provides a standardized way to interact with Dremio databases through the MCP.
Features
Resources
Exposes Dremio data through Resources:
dremio://catalogs- Lists all catalogsdremio://schemas/{catalog}- Lists all schemas in a catalogdremio://tables/{catalog}/{schema}- Lists all tables in a schemadremio://schema/{table_name}- Gets schema information for a table
Tools
-
list_catalogs
- Lists all available catalogs in Dremio
- Usage:
list_catalogs()
-
list_schemas
- Lists all schemas in a specific catalog
- Usage:
list_schemas("catalog_name")
-
list_tables
- Lists all tables in a specific schema
- Usage:
list_tables("catalog_name", "schema_name")
-
execute_sql
- Executes a SQL query against Dremio
- Returns results in a structured format with metadata
- Usage:
execute_sql("SELECT * FROM catalog.schema.table LIMIT 10")
Requirements
- Python 3.10+
- Dremio instance (Cloud or Software)
- PyArrow with Flight support
Installation
Using pip
pip install -e .
Using uv (recommended)
# Install uv if you don't have it
curl -sSf https://astral.sh/uv/install.sh | bash
# Install the package
uv pip install -e .
Configuration
Create a config.yaml file in the root directory with the following configuration:
# Dremio connection settings
dremio:
# Connection type: 'software' for Dremio Software or 'cloud' for Dremio Cloud
type: software
# Dremio Software connection details
software:
hostname: localhost
port: 32010
username: your_username
password: your_password
use_ssl: false
# Query settings
query:
# Maximum number of rows to return in a query result
max_rows: 10000
# Maximum number of columns to return in schema request
max_columns: 1000
# Timeout in seconds for query execution
timeout: 300
Environment Variables
You can also configure the server using environment variables:
DREMIO_HOSTNAME=localhost
DREMIO_PORT=32010
DREMIO_USERNAME=your_username
DREMIO_PASSWORD=your_password
DREMIO_USE_SSL=false
For Dremio Cloud:
DREMIO_TYPE=cloud
DREMIO_ENDPOINT=data.dremio.cloud
DREMIO_PAT_TOKEN=your_personal_access_token
Usage
Running the Server
# If installed from package
mcp-dremio-server
# Or run directly
python run_mcp_server.py
Integration with Claude or Other MCP Clients
Add the following configuration to your MCP client settings:
MacOS
// ~/Library/Application\ Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"dremio_service": {
"command": "/Users/USERNAME/.local/bin/uv",
"args": [
"--directory",
"/Users/USERNAME/PycharmProjects/dremio-python-mcp",
"run",
"run_mcp_server.py"
]
}
}
}
Windows
// %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"dremio-mcp": {
"command": "mcp-dremio-server",
"args": []
}
}
}
Example Usage
Listing Catalogs and Schemas
// List all catalogs
list_catalogs()
// List schemas in a catalog
list_schemas("my_catalog")
// List tables in a schema
list_tables("my_catalog", "my_schema")
Executing SQL Queries
// Execute a query
results = execute_sql("SELECT * FROM my_catalog.my_schema.my_table LIMIT 10")
Security Features
- SQL Validation: Prevents execution of non-read-only queries
- Input Validation: Prevents SQL injection via table/schema names
- TLS Support: Secure communication with Dremio
- Authentication: Support for username/password and token authentication
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, use the MCP Inspector:
npx @modelcontextprotocol/inspector mcp-dremio-server
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Quick Start
Clone the repository
git clone https://github.com/ucesys/dremio-python-mcpInstall dependencies
cd dremio-python-mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.