Apache Hive MCP Server
Apache Hive Server Server
Apache Hive Server(HiveServer2)向けの MCP サーーです。 FastMCP で構築されて、オープンソースの Apache Hive、Cloudera CDP Base、Cloudera CDP Public Cloud(CDW)など、HiveServer2 互換の任意のエンドポイントに接続し、LLM エージェントが呼び出せる読取り専用のツールを2つ公開します。
Project summary
概要 — LLM エージェントが Apache Hive をクエリするための Model Context Protocol サーです。テーブル一覧の表示と読取り専用 SQL の実执行ができ、結果は JSON で返されます。
機能互換 — Cloudera の Impala/Iceberg MCP server を mirror しています。
execute_queryとget_schemaのツールと構表は同ですが、接続レイヤーがimpyla経由の HiveServer2 に代わっています。HiveServer2 が使える場所ならどこでも動作 — オープンソースの ApacheHive、CDPBase(Kerberos/LDAP)、CDP Public Cloud/CDW(Knox/LDAP/HTTPS)に対応。
デフォルトで安全 —
execute_queryは読取り専用プレフィクスガード(SELECT/SHOW/DESCRIBE/WITH)を適用ます。書き込み・DDL 文は接続を確立する前に拒否されます。トランスポート —
MCP_TRANSPORTでstdio(デフォルト)、http、sseを選択します。技術スタック — Python ≥3.10、FastMCP、
impyla、uv。ユニットテストの数は11(接続はモック—実際の Hive は不要)。
Related MCP server: impala-mcp-server
Tools
ツール | シグネチャ | 説明 |
|
| 読み取り専用 SQLクエリ(SELECT、SHOW、DESCRIBE、WITH)を実行して、結果を列名をキーとするオブジェクトのJSON配列で返します。書き込み操作はエラー文字列で拒否されます。 |
|
| 設定されたデータベースに対して |
設定
設定はすべて環境変数(またはプロジェクトルートの .env ファイル)で行います。
変数 | デフォルト | 説明 |
|
| HiveServer2 のホスト名または IP |
|
| HiveServer2 の Thrift ポート |
|
| 接続するデータベース |
| (空) | ユーザー名(NOSASL/Kerberos の場合は空のまま) |
| (空) | パスワード(PLAIN/LDAP で使用) |
|
| 認証方式: |
|
| バイナリの Thrift の代わりに HTTP トランスポートを使用 |
|
|
|
|
| Thrift 接続で TLS を有効にする |
|
| Kerberos サービスのプリンシパル名(GSSAPI のみ) |
|
| MCP トランスポート: |
.env.example を .env にコピーして、値を設定してください。
Deployment presets
Local / development (Docker HiveServer2)
HIVE_HOST=localhost
HIVE_PORT=10000
HIVE_DATABASE=default
HIVE_AUTH_MECHANISM=NOSASL
MCP_TRANSPORT=stdioCDP Public Cloud (CDW Virtual Warehouse)
HIVE_HOST=<coordinator-hostname>.dw.cloudera.site
HIVE_PORT=443
HIVE_DATABASE=default
HIVE_USER=<workload-username>
HIVE_PASSWORD=<workload-password>
HIVE_AUTH_MECHANISM=LDAP
HIVE_USE_HTTP_TRANSPORT=true
HIVE_HTTP_PATH=cliservice
HIVE_USE_SSL=true
MCP_TRANSPORT=stdioCDP Base / on-premises with Kerberos
HIVE_HOST=<hiveserver2-host.example.com>
HIVE_PORT=10000
HIVE_DATABASE=default
HIVE_AUTH_MECHANISM=GSSAPI
HIVE_KERBEROS_SERVICE_NAME=hive
MCP_TRANSPORT=stdioサーバーを起動する前に Kerberos チケット (
kinit) を取得してください。
Running
# Install
pip install -e .
# or with uv:
uv sync
# Copy and edit config
cp .env.example .env
# Start (stdio transport, for use with an MCP host)
uv run hive-mcp-serverMCP client configuration
MCP ホスト(Claude Desktop、Cloudera AI Agent Studio など)は、mcpServers JSON ブロックでサーバーを登録します。uvx はこのサーバーを GitHub から直接実行するため、ローカルインストールや PyPI への公開は不要です。ご利用の環境に合わせて HIVE_* 値を入力してください(Configuration と上記の presets を参照)。
{
"mcpServers": {
"Hive": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/avelloal/hive-mcp-server@v0.1.0",
"hive-mcp-server"
],
"env": {
"HIVE_HOST": "<coordinator-hostname>.dw.cloudera.site",
"HIVE_PORT": "443",
"HIVE_DATABASE": "default",
"HIVE_USER": "<workload-username>",
"HIVE_PASSWORD": "<workload-password>",
"HIVE_AUTH_MECHANISM": "LDAP",
"HIVE_USE_HTTP_TRANSPORT": "true",
"HIVE_HTTP_PATH": "cliservice",
"HIVE_USE_SSL": "true"
}
}
}
}上記の例は CDP Public Cloud / CDW 向けです。ローカルまたは Kerberos ターゲットの場合は、上記の presets を参考に env 値を差し替えてください。 @v0.1.0 は固定リリースを指定しています。外すと最新版を追従し、新しいバージョンに上げることもできます。
Cloudera AI Agent Studio の具体的な内容(登録手順、環境変数の取扱い、stdio/uvxの制限)は、examples/agent-studio/ を参照してください。
Smoke test
ローカルの HiveServer2 を起動(例: Apache Hive Docker イメージ):
docker run -d -p 10000:10000 apache/hive:3.1.3上記のローカル presets で
.envを設定。サーバーを起動:
uv run hive-mcp-server別のターミナルで
fastmcpdev inspector を または任意のMCPクライアントを使って、両方のツールを呼び出してください。get_schema()—[]またはテーブル名の一覧が返るはずです。execute_query("SHOW DATABASES")— データベース一覧の JSON 配列が返るはずです。
License
Apache License 2.0 — LICENSE を参照してください。# Apache Hive MCP Server
Apache Hive(HiveServer2)向けの MCP サーバーです。FastMCP で構築されており、オープンソースの Apache Hive、Cloudera CDP Base、Cloudera CDP Public Cloud(CDW)など、HiveServer2 互換の任意のエンドポイントに接続できます。LLM エージェントが呼び出せる読み取り専用ツールを2つ公開します。
Project summary
概要 — LLM エージェントが Apache Hive に対してテーブル一覧の取得や読み取り専用 SQL を実行できるようにする Model Context Protocol サーバーです。結果は JSON で返されます。
機能互換性 — Cloudera の Impala/Iceberg MCP server をミラーしています。
execute_queryとget_schemaのツールと構造は同じで、接続レイヤーがimpyla経由の HiveServer2 に置き換えられています。HiveServer2 が動作場所で動作 — オープンソースの Apache Hive、CDP Base(Kerberos/LDAP)、CDP Public Cloud/CDW(Knox、LDAP over HTTPS)に対応。認証、tランスポート、TLS はすべて
HIVE_*環境変数で制御されます。デフォルトで安全 —
execute_queryは読み取り専用プレフィクスガード(SELECT/SHOW/DESCRIBE/WITH)を適用します。書き込み・DLL 文はコネクションを開く前に拒否されます。Transport —
MCP_TRANSPORTで選択するstdio(デフォルト)、http、sseのいずれか。技術スタック — Python ≥3.10、FastMCP、
impyla、uv。11件のユニットテスト(接続はモック—実 Hive は不要)。
Tools
Tool | Signature | Description |
|
| (SELECT, SHOW, DESCRIBE, WITH) を実执行し、結果を colunmn-keyed オブジェクト配列 JSON として返す。書き込み操作はエラー文字列で拒否される。 |
|
| 設定されたデータベースに対して |
Configulation
設定はすべて環境変数(またはプロジェクトルートの .env ファイル)で行います。
Variable | Default | Description |
|
| HiveServer2 のホスト名 IP |
|
| HiveServer2 の Thrift ポート |
|
| 接続先データベース |
| (空) | ユーザ名 (NOSASL Kerberos の場合空) |
| (空) | パスワード (PLAIN/LDAP で使用) |
|
| 認証方式: |
|
| バイナリ thrift の代わりに HTTP トランスポートを使用 |
|
|
|
|
| thrift 接続の TLS を有効化する |
|
| Kerberos サービス principal name(GSSAPI only) |
|
| MCP transport: |
Copy .env.example to .env and fill in your values.
Deployment presets
Local / development (Docker HiveServer2)
HIVE_HOST=localhost
HIVE_PORT=10000
HIVE_DATABASE=default
HIVE_AUTH_MECHANISM=NOSASL
MCP_TRANSPORT=stdioCDP Public Cloud (CDW Virtual Warehouse)
HIVE_HOST=<coordinator-hostname>.dw.cloudera.site
HIVE_PORT=443
HIVE_DATABASE=default
HIVE_USER=<workload-username>
HIVE_PASSWORD=<workload-password>
HIVE_AUTH_MECHANISM=LDAP
HIVE_USE_HTTP_TRANSPORT=true
HIVE_HTTP_PATH=cliservice
HIVE_USE_SSL=true
MCP_TRANSPORT=stdioCDP Base / on-premises with Kerberos
HIVE_HOST=<hiveserver2-host.example.com>
HIVE_PORT=10000
HIVE_DATABASE=default
HIVE_AUTH_MECHANISM=GSSAPI
HIVE_KERBEROS_SERVICE_NAME=hive
MCP_TRANSPORT=stdioサーバーを起動する前(Kerberos のチケット渡(
kinit.
Running
# Install
pip install -e .
# or with uv:
uv sync
# Copy and edit config
cp .env.example .env
# Start (stdio transport, for use with an MCP host)
uv run hive-mcp-serverMCP クライアント設定
MCP ホス(Claude Desktop、Cloudera AI Agent Studio, etc.)サーバーを mcpServers JSON ブブロックで登録します。uvx はこのサーバーを GitHub から直接実行できます。ローカルインストールや PyPI 公開は不要です。環境に合わせて HIVE_* の値を住めてください(設定 と上記のプリセットを参照)。
{
"mcpServers": {
"Hive": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/avelloal/hive-mcp-server@v0.1.0",
"hive-mcp-server"
],
"env": {
"HIVE_HOST": "<coordinator-hostname>.dw.cloudera.site",
"HIVE_PORT": "443",
"HIVE_DATABASE": "default",
"HIVE_USER": "<workload-username>",
"HIVE_PASSWORD": "<workload-password>",
"HIVE_AUTH_MECHANISM": "LDAP",
"HIVE_USE_HTTP_TRANSPORT": "true",
"HIVE_HTTP_PATH": "cliservice",
"HIVE_USE_SSL": "true"
}
}
}
}上記の例は CDP Public Cloud / CDW 向けです。ローカルまたは Kerberos ターゲットでは、上記のプリセット を参照して env 値を差し替えてください。 @v0.1.0 は固定リーすを指定します。外すと最新版を追従し、新しバージョンに上げられます。
Cloudera AI ng Agent Studio 固有の手順(登録手順、環境変数処理、stdio/uvx 制限)は、examples/agent-studio/ を参照。
Smoke test
ローカル HiveServer2 を起動(例: Apache Hive Docker イメージ):
docker run -d -p 10000:10000 apache/hive:3.1.3上記のローカルプリセットで
.envを設定します。サーバーを起動:
uv run hive-mcp-server別のターミナルで
fastmcpデB inspector または任意 MCP クライアントを使って両ツールを呼び出します:get_schema()—[]またはテーブル名の一覧が返るはずです。execute_query("SHOW DATABASES")— データベース一覧の JSON 配列が返るはずです。
License
Apache License 2.0 — LICENSE を参してください。# Apache Hive MCP Server
Apache Hive(HiveServer2)向けの MCP サーバーです。FastMCP で構築されており、オープンソースの Apache Hive、Cloudera CDP Base、Cloudera CDP Public Cloud(CDW)など、HiveServer2 互換の任意のエンドポイントに接続できます。LLM エージェントが呼び出せる読み取り専用ツールを2つ公開します。
Project summary
概要 — LLM エージェントが Apache Hive に対してテーブル一覧の取得や読み取り専用 SQL を実行できるようにする Model Context Protocol サーバーです。結果は JSON で返されます。
機能互換性 — Cloudera の Impala/Iceberg MCP server をミラーしています。
execute_queryとget_schemaのツールと構造は同じで、接続レイヤーがimpyla経由の HiveServer2 に置き換えられています。HiveServer2 が動作する環境ならどこでも動作 — オープンソースの Apache Hive、CDP Base(Kerberos/LDAP)、CDP Public Cloud / CDW(Knox、LDAP over HTTPS)に対応しています。認証、トランスポート、TLS はすべて
HIVE_*環境変数で制御されます。デフォルトで安全 —
execute_queryは読み取り専用プレフィクスガード(SELECT/SHOW/DESCRIBE/WITH)を適用します。書き込み・DLL 文はコネクションを開く前に拒否されます。Transport —
MCP_TRANSPORTで選択するstdio(デフォルト)、http、sse。技術スタック — Python ≥3.10、FastMCP、
impyla、uv。ユニットテストは11件(接続はモック — 実 Live Hive は不要)。
Tools
ツール | シグネチャ | 説明 |
|
| 読み取り専用 SQL クエリ(SELECT の、SHOW、DESCRIBE、WITH)を実执行し、結果をカラムキー付オブジェクトの JSON array で返します。書込み操作はエラー文字列で拒否されます。 |
|
| 設定したデータベースに対して |
Configuration
設定はすべて環境変数(または、プロジェクトルートの .env ファイル)で行います。
変数 | デフォルト | 説明 |
|
| HiveServer2 のホスト名または IP |
|
| HiveServer2 の Thrift ポ rt |
|
| 接続先のデータベース |
| (空) | ユーザー名(NOSASL/ Kerberos の場合は空のまま) |
| (空) | パスワード(PLAIN/LDAP で使) |
|
| 認証方式: |
|
| バイナリ thriift の代わりにHTTP transportを使用する |
|
|
|
|
| threift 接続の TLS を有効にする |
|
| Kerberos サービスの principal 名(GSSAPI のみ) |
|
| MCP トランスポート: |
.env.example を.env にコピーして値を記入してください。
デプロイメントプリセット
ローカル / 開発(Docker HiveServer2)
HIVE_HOST=localhost
HIVE_PORT=10000
HIVE_DATABASE=default
HIVE_AUTH_MECHANISM=NOSASL
MCP_TRANSPORT=stdioCDP Public Cloud(CDW Virtual Warehouse)
HIVE_HOST=<coordinator-hostname>.dw.cloudera.site
HIVE_PORT=443
HIVE_DATABASE=default
HIVE_USER=<workload-username>
HIVE_PASSWORD=<workload-password>
HIVE_AUTH_MECHANISM=LDAP
HIVE_USE_HTTP_TRANSPORT=true
HIVE_HTTP_PATH=cliservice
HIVE_USE_SSL=true
MCP_TRANSPORT=stdioCDP Base / オンプレミス(Kerberos)
HIVE_HOST=<hiveserver2-host.example.com>
HIVE_PORT=10000
HIVE_DATABASE=default
HIVE_AUTH_MECHANISM=GSSAPI
HIVE_KERBEROS_SERVICE_NAME=hive
MCP_TRANSPORT=stdioサーバーを起動する前には Kerberos チケット(
kinit)を取得しておいてください。
実行
# Install
pip install -e .
# or with uv:
uv sync
# Copy and edit config
cp .env.example .env
# Start (stdio transport, for use with an MCP host)
uv run hive-mcp-serverMCP クライアント設定
MCP ホスト(Claude Desktop、CAStudio など)は mcpServers JSON ブブロックでサーバーを登録します。uvx はこのサーバーを GitHub から直接実行できます。ローカルインストールや PyPI 公開は不要です。環境に合わせて HIVE_* 値を記入してください(設定 と上記のプリセットを参照)。
{
"mcpServers": {
"Hive": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/avelloal/hive-mcp-server@v0.1.0",
"hive-mcp-server"
],
"env": {
"HIVE_HOST": "<coordinator-hostname>.dw.cloudera.site",
"HIVE_PORT": "443",
"HIVE_DATABASE": "default",
"HIVE_USER": "<workload-username>",
"HIVE_PASSWORD": "<workload-password>",
"HIVE_AUTH_MECHANISM": "LDAP",
"HIVE_USE_HTTP_TRANSPORT": "true",
"HIVE_HTTP_PATH": "cliservice",
"HIVE_USE_SSL": "true"
}
}
}
}上記の例は CDP Public Cloud / CDW 向けです。ローカルや Kerberos の場合は、上記のプリセット を参照社 env の値を差し替ええてください。@v0.1.0 で固定リリースを指します。外れせば最新版を追従し、バージョンを上て新しいバージョンにできます。
Cloudera AI Agent Studio 固有の手続き(登録手順、env-var の取り扱い、stdio/uvx の制限)は、examples/agent-studio/ を参照してください。
Smoke test
ローカルの HiveServer2 を起動(例: Apach Hive Docker イメージ):
docker run -d -p 10000:10000 apache/hive:3.1.3上記のローカルプリセットで
.envを設定。サーバーを起動:
uv run hive-mcp-server二番目のターミナルで
fastmcpデブ・インスペクターまたは任意の MCP クライアントを使っつ、両方の tool を呼び出してください:get_schema()—[]またはテーブル名の一覧を返すはず。execute_query("SHOW DATABASES")— データベースの JSON 配列を返すはず。
ライセンス
Apache License 2.0 — LICENSE を参照してください。
Available Tools
2 toolsexecute_queryA
Execute a read-only SQL query on Hive and return results as JSON.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full behavioral burden. It usefully discloses that the tool is read-only and returns JSON, which are meaningful safety and output traits. However, it doesn't explain error behavior, query size limits, permission expectations, or how results are shaped.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence that front-loads the action, target, and output format. There is no wasted or redundant phrasing; every clause adds information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter tool with an output schema present, the description covers the essential usage context: the action, the data source, the read-only safety property, and the return format. It could add routing to get_schema, but the core invocation context is adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must carry parameter semantics. 'SQL query on Hive' clarifies that the query parameter should be a Hive SQL string, which adds meaning beyond the schema's bare 'query' field. But the description never mentions the parameter by name or provides syntax, limits, or examples.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Execute') and resource ('SQL query on Hive'), and also names the output format ('results as JSON'). It clearly distinguishes this tool from the sibling get_schema, which is about schema retrieval rather than running queries.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no explicit guidance about when to use this tool versus get_schema, or when not to use it. The 'read-only' qualifier is a constraint, but it doesn't describe alternatives or usage scenarios beyond what the description literally states.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_schemaA
List the table names in the current Hive database.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the disclosure burden. It communicates a read-only, list-style behavior and the scope to the current Hive database, but it does not mention return format, potential limitations, or side effects. For such a simple zero-parameter read operation, this is adequate but not richly transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single-front-loaded sentence communicates the core action and target resource with no superfluous words. Every part of the description adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no parameters and an output schema is provided, so the description only needs to specify what is listed and in what context. The single sentence fully covers that for a minimal introspection operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The parameter count is 0, so there is no semantic burden on the description. The description accurately describes what the tool will produce, and no parameter-related information is required beyond the schema's empty object.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('List'), identifies the exact resource ('table names'), and scopes it to the 'current Hive database.' This clearly distinguishes it from the sibling tool execute_query, which focuses on running queries rather than returning schema metadata.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description makes the tool's purpose obvious: use it when you need the list of table names in the current Hive database. However, it does not explicitly contrast this with execute_query or state when to prefer one over the other, leaving the routing decision somewhat implied.
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.
2 tool updates
v0.1.0- First observed
execute_query - First observed
get_schema
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one executes SQL queries, the other lists table names. There is no overlap or ambiguity between them.
Both tool names follow a consistent snake_case verb_noun pattern: execute_query and get_schema. The naming is predictable and easy to extend.
Two tools is on the thin side for a full Apache Hive server, though the set is minimal and comprehensible. It feels borderline but not absurdly incomplete.
The set covers basic querying and table listing, but lacks explicit schema/column detail, database selection, and non-query operations. An agent can partially work around this via execute_query, but there are notable gaps.
Maintenance
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
- dataOAuthco.thinair
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Query your org's data in natural language — read-only MCP access to SQL, NoSQL, files & warehouses.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables LLM agents to query and explore Cloudera Hive virtual warehouses through tools like list_databases, list_tables, describe_table, get_table_sample, and execute_query with read-only safety.5-
- AlicenseAqualityCmaintenanceEnables AI agents to safely query and explore Apache Impala clusters with read-only SQL, metadata, statistics, cluster overview, and analysis prompt templates.17Apache 2.0
- FlicenseNot gradedqualityAmaintenanceEnables LLMs to inspect database schemas and execute SQL queries, including listing tables and describing table schemas.-
- FlicenseNot gradedqualityAmaintenanceEnables LLMs to inspect database schemas and execute SQL queries, including listing tables and describing table schemas.-