Skip to main content
Glama
manojjain10

Cloudera Hive MCP Server

by manojjain10

Cloudera Hive MCP Server

A standard Model Context Protocol server that exposes a Cloudera Data Warehouse Virtual Warehouse (Hive) to any MCP client — Claude Desktop, Claude Code, the Claude Agent SDK, LangChain, LlamaIndex, Cline, Continue, etc.

Tools

Tool

Purpose

list_databases

List every database in the Virtual Warehouse.

list_tables

List tables in a given database.

describe_table

Return columns, types, and comments for a table.

get_table_sample

Preview the first N rows (1–100) of a table.

execute_query

Run a HiveQL query. Read-only by default; row-capped for safety.

Related MCP server: Cloudera Iceberg MCP Server

Prerequisites

  • Python 3.10+

  • Network access to your Cloudera Virtual Warehouse (typically *.dw.cloudera.site:443)

  • A workload user + password with query privileges on the target VW

uvx is the Python analog of npx. It fetches the package, resolves its dependencies into an isolated cache, and runs the entry point — no clone, no venv, no pip install on the client machine.

One-time on the client machine — install uv (ships uvx):

curl -LsSf https://astral.sh/uv/install.sh | sh    # macOS / Linux
# Windows:  powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

Then any MCP client can launch this server with:

uvx --from git+https://github.com/mjain/hive-mcp-server hive-mcp-server

(replace the Git URL with your fork / internal mirror)

Environment variables

The server needs Hive credentials in its environment. Every MCP client config below sets them via an env block — no .env file needed on the client.

Variable

Default

Description

HIVE_HOST

(required)

Virtual Warehouse hostname

HIVE_PORT

443

HTTPS port

HIVE_HTTP_PATH

/cliservice

HiveServer2 HTTP path

HIVE_USERNAME

(required)

Cloudera workload user

HIVE_PASSWORD

(required)

Cloudera workload password

HIVE_READ_ONLY

true

If true, execute_query rejects DDL/DML

HIVE_QUERY_ROW_LIMIT

1000

Max rows returned by execute_query

MCP_TRANSPORT

stdio

Transport passed to mcp.run(). Use stdio for MCP clients; set to sse when driving via the MCP Inspector.


Client setup

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "hive": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/mjain/hive-mcp-server",
        "hive-mcp-server"
      ],
      "env": {
        "HIVE_HOST": "your-vw-host.dw.cloudera.site",
        "HIVE_USERNAME": "your-workload-user",
        "HIVE_PASSWORD": "your-workload-password",
        "HIVE_READ_ONLY": "true"
      }
    }
  }
}

Fully quit Claude Desktop (⌘Q) and reopen. The five Hive tools appear in the tool tray.

Claude Code CLI

claude mcp add hive \
  --env HIVE_HOST=your-vw-host.dw.cloudera.site \
  --env HIVE_USERNAME=your-workload-user \
  --env HIVE_PASSWORD=your-workload-password \
  -- uvx --from git+https://github.com/mjain/hive-mcp-server hive-mcp-server

Add -s user before hive to make it available in every project.

Claude Agent SDK (Python)

# pip install claude-agent-sdk
import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions

async def main():
    options = ClaudeAgentOptions(
        mcp_servers={
            "hive": {
                "type": "stdio",
                "command": "uvx",
                "args": [
                    "--from",
                    "git+https://github.com/mjain/hive-mcp-server",
                    "hive-mcp-server",
                ],
                "env": {
                    "HIVE_HOST": "your-vw-host.dw.cloudera.site",
                    "HIVE_USERNAME": "your-workload-user",
                    "HIVE_PASSWORD": "your-workload-password",
                    "HIVE_READ_ONLY": "true",
                },
            }
        },
        allowed_tools=[
            "mcp__hive__list_databases",
            "mcp__hive__list_tables",
            "mcp__hive__describe_table",
            "mcp__hive__get_table_sample",
            "mcp__hive__execute_query",
        ],
    )
    async for msg in query(
        prompt="List all Hive databases, then describe the largest table in the first one.",
        options=options,
    ):
        print(msg)

asyncio.run(main())

The same {command, args, env} shape works for LangChain's MCP adapter, LlamaIndex, Cline, Continue, Zed, and every other MCP client.


Local development

Clone and install in editable mode when working on the server itself:

git clone <this repo>
cd hive-mcp-server-claude
python -m venv .venv
source .venv/bin/activate
pip install -e .
cp .env.example .env    # fill in credentials
hive-mcp-server         # runs on stdio; Ctrl-C to stop

Smoke-test the connection:

python -c "from hive_mcp_server.tools.hive_tools import list_databases; print(list_databases())"

Code layout

The server follows the same pattern as cloudera/iceberg-mcp-server:

src/hive_mcp_server/
├── __init__.py           # version + main/mcp re-exports
├── server.py             # thin MCP registration layer (@mcp.tool wrappers)
└── tools/
    ├── __init__.py
    └── hive_tools.py     # config, connection, SQL safety, tool logic

To add a new tool: implement it in tools/hive_tools.py, then add a matching @mcp.tool() wrapper in server.py whose docstring becomes the tool description exposed to the LLM.

Transport

By default the server runs on stdio, which is what all MCP clients (Claude Desktop, Claude Code, etc.) expect. To use the MCP Inspector web UI instead:

MCP_TRANSPORT=sse hive-mcp-server

Publishing your own fork

Push to any Git host — clients reference the URL:

git init && git add . && git commit -m "initial"
git remote add origin https://github.com/<you>/hive-mcp-server
git push -u origin main

Then everyone points their uvx --from git+... at your URL. To publish to PyPI so clients can just say uvx hive-mcp-server (no --from):

pip install build twine
python -m build
twine upload dist/*

Safety

  • HIVE_READ_ONLY=true (default)execute_query rejects INSERT / UPDATE / DELETE / DROP / ALTER / TRUNCATE / CREATE / REPLACE / MERGE / GRANT / REVOKE / MSCK / LOAD / EXPORT / IMPORT.

  • HIVE_QUERY_ROW_LIMIT=1000 — caps execute_query results so a SELECT * on a billion-row table doesn't blow up the agent's context.

  • Identifier validationdatabase and table arguments must match [A-Za-z_][A-Za-z0-9_]*; anything else is rejected before reaching Hive.

  • No credentials in tool arguments — the connection is configured entirely through environment variables; agents cannot see or override them.

License

MIT.

Available Tools

5 tools
describe_tableA

Return column names, types, and comments for database.table.

ParametersJSON Schema
NameRequiredDescriptionDefault
tableYes
databaseYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description does not disclose behavioral traits such as error conditions, permissions, or side effects. However, as a read-only introspection tool, the lack of detail is less critical.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no fluff; front-loaded with the main action and resource. Every word adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema provided, the description does not need to detail return values. However, it omits any mention of error handling or prerequisites, which would be helpful for completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the description adds meaning by specifying the parameters as a fully qualified name (`database.table`), clarifying how the two parameters combine to identify the resource.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Return column names, types, and comments for `database`.`table`', which specifies a precise verb and resource, and distinguishes from siblings like execute_query, get_table_sample, and list_tables.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus siblings or any prerequisites. The description only states what it does, not when to choose it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

execute_queryA

Execute a HiveQL query and return results as a list of row dicts.

When HIVE_READ_ONLY is true (the default), write DDL/DML is rejected. Results are capped at HIVE_QUERY_ROW_LIMIT rows.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations given, so description carries full burden. It discloses that write operations are rejected in read-only mode and that row counts are limited. This is sufficient for understanding side effects and limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences long, no redundant words, and front-loads the core purpose before constraints. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 1 simple parameter and an output schema, the description covers purpose, constraints (read-only, row limit), and behavioral traits. It does not need to explain return values since output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, and the only parameter 'query' is described only as 'HiveQL query'. While this adds some context, it does not elaborate on syntax, encoding, or examples, which would be helpful given low coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Execute' and the resource 'HiveQL query', and specifies the output format as 'list of row dicts'. This distinguishes it from sibling tools like 'describe_table' and 'list_tables', which have different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit constraints: read-only mode rejects write DDL/DML, and results are capped. It implies usage for running queries but does not explicitly contrast with siblings or specify when to use alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_table_sampleA

Preview the first limit rows of database.table (1..100).

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
tableYes
databaseYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description carries the burden. It discloses the limit range (1-100) and that it returns the first rows, but does not specify ordering, permissions, or limitations of the preview.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that immediately conveys the function. It is front-loaded with the verb 'Preview' and includes key constraints (limit range) without wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema (not shown), the description adequately explains input and behavior. It specifies the first rows and limit range, though it omits ordering details. For a simple preview tool, this is mostly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema coverage, the description adds meaning for the limit parameter (range 1-100) and shows database/table in syntax. However, it does not explain the semantics of database and table beyond their presence in the template.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool previews the first `limit` rows of a specified table, with a specific verb ('Preview') and resource. It differentiates from siblings like execute_query (full queries) and describe_table (schema).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as execute_query for more complex queries or describe_table for schema. The description implies quick preview usage but lacks explicit context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_databasesA

Retrieve all available databases in the Hive Virtual Warehouse.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It describes a benign read operation but lacks details such as whether the list is exhaustive or any potential performance implications. Adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence of 10 words, front-loaded with the action. Every word is purposeful with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool with an output schema, the description is sufficiently complete. It conveys the essential purpose without needing additional context or annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has zero parameters, and schema description coverage is 100%. Per guidelines, baseline for 0 params is 4. Description adds no param info, which is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Retrieve all available databases in the Hive Virtual Warehouse,' specifying the verb, resource, and context. It distinguishes itself from siblings like list_tables and describe_table.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use for obtaining a list of databases. While it doesn't explicitly state when not to use or alternatives, the sibling tool names provide clear context for differentiation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_tablesB

Retrieve all tables for a given database.

ParametersJSON Schema
NameRequiredDescriptionDefault
databaseYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits. It only states 'Retrieve' which implies a read operation, but lacks details on ordering, pagination, access control, or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that gets to the point. It is well front-loaded, though could include more detail without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with an output schema, the description is minimally adequate. It does not explain what information is returned (e.g., table names, schema details), but the output schema may compensate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%. The description does not elaborate on the 'database' parameter (e.g., whether it's a name or ID, required format). It adds no meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Retrieve all tables for a given database' with a specific verb and resource. It clearly distinguishes from sibling tools like 'describe_table' or 'list_databases' by specifying 'tables' and 'database'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or when-not-to-use guidance is provided. The description implies usage for listing tables, but does not compare to alternatives like 'describe_table' or 'execute_query'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.1.0
    • First observeddescribe_table
    • First observedexecute_query
    • First observedget_table_sample
    • First observedlist_databases
    • First observedlist_tables

TDQS

A4/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a distinct responsibility: describing table schema, executing queries, sampling data, listing databases, and listing tables. No two tools overlap in purpose, ensuring clear selection.

Naming Consistency5/5

All tools use a consistent verb_noun pattern in snake_case (e.g., describe_table, execute_query). This makes the toolset predictable and easy to navigate.

Tool Count5/5

With 5 tools, the server covers core Hive operations without being bloated or sparse. Each tool serves a necessary function for a read-only Hive interface.

Completeness4/5

The tools provide fundamental read-only capabilities: schema discovery, data preview, and query execution. A minor gap is the lack of tools for obtaining table statistics or partition info, but the set is largely complete for its purpose.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Enables read-only access to Apache Iceberg tables via Impala, allowing LLMs to inspect database schemas and execute SQL queries to retrieve data from Iceberg tables.
    2
    14
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables LLMs to query and explore schemas in Microsoft Fabric lakehouses, warehouses, and SQL databases using natural language, with tools for executing read-only SQL queries and searching tables, columns, and query patterns.
    3
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Provides read-only SQL access to Apache Iceberg tables via HiveServer2, enabling querying, schema discovery, and database listing on Cloudera Data Platform.
    3
    Apache 2.0