bharos commented on issue #12129:
URL: https://github.com/apache/gravitino/issues/12129#issuecomment-5055509650

   Verified the two view read tools end-to-end against a **real Iceberg view** 
(Gravitino playground, `catalog_iceberg` = lakehouse-iceberg / JDBC backend), 
driving the MCP server over the **Streamable-HTTP transport** with a real MCP 
client (`fastmcp.Client`, `transport = StreamableHttpTransport`).
   
   **Setup** (Iceberg view created via the Gravitino REST API):
   
   ```
   schema  : catalog_iceberg.mcp_test
   view    : mcp_view_test
   columns : id INT, label STRING
   sql     : SELECT 1 AS id, 'alpha' AS label   (dialect: spark)
   ```
   
   **Client-side results (over the wire):**
   
   - `list_of_views` → 
`[{"namespace":["metalake_demo","catalog_iceberg","mcp_test"],"name":"mcp_view_test"}]`
   - `load_view` → full view metadata: columns (`id:integer`, `label:string`), 
`representations:[{type:sql, dialect:spark, sql:"SELECT 1 AS id, 'alpha' AS 
label"}]`, `defaultCatalog`/`defaultSchema`, properties, and audit info.
   
   **Server-side proof — MCP protocol traffic** (the server logged each 
`tools/call` with the tool name, arguments, and timing, alongside the uvicorn 
HTTP access lines):
   
   ```
   INFO event=request_start  method=initialize source=client
   INFO:  127.0.0.1 - "POST /mcp HTTP/1.1" 200 OK
   
   INFO event=request_start  method=tools/list source=client
   INFO:  127.0.0.1 - "POST /mcp HTTP/1.1" 200 OK
   
   INFO event=request_start  method=tools/call source=client
        
payload={"name":"list_of_views","arguments":{"catalog_name":"catalog_iceberg","schema_name":"mcp_test"}}
   INFO Request tools/call completed in 66.75ms
   INFO:  127.0.0.1 - "POST /mcp HTTP/1.1" 200 OK
   
   INFO event=request_start  method=tools/call source=client
        
payload={"name":"load_view","arguments":{"catalog_name":"catalog_iceberg","schema_name":"mcp_test","view_name":"mcp_view_test"}}
   INFO Request tools/call completed in 65.92ms
   INFO:  127.0.0.1 - "POST /mcp HTTP/1.1" 200 OK
   ```
   
   **Server-side proof — audit log** (each dispatch recorded by the audit 
middleware):
   
   ```json
   {"timestamp": "2026-07-23T07:07:29.319054+00:00", "principal": "anonymous", 
"tool": "list_of_views", "outcome": "allow"}
   {"timestamp": "2026-07-23T07:07:29.394495+00:00", "principal": "anonymous", 
"tool": "load_view",     "outcome": "allow"}
   ```
   
   (`principal: anonymous` because the local playground runs without auth.)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to