Skip to content

[#12129] feat(mcp-server): add read tools for views#12130

Draft
bharos wants to merge 1 commit into
apache:mainfrom
bharos:add-mcp-view-read-tools-12129
Draft

[#12129] feat(mcp-server): add read tools for views#12130
bharos wants to merge 1 commit into
apache:mainfrom
bharos:add-mcp-view-read-tools-12129

Conversation

@bharos

@bharos bharos commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add two read-only MCP tools for views:

  • list_of_views(catalog, schema) — lists the views in a schema.
  • load_view(catalog, schema, view) — returns the full metadata of a view
    (columns, SQL representations, default catalog/schema, properties, audit).

They follow the existing metadata-type pattern (interface → plain REST client →
FastMCP tool → mock + unit tests). All user-supplied path segments are
URL-encoded, and authorization is enforced by Gravitino, so no filtering logic is
added in the MCP layer.

Why are the changes needed?

Views round out read coverage for relational catalogs. Unlike partitions
(Hive-only), views are supported by both the Hive and the lakehouse-iceberg
catalogs (IcebergCatalog.asViewCatalog()), so this is useful for Iceberg
deployments too.

Fix: #12129

Does this PR introduce any user-facing change?

Yes — two new MCP tools (list_of_views, load_view), tagged view.

How was this patch tested?

Added unit tests for the tools (test_view.py) and for URL-encoding of the view
endpoints (test_url_encoding.py). Full unit suite passes (161 tests); black
and pylint (10/10) are clean.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

Code Coverage Report

Overall Project 67.78% 🟢
Files changed No Java source files changed -

Module Coverage
aliyun 1.72% 🔴
api 47.82% 🟢
authorization-common 85.96% 🟢
aws 42.04% 🟢
azure 2.47% 🔴
catalog-common 9.92% 🔴
catalog-fileset 79.74% 🟢
catalog-glue 66.91% 🟢
catalog-hive 79.4% 🟢
catalog-jdbc-common 45.7% 🟢
catalog-jdbc-doris 81.72% 🟢
catalog-jdbc-mysql 79.33% 🟢
catalog-jdbc-postgresql 83.39% 🟢
catalog-jdbc-starrocks 79.16% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 59.18% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 85.86% 🟢
catalog-lakehouse-paimon 84.23% 🟢
catalog-model 77.72% 🟢
cli 44.5% 🟢
client-java 78.27% 🟢
common 51.95% 🟢
core 82.55% 🟢
filesystem-hadoop3 77.28% 🟢
flink 0.0% 🔴
flink-common 47.09% 🟢
flink-runtime 0.0% 🔴
gcp 14.12% 🔴
hadoop-auth 68.0% 🟢
hadoop-common 12.7% 🔴
hive-metastore-common 53.4% 🟢
iceberg-common 64.65% 🟢
iceberg-rest-server 74.99% 🟢
idp-basic 86.02% 🟢
integration-test-common 0.0% 🔴
jobs 66.17% 🟢
lance-common 20.67% 🔴
lance-rest-server 64.84% 🟢
lineage 53.02% 🟢
optimizer 83.24% 🟢
optimizer-api 21.95% 🔴
server 86.05% 🟢
server-common 76.12% 🟢
spark 28.57% 🔴
spark-common 46.01% 🟢
tencent 69.84% 🟢
trino-connector 40.29% 🟢

@bharos
bharos force-pushed the add-mcp-view-read-tools-12129 branch from 8e14177 to 92dc7cf Compare July 22, 2026 04:45
@bharos bharos self-assigned this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Subtask] feat(mcp-server): read tools for views (list/load)

1 participant