You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "yuqi1129 (via GitHub)" <gi...@apache.org> on 2026/06/16 02:38:46 UTC
[PR] [#11662] docs(mcp-server): document auth, per-request identity, TLS and audit logging [gravitino]
yuqi1129 opened a new pull request, #11663:
URL: https://github.com/apache/gravitino/pull/11663
### What changes were proposed in this pull request?
Document the MCP server's authentication and audit features in `docs/gravitino-mcp-server.md`:
- New **Authentication** section: static `--token`/`GRAVITINO_TOKEN`, per-request `Authorization` forwarding in HTTP mode (Bearer/Basic, identity isolation, authorization enforced by Gravitino), and serving over HTTPS with `--tls-cert`/`--tls-key`.
- New **Audit Logging** section: the `gravitino-mcp-audit.log` JSON record format and principal derivation.
- Updated the **Configuration** table with `--token`, `--tls-cert`, `--tls-key`, and the `streamable-http` transport alias.
> **Note:** This PR documents features implemented in #11622, which is not yet merged. It should be merged **after** #11622 lands so the docs do not describe unreleased behavior.
### Why are the changes needed?
These features were added under EPIC #11573 (implementation in #11622) but were undocumented, so users had no guidance on authenticating the MCP server or reading its audit trail.
### Does this PR introduce _any_ user-facing change?
Documentation only.
### How was this patch tested?
Documentation change; no code. Verified the Markdown tables and sections render correctly.
Fix: #11662
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11662] docs(mcp-server): document auth, per-request identity, TLS and audit logging [gravitino]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #11663:
URL: https://github.com/apache/gravitino/pull/11663#discussion_r3417803748
##########
docs/gravitino-mcp-server.md:
##########
@@ -103,9 +103,63 @@ Gravitino MCP server supports the following tools, and you could export tool by
You could config Gravitino MCP server by arguments, `uv run mcp_server -h` shows the detailed information.
-| Argument | Description | Default value | Required | Since version |
-|-------------------|-----------------------------------------------------------------|-----------------------------|----------|---------------|
-| `--metalake` | The Gravitino metalake name. | none | Yes | 1.0.0 |
-| `--gravitino-uri` | The URI of Gravitino server. | `http://127.0.0.1:8090` | No | 1.0.0 |
-| `--transport` | Transport protocol type: stdio (local), http (Streamable HTTP). | `stdio` | No | 1.0.0 |
-| `--mcp-url` | The url of MCP server if using http transport. | `http://127.0.0.1:8000/mcp` | No | 1.0.0 |
+| Argument | Description | Default value | Required | Since version |
+|-------------------|----------------------------------------------------------------------------------|-----------------------------|----------|---------------|
+| `--metalake` | The Gravitino metalake name. | none | Yes | 1.0.0 |
+| `--gravitino-uri` | The URI of Gravitino server. | `http://127.0.0.1:8090` | No | 1.0.0 |
+| `--transport` | Transport protocol: stdio (local), http / streamable-http (Streamable HTTP). | `stdio` | No | 1.0.0 |
+| `--mcp-url` | The url of MCP server if using http transport. | `http://127.0.0.1:8000/mcp` | No | 1.0.0 |
Review Comment:
In the configuration table, "url" and "http" should be capitalized as the standard acronyms (URL/HTTP) for consistency and readability.
##########
docs/gravitino-mcp-server.md:
##########
@@ -103,9 +103,63 @@ Gravitino MCP server supports the following tools, and you could export tool by
You could config Gravitino MCP server by arguments, `uv run mcp_server -h` shows the detailed information.
-| Argument | Description | Default value | Required | Since version |
-|-------------------|-----------------------------------------------------------------|-----------------------------|----------|---------------|
-| `--metalake` | The Gravitino metalake name. | none | Yes | 1.0.0 |
-| `--gravitino-uri` | The URI of Gravitino server. | `http://127.0.0.1:8090` | No | 1.0.0 |
-| `--transport` | Transport protocol type: stdio (local), http (Streamable HTTP). | `stdio` | No | 1.0.0 |
-| `--mcp-url` | The url of MCP server if using http transport. | `http://127.0.0.1:8000/mcp` | No | 1.0.0 |
+| Argument | Description | Default value | Required | Since version |
+|-------------------|----------------------------------------------------------------------------------|-----------------------------|----------|---------------|
+| `--metalake` | The Gravitino metalake name. | none | Yes | 1.0.0 |
+| `--gravitino-uri` | The URI of Gravitino server. | `http://127.0.0.1:8090` | No | 1.0.0 |
+| `--transport` | Transport protocol: stdio (local), http / streamable-http (Streamable HTTP). | `stdio` | No | 1.0.0 |
+| `--mcp-url` | The url of MCP server if using http transport. | `http://127.0.0.1:8000/mcp` | No | 1.0.0 |
+| `--token` | OAuth2 Bearer token for Gravitino; or set `GRAVITINO_TOKEN`. See Authentication. | none (anonymous) | No | 1.3.0 |
+| `--tls-cert` | PEM certificate to serve the endpoint over HTTPS. Requires `--tls-key`. | none | No | 1.3.0 |
+| `--tls-key` | PEM private key to serve the endpoint over HTTPS. Requires `--tls-cert`. | none | No | 1.3.0 |
+
+## Authentication
+
+By default the MCP server talks to Gravitino anonymously. There are two ways to attach an identity, depending on the transport.
+
+### Static startup token (stdio and HTTP)
+
+Pass `--token` (or set the `GRAVITINO_TOKEN` environment variable) to authenticate the server with a static OAuth2 Bearer token. The value is treated as a Bearer token and sent as `Authorization: Bearer <token>`. The token is masked in the server's log output.
+
+```shell
+uv run mcp_server --metalake test --gravitino-uri http://127.0.0.1:8090 --token <your-token>
+# or
+export GRAVITINO_TOKEN=<your-token>
+uv run mcp_server --metalake test --gravitino-uri http://127.0.0.1:8090
+```
+
+In `stdio` mode this token is used for every request. In HTTP mode it is only the fallback, used when an incoming request does not carry its own `Authorization` header.
+
+### Per-request identity (HTTP)
+
+When the server runs with HTTP transport, the `Authorization` header of each incoming MCP request is forwarded verbatim to Gravitino. The scheme is preserved, so OAuth2 (`Bearer`), Gravitino simple authentication (`Basic <base64(user:dummy)>`) and others all work. This keeps concurrent sessions from different principals isolated — one principal's identity never leaks into another's calls — and lets Gravitino enforce authorization per caller. The per-request header takes priority over the static `--token`.
+
+Authorization itself is always enforced by Gravitino: the MCP server forwards the identity but does not make access-control decisions of its own.
+
+### Serving over HTTPS (TLS)
+
+To serve the HTTP endpoint over TLS, provide both `--tls-cert` and `--tls-key` and use an `https://` `--mcp-url`. The certificate and key must be provided together, and the URL scheme must match the TLS setting (an `https://` URL without a cert/key, or a cert/key behind an `http://` URL, is rejected at startup).
Review Comment:
The TLS section refers to "the HTTP endpoint", but this doc describes two endpoints (`--mcp-url` vs `--gravitino-uri`). Clarifying that TLS applies to the MCP HTTP endpoint (and not the Gravitino URI) will reduce confusion for readers.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11662] docs(mcp-server): document auth, per-request identity, TLS and audit logging [gravitino]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #11663:
URL: https://github.com/apache/gravitino/pull/11663#issuecomment-4714761580
<!-- coverage-report -->
### Code Coverage Report
|Overall Project|67.02% **`-0.07%`**|:green_circle:|
|:-|:-|:-:|
|Files changed|28.57%|:red_circle:|
<br>
|Module|Coverage||
|:-|:-|:-:|
|aliyun|1.72%|:red_circle:|
|api|46.82%|:green_circle:|
|authorization-common|85.96%|:green_circle:|
|aws|3.66%|:red_circle:|
|azure|2.47%|:red_circle:|
|catalog-common|10.4%|:red_circle:|
|catalog-fileset|80.23%|:green_circle:|
|catalog-glue|66.91%|:green_circle:|
|catalog-hive|79.44%|:green_circle:|
|catalog-jdbc-clickhouse|80.02%|:green_circle:|
|catalog-jdbc-common|44.22%|:green_circle:|
|catalog-jdbc-doris|80.28%|:green_circle:|
|catalog-jdbc-hologres|54.03%|:green_circle:|
|catalog-jdbc-mysql|79.23%|:green_circle:|
|catalog-jdbc-oceanbase|78.38%|:green_circle:|
|catalog-jdbc-postgresql|82.29%|:green_circle:|
|catalog-jdbc-starrocks|78.51%|:green_circle:|
|catalog-kafka|77.01%|:green_circle:|
|catalog-lakehouse-generic|58.53%|:green_circle:|
|catalog-lakehouse-hudi|79.1%|:green_circle:|
|catalog-lakehouse-iceberg|85.86%|:green_circle:|
|catalog-lakehouse-paimon|80.02%|:green_circle:|
|catalog-model|77.72%|:green_circle:|
|cli|44.51%|:green_circle:|
|client-java|78.01%|:green_circle:|
|common|50.17%|:green_circle:|
|core|82.38%|:green_circle:|
|filesystem-hadoop3|77.27%|:green_circle:|
|flink|0.0%|:red_circle:|
|flink-common|46.25% **`-1.85%`**|:green_circle:|
|flink-runtime|0.0%|:red_circle:|
|gcp|14.12%|:red_circle:|
|hadoop-common|10.88%|:red_circle:|
|hive-metastore-common|53.77%|:green_circle:|
|iceberg-common|58.15%|:green_circle:|
|iceberg-rest-server|73.92%|:green_circle:|
|idp-basic|86.18%|:green_circle:|
|integration-test-common|0.0%|:red_circle:|
|jobs|66.17%|:green_circle:|
|lance-common|20.83%|:red_circle:|
|lance-rest-server|60.54%|:green_circle:|
|lineage|53.02%|:green_circle:|
|optimizer|82.87%|:green_circle:|
|optimizer-api|21.95%|:red_circle:|
|server|85.73%|:green_circle:|
|server-common|73.79%|:green_circle:|
|spark|28.57%|:red_circle:|
|spark-common|41.66%|:green_circle:|
|trino-connector|40.13%|:green_circle:|
<details>
<summary>Files</summary>
|Module|File|Coverage||
|:-|:-|:-|:-:|
|flink-common|[IcebergPropertiesConverter.java](https://github.com/yuqi1129/gravitino/blob/0c7ebb12a8deea3ccb32d6cc8eb8fb15f3013ac7/flink-connector/flink-common/src/main/java/org/apache/gravitino/flink/connector/iceberg/IcebergPropertiesConverter.java)|91.67%|:green_circle:|
||[GravitinoIcebergCatalogFactory.java](https://github.com/yuqi1129/gravitino/blob/0c7ebb12a8deea3ccb32d6cc8eb8fb15f3013ac7/flink-connector/flink-common/src/main/java/org/apache/gravitino/flink/connector/iceberg/GravitinoIcebergCatalogFactory.java)|34.38%|:red_circle:|
||[GravitinoCatalogManager.java](https://github.com/yuqi1129/gravitino/blob/0c7ebb12a8deea3ccb32d6cc8eb8fb15f3013ac7/flink-connector/flink-common/src/main/java/org/apache/gravitino/flink/connector/catalog/GravitinoCatalogManager.java)|20.0%|:red_circle:|
</details>
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11662] docs(mcp-server): document auth, per-request identity, TLS and audit logging [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao merged PR #11663:
URL: https://github.com/apache/gravitino/pull/11663
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org