Click on "Install 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., "@Hue MCP ServerRun a Hive query to count the total records in the sales table"
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.
Hue MCP Server
An MCP (Model Context Protocol) server that exposes HueClientRest functionality, allowing AI assistants to interact with Hadoop Hue for executing SQL queries and managing HDFS files.
What is This?
This server enables AI assistants (like GitHub Copilot, Claude Desktop, or other MCP-compatible clients) to:
Execute SQL queries on Hadoop Hue using Hive, SparkSQL, or Impala
Manage HDFS files (list, upload, download)
Export query results to CSV files
Browse and manage directory structures
The Model Context Protocol (MCP) is an open standard for connecting AI assistants to external tools and data sources, making them more powerful and context-aware.
Features
SQL Query Execution: Execute queries using Hive, SparkSQL, or Impala dialects
Result Export: Save query results to CSV files with automatic retry on large datasets
HDFS Operations: List, upload, and download files from HDFS
Directory Management: Check directory existence and browse file structures
Robust Error Handling: Built-in retry mechanisms and detailed error reporting
Prerequisites
Before installing this MCP server, you need:
Python 3.10 or higher - Download Python
Astral uv - Fast Python package installer and environment manager
Visual Studio Code - For MCP integration with GitHub Copilot
GitHub Copilot subscription - Required for VS Code MCP integration
Access to a Hadoop Hue server - You'll need the host URL, username, and password
Dependencies
This project uses the following key dependencies:
Astral uv - An extremely fast Python package and project manager, written in Rust. It's 10-100x faster than pip and handles dependency resolution much better.
mcp[cli] - The official Python SDK for the Model Context Protocol, including CLI tools
hueclientrest - Python client library for interacting with Hadoop Hue REST API
pydantic - Data validation using Python type annotations
Installation
Step 1: Install Astral uv
uv is a modern, fast Python package manager that we use for dependency management.
On Windows (PowerShell):
On macOS/Linux:
After installation, restart your terminal or add uv to your PATH as instructed by the installer.
Verify installation:
Step 2: Clone and Install the Project
The uv sync command will:
Create a virtual environment (
.venv)Install all dependencies from
pyproject.tomlSet up the project for development
Alternative: Using pip
If you prefer pip over uv:
However, uv is strongly recommended for better performance and dependency management.
Configuration
Environment Variables
The server requires the following environment variables to connect to your Hue server:
Variable | Required | Description |
| Yes | Hue server URL (e.g., |
| Yes | Username for Hue authentication |
| Yes | Password for Hue authentication |
| No | Verify SSL certificates (default: |
| No | Show SSL warnings (default: |
Setting Up Environment Variables
Option 1: Using .env file (Recommended for local development)
Option 2: System environment variables
On Windows (PowerShell):
On macOS/Linux:
VS Code Integration with GitHub Copilot
Prerequisites for VS Code Integration
Visual Studio Code - Download VS Code
GitHub Copilot extension - Install from VS Code marketplace
GitHub Copilot subscription - Required for MCP support
This MCP server installed and configured
Step 1: Locate Your MCP Configuration File
The MCP configuration file location depends on your operating system:
Windows:
%APPDATA%\Code\User\mcp.jsonFull path:
C:\Users\<YourUsername>\AppData\Roaming\Code\User\mcp.json
macOS:
~/Library/Application Support/Code/User/mcp.jsonLinux:
~/.config/Code/User/mcp.json
If the file doesn't exist, create it.
Step 2: Configure the MCP Server in VS Code
Add the following configuration to your mcp.json file:
Important Notes:
Replace
C:\\Projects\\hueclientrest-mpcwith the actual path to your projectOn Windows, use double backslashes (
\\) or forward slashes (/) in pathsReplace the environment variable values with your actual Hue credentials
The
commandisuvwhich will use the uv package manager to run the server
Step 3: Verify the Configuration
Restart VS Code completely (close all windows)
Open GitHub Copilot Chat (Ctrl+Shift+I or Cmd+Shift+I)
Check for the Hue MCP tools: Type
@workspaceand look for Hue-related capabilitiesTest the connection: Ask Copilot to "list files in HDFS directory /user"
Step 4: Using the MCP Server with Copilot
Once configured, you can ask GitHub Copilot to interact with your Hue server:
Example queries:
"Execute a Hive query to show tables"
"List files in HDFS directory /user/data"
"Download the file /user/data/results.csv from HDFS"
"Execute this SQL query and save results to CSV: SELECT * FROM my_table LIMIT 100"
Troubleshooting VS Code Integration
Issue: MCP server not appearing in Copilot
Verify the
mcp.jsonpath is correctCheck that uv is installed and in your PATH
Restart VS Code completely
Check VS Code's Output panel (View > Output) and select "GitHub Copilot" from the dropdown
Issue: Authentication errors
Verify your HUE_HOST, HUE_USERNAME, and HUE_PASSWORD are correct
Test connectivity to your Hue server directly
Check if SSL verification is causing issues (try setting HUE_VERIFY_SSL to false for testing)
Issue: Command not found
Ensure uv is installed: run
uv --versionin terminalVerify the project path in mcp.json is correct and uses proper escaping
Make sure you ran
uv syncin the project directory
Alternative: Using Absolute Python Path
If uv is not working or not in your PATH, you can use the absolute path to the Python interpreter:
Windows example:
macOS/Linux example:
Other Usage Methods
Claude Desktop Integration
If you're using Claude Desktop instead of VS Code, add this to your Claude config (~/.config/claude/claude_desktop_config.json on Mac/Linux or %APPDATA%\Claude\claude_desktop_config.json on Windows):
Development Mode
Test the server interactively using the MCP inspector:
This opens an interactive interface where you can test tools and see requests/responses in real-time.
Direct Command Line Execution
You can also run the server directly:
Available Tools
SQL Query Tools
hue_execute_query
Execute a SQL query and return results directly.
hue_run_query_to_csv
Execute a query and save results to a CSV file.
hue_export_and_download
Execute INSERT OVERWRITE DIRECTORY and download resulting files.
HDFS File Tools
hue_list_directory
List contents of an HDFS directory.
hue_check_directory_exists
Check if an HDFS directory exists.
hue_download_file
Download a single file from HDFS.
hue_download_directory
Download all files from an HDFS directory.
hue_upload_file
Upload a local file to HDFS.
How It Works
The Model Context Protocol (MCP)
MCP is an open protocol that standardizes how AI assistants communicate with external tools and data sources. Think of it as a universal adapter that lets AI assistants "plug into" different services.
Key components:
MCP Server (this project): Exposes tools and capabilities
MCP Client (VS Code/Claude Desktop): Consumes tools and presents them to the AI
Protocol: Defines how they communicate
Architecture Flow
User asks Copilot to query Hue data
Copilot recognizes the request requires Hue MCP tools
MCP Server receives the request and translates it to Hue REST API calls
HueClientRest library handles authentication and API communication
Results flow back through the chain to the user
Dependency Details
Astral uv (Package Manager)
What it is: A next-generation Python package and project manager written in Rust.
Why we use it:
Speed: 10-100x faster than pip
Better dependency resolution: Handles complex dependencies more reliably
Unified tool: Combines pip, pip-tools, pipx, poetry, pyenv functionality
Reproducible environments: Lock files ensure consistent installs
Cross-platform: Works seamlessly on Windows, macOS, and Linux
Key commands:
uv sync- Install/update dependenciesuv add <package>- Add a new dependencyuv run <command>- Run commands in the virtual environmentuv pip install <package>- Use like pip if needed
Learn more: https://docs.astral.sh/uv/
mcp[cli] (Python SDK)
What it is: The official Python SDK for building MCP servers.
Key features:
FastMCP framework: Simplified server creation with decorators
Type validation: Pydantic integration for request/response validation
CLI tools:
mcp devfor testing,mcp installfor setupAsync support: Built on asyncio for efficient I/O
SSE transport: Server-sent events for real-time communication
In this project:
hueclientrest (Hue Client Library)
What it is: Python client for Hadoop Hue REST API.
Capabilities:
SQL query execution (Hive, SparkSQL, Impala)
HDFS file operations
Session management
Authentication handling
Error handling and retries
In this project:
pydantic (Data Validation)
What it is: Data validation library using Python type hints.
Why we use it:
Type safety: Validates tool inputs/outputs at runtime
Auto-documentation: Generates schemas from type hints
Error messages: Clear validation errors for debugging
JSON schema: Automatic schema generation for MCP
In this project:
Example Usage Scenarios
Scenario 1: Execute a Hive Query
In VS Code with Copilot:
Query executed:
Scenario 2: List HDFS Files
In VS Code with Copilot:
Scenario 3: Export Data to CSV
In VS Code with Copilot:
Query executed:
Scenario 4: Complex Data Pipeline
In VS Code with Copilot:
Development
Setting Up for Development
Running Tests
Adding New Tools
To add a new MCP tool:
Define the tool function in
server.py:
The
@mcp.tool()decorator automatically:Registers the tool with the MCP server
Generates JSON schema from type hints
Validates inputs using Pydantic
Handles errors and responses
Test your tool:
Debugging
Enable verbose logging:
Test MCP server directly:
VS Code debugging:
Check Output panel: View > Output > GitHub Copilot
Look for MCP server connection messages
Check for authentication or network errors
Project Structure
Dependencies Management
View installed packages:
Add a new dependency:
Update dependencies:
Remove a dependency:
Security Considerations
Credential Management
Best Practices:
Never commit credentials to version control
Use environment variables or secure vaults
Rotate passwords regularly
Use .env files for local development only
Use secrets management (Azure Key Vault, AWS Secrets Manager) in production
SSL/TLS Configuration
For production environments:
For development/testing (self-signed certificates):
Network Security
Ensure Hue server is accessible from your development machine
Check firewall rules if connection fails
Use VPN if required by your organization
Keep authentication tokens secure
Troubleshooting Common Issues
Issue: uv command not found
Solution:
Issue: Python version mismatch
Error: requires-python = ">=3.10" but you have Python 3.9
Solution:
Issue: MCP server not loading in VS Code
Checklist:
uv is installed and in PATH (
uv --version)Project dependencies installed (
uv sync)mcp.json path is correct for your OS
Project path in mcp.json uses proper escaping
VS Code completely restarted (all windows closed)
GitHub Copilot extension is enabled
Active Copilot subscription
Issue: Authentication failures
Error: "Authentication failed" or "401 Unauthorized"
Solution:
Verify credentials are correct
Check if Hue server URL is accessible
Test login directly in browser
Check for special characters in password (may need escaping)
Verify user has necessary permissions in Hue
Issue: Query timeouts
Error: "Query execution timeout"
Solution:
Issue: HDFS file not found
Error: "File or directory not found"
Solution:
Verify path is absolute (starts with
/)Check permissions on HDFS
Use
hue_list_directoryto browse available pathsVerify user has read/write permissions
Performance Tips
Query Optimization
Use batch_size for large result sets:
Use LIMIT in queries when exploring:
Export large datasets directly to HDFS:
Then use hue_export_and_download to retrieve files.
HDFS Operations
Download specific files with patterns:
Use streaming for large file transfers
Batch uploads when possible
FAQ
Q: Can I use this with Claude Desktop?
A: Yes! See the "Claude Desktop Integration" section for configuration details.
Q: Does this work on Windows?
A: Yes, fully supported on Windows, macOS, and Linux.
Q: What Hue versions are supported?
A: Any version with REST API support. Tested with Hue 4.x and newer.
Q: Can multiple users share one MCP server?
A: Each user should run their own MCP server instance with their own credentials.
Q: How do I update to the latest version?
A:
Q: Is my password secure?
A: Credentials are stored in environment variables or mcp.json. Keep these files secure and never commit them to version control.
Resources
Documentation
Community
Related Projects
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Development Setup
Running Tests
Code Style
This project uses:
Black for code formatting
isort for import sorting
mypy for type checking
Changelog
v0.1.0 (Current)
Initial release
SQL query execution (Hive, SparkSQL, Impala)
HDFS file operations
CSV export functionality
VS Code and Claude Desktop integration
License
MIT License - See LICENSE file for details
Credits
HueClientRest - The underlying Python client for Hue REST API
Model Context Protocol - Open standard for AI-tool integration
Astral - Creators of uv package manager
Anthropic - MCP specification and implementation
Support
For issues, questions, or feature requests:
Check the Troubleshooting section
Search existing GitHub issues
Create a new issue with detailed information
Happy querying! 🚀