You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "FANNG1 (via GitHub)" <gi...@apache.org> on 2025/08/03 02:34:10 UTC
[PR] [SIP] Support Gravitino MCP server [gravitino]
FANNG1 opened a new pull request, #7905:
URL: https://github.com/apache/gravitino/pull/7905
<!--
1. Title: [#<issue>] <type>(<scope>): <subject>
Examples:
- "[#123] feat(operator): support xxx"
- "[#233] fix: check null before access result in xxx"
- "[MINOR] refactor: fix typo in variable name"
- "[MINOR] docs: fix typo in README"
- "[#255] test: fix flaky test NameOfTheTest"
Reference: https://www.conventionalcommits.org/en/v1.0.0/
2. If the PR is unfinished, please mark this PR as draft.
-->
### What changes were proposed in this pull request?
(Please outline the changes and how this PR fixes the issue.)
### Why are the changes needed?
(Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, describe the bug.)
Fix: #(issue)
### Does this PR introduce _any_ user-facing change?
(Please list the user-facing changes introduced by your change, including
1. Change in user-facing APIs.
2. Addition or removal of property keys.)
### How was this patch tested?
(Please test your changes, and provide instructions on how to test it:
1. If you add a feature or fix a bug, add a test to cover your changes.
2. If you fix a flaky test, repeat it for many times to prove it works.)
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2256624628
##########
mcp-server/mcp_server/connector/rest/rest_client_schema_operation.py:
##########
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from httpx import AsyncClient
+
+from mcp_server.connector import SchemaOperation
+from mcp_server.connector.rest.utils import extract_content_from_response
+
+
+class RESTClientSchemaOperation(SchemaOperation):
+ def __init__(self, metalake_name: str, rest_client: AsyncClient):
+ self.metalake_name = metalake_name
+ self.rest_client = rest_client
+
+ async def get_list_of_schemas(self, catalog_name: str) -> str:
+ response = await self.rest_client.get(
+ f"/api/metalakes/{self.metalake_name}/catalogs/{catalog_name}/schemas"
+ )
+ return extract_content_from_response(response, "identifiers", [])
Review Comment:
For MCP server, is one field `identifiers ` enough? Why don't you return all the information here? do you have any further consideration?
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "shaofengshi (via GitHub)" <gi...@apache.org>.
shaofengshi commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2259293634
##########
docs/gravitino-mcp-server.md:
##########
@@ -0,0 +1,74 @@
+---
+title: "Gravitino MCP server"
+slug: /gravitino-mcp-server
+keyword: Gravitino MCP metadata
+license: "This software is licensed under the Apache License version 2."
+---
+
+Gravitino MCP server provides the ability to manage Gravitino metadata for LLM.
+
+### Requirement:
+
+1. Python 3.10+
+2. uv is installed. You can install uv by following the [official guide](https://docs.astral.sh/uv/getting-started/installation/).
+
+### How to run:
+
+1. Clone the code from GitHub, and change to `mcp-server` directory
+2. Create virtual environment, `uv venv`
+3. Install the required Python packages. `uv pip install -e .`
+4. Add Gravitino MCP server to corresponding LLM tools. Take `cursor` for example, edit `~/.cursor/mcp.json`, use following configuration for local Gravitino MCP server:
+
+```json
+{
+ "mcpServers": {
+ "gravitino": {
+ "command": "uv",
+ "args": [
+ "--directory",
+ "$path/mcp-server",
+ "run",
+ "mcp_server",
+ "--metalake",
+ "test",
+ "--uri",
+ "http://127.0.0.1:8090"
+ ]
+ }
+ }
+}
+```
+
+Or start a HTTP MCP server by `uv run mcp_server --metalake test --uri http://127.0.0.1:8090 --transport http --mcp-url http://localhost:8000/mcp`, and use the configuration:
+
+```json
+{
+ "mcpServers": {
+ "gravitino": {
+ "url": "http://localhost:1234/mcp1"
Review Comment:
it is configured with `--mcp-url` parameter
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "shaofengshi (via GitHub)" <gi...@apache.org>.
shaofengshi commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2258806243
##########
mcp-server/README.md:
##########
@@ -0,0 +1,64 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+Gravitino MCP server provides the ability to manage Gravitino metadata for LLM.
+
+### Requirement:
+
+1. Python 3.10+
+2. uv is installed. You can install uv by following the [official guide](https://docs.astral.sh/uv/getting-started/installation/).
+
+### How to run:
+
+1. Clone the code from GitHub, and change to `mcp-server` directory
+2. Create virtual environment, `uv venv`
+3. Install the required Python packages. `uv pip install -e .`
+4. Add Gravitino MCP server to corresponding LLM tools. Take `cursor` for example, edit `~/.cursor/mcp.json`, use following configuration for local Gravitino MCP server:
+
+```json
+{
+ "mcpServers": {
+ "gravitino": {
+ "command": "uv",
+ "args": [
+ "--directory",
+ "$path/mcp-server",
+ "run",
+ "mcp_server",
+ "--metalake",
+ "test",
+ "--uri",
+ "http://127.0.0.1:8090"
+ ]
+ }
+ }
+}
+```
+
+Or start HTTP MCP server by `uv run mcp_server --metalake test --uri http://127.0.0.1:8090 --transport http --mcp-url http://localhost:8000/mcp`, and use the configuration:
+
+```json
+{
+ "mcpServers": {
+ "gravitino": {
+ "url": "http://localhost:1234/mcp1"
Review Comment:
the same comment as the above one. besides, keep two documents seems be odd, when we make a change, need to update in two places.
--
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] [#7561] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2256462225
##########
mcp-server/uv.lock:
##########
@@ -0,0 +1,938 @@
+version = 1
+revision = 2
Review Comment:
It's created automatically. Most Python projects include this file, it's requried.
--
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] [#7561] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2256498056
##########
mcp-server/mcp_server/tools/table.py:
##########
@@ -0,0 +1,227 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from fastmcp import Context, FastMCP
+
+
+def load_table_tools(mcp: FastMCP):
+ @mcp.tool(tags={"table"})
Review Comment:
It dependes on how should we export tools, in some senerios , the user may doesn't want to use table tools but use policy, tag tools.
##########
mcp-server/mcp_server/server.py:
##########
@@ -0,0 +1,117 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import asyncio
+import logging
+import re
+from contextlib import asynccontextmanager
+from typing import AsyncIterator
+from urllib.parse import urlparse
+
+from fastmcp import FastMCP
+from fastmcp.server.middleware.error_handling import ErrorHandlingMiddleware
+from fastmcp.server.middleware.logging import (
+ LoggingMiddleware,
+)
+from fastmcp.server.middleware.timing import TimingMiddleware
+
+from mcp_server.core.context import GravitinoContext
+from mcp_server.core.setting import Setting
+from mcp_server.tools import load_tools
+
+
+def create_lifespan_manager(gravitino_context: GravitinoContext):
+
+ @asynccontextmanager
+ async def app_lifespan(server: FastMCP) -> AsyncIterator[GravitinoContext]:
+ logging.info(f"Add Gravitino context: {gravitino_context}")
+ yield gravitino_context
+
+ return app_lifespan
+
+
+def create_gravition_mcp(setting: Setting) -> FastMCP:
Review Comment:
updated
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "shaofengshi (via GitHub)" <gi...@apache.org>.
shaofengshi commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2258800918
##########
docs/gravitino-mcp-server.md:
##########
@@ -0,0 +1,74 @@
+---
+title: "Gravitino MCP server"
+slug: /gravitino-mcp-server
+keyword: Gravitino MCP metadata
+license: "This software is licensed under the Apache License version 2."
+---
+
+Gravitino MCP server provides the ability to manage Gravitino metadata for LLM.
+
+### Requirement:
+
+1. Python 3.10+
+2. uv is installed. You can install uv by following the [official guide](https://docs.astral.sh/uv/getting-started/installation/).
+
+### How to run:
+
+1. Clone the code from GitHub, and change to `mcp-server` directory
+2. Create virtual environment, `uv venv`
+3. Install the required Python packages. `uv pip install -e .`
+4. Add Gravitino MCP server to corresponding LLM tools. Take `cursor` for example, edit `~/.cursor/mcp.json`, use following configuration for local Gravitino MCP server:
+
+```json
+{
+ "mcpServers": {
+ "gravitino": {
+ "command": "uv",
+ "args": [
+ "--directory",
+ "$path/mcp-server",
+ "run",
+ "mcp_server",
+ "--metalake",
+ "test",
+ "--uri",
+ "http://127.0.0.1:8090"
+ ]
+ }
+ }
+}
+```
+
+Or start a HTTP MCP server by `uv run mcp_server --metalake test --uri http://127.0.0.1:8090 --transport http --mcp-url http://localhost:8000/mcp`, and use the configuration:
+
+```json
+{
+ "mcpServers": {
+ "gravitino": {
+ "url": "http://localhost:1234/mcp1"
Review Comment:
it it better to make this url be consistent with the above one "http://localhost:8000/mcp"?
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao merged PR #7905:
URL: https://github.com/apache/gravitino/pull/7905
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "shaofengshi (via GitHub)" <gi...@apache.org>.
shaofengshi commented on PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#issuecomment-3166817193
> @shaofengshi do you want to take another look?
LGTM, thanks!
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2259320591
##########
mcp-server/mcp_server/connector/factory.py:
##########
@@ -0,0 +1,52 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from mcp_server.connector.rest.rest_client_operation import RESTClientOperation
+
+
+class ConnectorFactory:
Review Comment:
The concept of `connector` is a bit strange, do we have a better name?
--
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] [#7561] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2256196814
##########
mcp-server/mcp_server/tools/table.py:
##########
@@ -0,0 +1,227 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from fastmcp import Context, FastMCP
+
+
+def load_table_tools(mcp: FastMCP):
+ @mcp.tool(tags={"table"})
Review Comment:
I'm not entirely sure if this type of division is correct. We need to support more tags like model, fileset, topic, etc.
##########
mcp-server/mcp_server/server.py:
##########
@@ -0,0 +1,117 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import asyncio
+import logging
+import re
+from contextlib import asynccontextmanager
+from typing import AsyncIterator
+from urllib.parse import urlparse
+
+from fastmcp import FastMCP
+from fastmcp.server.middleware.error_handling import ErrorHandlingMiddleware
+from fastmcp.server.middleware.logging import (
+ LoggingMiddleware,
+)
+from fastmcp.server.middleware.timing import TimingMiddleware
+
+from mcp_server.core.context import GravitinoContext
+from mcp_server.core.setting import Setting
+from mcp_server.tools import load_tools
+
+
+def create_lifespan_manager(gravitino_context: GravitinoContext):
+
+ @asynccontextmanager
+ async def app_lifespan(server: FastMCP) -> AsyncIterator[GravitinoContext]:
+ logging.info(f"Add Gravitino context: {gravitino_context}")
+ yield gravitino_context
+
+ return app_lifespan
+
+
+def create_gravition_mcp(setting: Setting) -> FastMCP:
Review Comment:
Typo gravition
##########
mcp-server/README.md:
##########
@@ -0,0 +1,63 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+Gravitino MCP server provides the ability to manage Gravitino metadata for LLM.
+
+### Requirement:
+
+1. Python 3.10+
+2. uv is installed. You can install uv by following the [official guide](https://docs.astral.sh/uv/getting-started/installation/).
+
+### How to run:
+
+1. Clone the code from GitHub, and change to `mcp-server` directory
+2. Create virtual environment, `uv venv`
+3. Install the required Python packages. `uv pip install -e .`
+4. Add Gravitino MCP server to corresponding LLM tools, use local MCP server like:
Review Comment:
You should include detailed steps for how users can use it, for example, how we use it in cursor, goole, .etc.
##########
mcp-server/uv.lock:
##########
@@ -0,0 +1,938 @@
+version = 1
+revision = 2
Review Comment:
Is this file created manually? it's too big to mantain
--
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] [#7561] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#issuecomment-3149029699
@jerryshao @shaofengshi PTAL, thx
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2259260065
##########
docs/gravitino-mcp-server.md:
##########
@@ -0,0 +1,74 @@
+---
+title: "Gravitino MCP server"
+slug: /gravitino-mcp-server
+keyword: Gravitino MCP metadata
+license: "This software is licensed under the Apache License version 2."
+---
+
+Gravitino MCP server provides the ability to manage Gravitino metadata for LLM.
+
+### Requirement:
+
+1. Python 3.10+
+2. uv is installed. You can install uv by following the [official guide](https://docs.astral.sh/uv/getting-started/installation/).
+
+### How to run:
+
+1. Clone the code from GitHub, and change to `mcp-server` directory
+2. Create virtual environment, `uv venv`
+3. Install the required Python packages. `uv pip install -e .`
+4. Add Gravitino MCP server to corresponding LLM tools. Take `cursor` for example, edit `~/.cursor/mcp.json`, use following configuration for local Gravitino MCP server:
+
+```json
+{
+ "mcpServers": {
+ "gravitino": {
+ "command": "uv",
+ "args": [
+ "--directory",
+ "$path/mcp-server",
+ "run",
+ "mcp_server",
+ "--metalake",
+ "test",
+ "--uri",
+ "http://127.0.0.1:8090"
+ ]
+ }
+ }
+}
+```
+
+Or start a HTTP MCP server by `uv run mcp_server --metalake test --uri http://127.0.0.1:8090 --transport http --mcp-url http://localhost:8000/mcp`, and use the configuration:
+
+```json
+{
+ "mcpServers": {
+ "gravitino": {
+ "url": "http://localhost:1234/mcp1"
Review Comment:
How to configure the port of mcp server?
--
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] [#7561] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2256491238
##########
mcp-server/README.md:
##########
@@ -0,0 +1,63 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+Gravitino MCP server provides the ability to manage Gravitino metadata for LLM.
+
+### Requirement:
+
+1. Python 3.10+
+2. uv is installed. You can install uv by following the [official guide](https://docs.astral.sh/uv/getting-started/installation/).
+
+### How to run:
+
+1. Clone the code from GitHub, and change to `mcp-server` directory
+2. Create virtual environment, `uv venv`
+3. Install the required Python packages. `uv pip install -e .`
+4. Add Gravitino MCP server to corresponding LLM tools, use local MCP server like:
Review Comment:
Different LLM tools may have different ways to add MCP server configuration, but they all use the same mcp server configurations as my test for cursor, claud, trae. Adding such detailed steps for diverse LLMs is not a good way and hard to maintance, may be we could use one LLM tools as example, WDYT?
--
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] [#7561] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#issuecomment-3158673332
> FAILURE: Build failed with an exception.
>
> * What went wrong:
> Execution failed for task ':mcp-server:checkSystemPython'.
>
> > Python version 3.9 is too old. Requires Python >= 3.10. Found: Python 3.9.6
>
> The module depends on the Python version installed on the compiling machine physicall, which is not user-friendly, I don't think it's easy to upgrade the python version of my Mac.
I had removed the python check, and uv venv will automatically download the requried python, could you check it?
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2259591108
##########
mcp-server/build.gradle.kts:
##########
@@ -0,0 +1,274 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.gradle.api.GradleException
+import org.gradle.api.tasks.Delete
+import org.gradle.api.tasks.Exec
+import org.gradle.kotlin.dsl.register
+import java.io.File
+
+val pythonProjectDir = project.projectDir
+val venvDir = pythonProjectDir.resolve(".venv")
+
+val globalUvExecutable = when {
+ System.getProperty("os.name").contains("win", ignoreCase = true) -> "uv.exe"
+ else -> "uv"
+}
+
+fun getUvExecutable(): String {
+ return if (project.extensions.extraProperties.has("uvExecutable")) {
+ project.extensions.extraProperties.get("uvExecutable") as String
+ } else {
+ globalUvExecutable
+ }
+}
+
+val venvPython = when {
+ System.getProperty("os.name").contains("win", ignoreCase = true) ->
+ venvDir.resolve("Scripts/python.exe").absolutePath
+ else ->
+ venvDir.resolve("bin/python").absolutePath
+}
+
+tasks {
+ register<Exec>("installUv") {
+ group = "python"
+ description = "Install UV if not present"
+
+ val isWindows = System.getProperty("os.name").contains("win", ignoreCase = true)
+ val uvInstallDir = file("$pythonProjectDir/.uv/bin").apply { mkdirs() }
+ val uvExecutable = if (isWindows) {
+ file("$uvInstallDir/uv.exe")
+ } else {
+ file("$uvInstallDir/uv")
+ }
+
+ onlyIf {
+ if (uvExecutable.exists()) {
+ project.extensions.extraProperties.set("uvExecutable", uvExecutable.absolutePath)
+ logger.lifecycle("UV already installed at: ${uvExecutable.absolutePath}")
+ false
+ } else {
+ try {
+ exec {
+ commandLine(globalUvExecutable, "--version")
+ isIgnoreExitValue = true
+ }.exitValue != 0
+ } catch (e: Exception) {
+ true
+ }
+ }
+ }
+
+ doFirst {
+ logger.lifecycle("UV not found, installing via official script...")
+ }
+
+ if (isWindows) {
+ commandLine(
+ "powershell",
+ "-Command",
+ "\$env:UV_INSTALL_DIR='${uvInstallDir.absolutePath}'; " +
+ "irm https://astral.sh/uv/install.ps1 | iex"
+ )
+ } else {
+ commandLine(
+ "/bin/sh",
+ "-c",
+ "export UV_INSTALL_DIR=${uvInstallDir.absolutePath}; " +
+ "curl -LsSf https://astral.sh/uv/install.sh | sh"
+ )
+ }
+
+ doLast {
+ val uvCheck = exec {
+ commandLine(uvExecutable.absolutePath, "--version")
+ isIgnoreExitValue = true
+ }
+ if (uvCheck.exitValue != 0) {
+ throw GradleException("UV installation failed")
+ }
+
+ project.extensions.extraProperties.set("uvExecutable", uvExecutable.absolutePath)
+ }
+ }
Review Comment:
> My concern is that a): Gradle may not have the permission to install;
This should not be a problem, the script will install `uv` with path `{mcp-server}/.uv` and the permission should be ok
b) User may want a different version.
Accordingly to the scripts, it seems that mcp-server will always use the latest version in the first compiling process.
I also have no preference about it.
--
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] [#7561] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2256505301
##########
mcp-server/README.md:
##########
@@ -0,0 +1,63 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+Gravitino MCP server provides the ability to manage Gravitino metadata for LLM.
+
+### Requirement:
+
+1. Python 3.10+
+2. uv is installed. You can install uv by following the [official guide](https://docs.astral.sh/uv/getting-started/installation/).
+
+### How to run:
+
+1. Clone the code from GitHub, and change to `mcp-server` directory
+2. Create virtual environment, `uv venv`
+3. Install the required Python packages. `uv pip install -e .`
+4. Add Gravitino MCP server to corresponding LLM tools, use local MCP server like:
Review Comment:
Yes, that is what I want to express. It will lower the threshold to use our MCP server for new comers.
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2256629769
##########
mcp-server/mcp_server/connector/rest/rest_client_schema_operation.py:
##########
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from httpx import AsyncClient
+
+from mcp_server.connector import SchemaOperation
+from mcp_server.connector.rest.utils import extract_content_from_response
+
+
+class RESTClientSchemaOperation(SchemaOperation):
+ def __init__(self, metalake_name: str, rest_client: AsyncClient):
+ self.metalake_name = metalake_name
+ self.rest_client = rest_client
+
+ async def get_list_of_schemas(self, catalog_name: str) -> str:
+ response = await self.rest_client.get(
+ f"/api/metalakes/{self.metalake_name}/catalogs/{catalog_name}/schemas"
+ )
+ return extract_content_from_response(response, "identifiers", [])
Review Comment:
The response only has `identifiers` and `code` fields
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#issuecomment-3158770708
> could
It's fine on my machine.
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2260145411
##########
mcp-server/mcp_server/connector/rest/rest_client_operation.py:
##########
@@ -0,0 +1,55 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import httpx
+
+from mcp_server.connector import (
+ CatalogOperation,
+ GravitinoOperation,
+ SchemaOperation,
+ TableOperation,
+)
+from mcp_server.connector.rest.rest_client_catalog_operation import (
+ RESTClientCatalogOperation,
+)
+from mcp_server.connector.rest.rest_client_schema_operation import (
+ RESTClientSchemaOperation,
+)
+from mcp_server.connector.rest.rest_client_table_operation import (
+ RESTClientTableOperation,
+)
+
+
+class RESTClientOperation(GravitinoOperation):
Review Comment:
OK
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#issuecomment-3166782061
@shaofengshi do you want to take another look?
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2256596862
##########
mcp-server/build.gradle.kts:
##########
@@ -0,0 +1,277 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.gradle.api.GradleException
+import org.gradle.api.tasks.Delete
+import org.gradle.api.tasks.Exec
+import org.gradle.kotlin.dsl.register
+import java.io.File
+
+val pythonProjectDir = project.projectDir
+val venvDir = pythonProjectDir.resolve(".venv")
+
+val globalUvExecutable = when {
+ System.getProperty("os.name").contains("win", ignoreCase = true) -> "uv.exe"
+ else -> "uv"
+}
+
+fun getUvExecutable(): String {
+ return if (project.extensions.extraProperties.has("uvExecutable")) {
+ project.extensions.extraProperties.get("uvExecutable") as String
+ } else {
+ globalUvExecutable
+ }
+}
+
+val venvPython = when {
+ System.getProperty("os.name").contains("win", ignoreCase = true) ->
+ venvDir.resolve("Scripts/python.exe").absolutePath
+ else ->
+ venvDir.resolve("bin/python").absolutePath
+}
+
+tasks {
+ register<Exec>("installUv") {
+ group = "python"
+ description = "Install UV if not present"
+
+ val isWindows = System.getProperty("os.name").contains("win", ignoreCase = true)
+ val uvInstallDir = file("$pythonProjectDir/.uv/bin").apply { mkdirs() }
+ val uvExecutable = if (isWindows) {
+ file("$uvInstallDir/uv.exe")
+ } else {
+ file("$uvInstallDir/uv")
+ }
+
+ onlyIf {
+ if (uvExecutable.exists()) {
+ project.extensions.extraProperties.set("uvExecutable", uvExecutable.absolutePath)
+ logger.lifecycle("UV already installed at: ${uvExecutable.absolutePath}")
+ false
+ } else {
+ try {
+ exec {
+ commandLine(globalUvExecutable, "--version")
+ isIgnoreExitValue = true
+ }.exitValue != 0
+ } catch (e: Exception) {
+ true
+ }
+ }
+ }
+
+ doFirst {
+ logger.lifecycle("UV not found, installing via official script...")
+ }
+
+ if (isWindows) {
+ commandLine(
+ "powershell",
+ "-Command",
+ "\$env:UV_INSTALL_DIR='${uvInstallDir.absolutePath}'; " +
+ "irm https://astral.sh/uv/install.ps1 | iex"
+ )
+ } else {
+ commandLine(
+ "/bin/sh",
+ "-c",
+ "export UV_INSTALL_DIR=${uvInstallDir.absolutePath}; " +
+ "curl -LsSf https://astral.sh/uv/install.sh | sh"
+ )
+ }
+
+ doLast {
+ val uvCheck = exec {
+ commandLine(uvExecutable.absolutePath, "--version")
+ isIgnoreExitValue = true
+ }
+ if (uvCheck.exitValue != 0) {
+ throw GradleException("UV installation failed")
+ }
+
+ project.extensions.extraProperties.set("uvExecutable", uvExecutable.absolutePath)
+ }
+ }
+
+ register<Exec>("createVenvWithUv") {
+ group = "python"
+ description = "Create Python virtual environment using UV"
+ dependsOn("installUv")
+ workingDir(pythonProjectDir)
+
+ doFirst {
+ println("UV executable path: ${getUvExecutable()}")
+ commandLine(getUvExecutable(), "venv", venvDir.absolutePath)
+ }
+
+ doLast {
+ if (executionResult.get().exitValue != 0) {
+ throw GradleException("Failed to create virtual environment with UV. Exit code: ${executionResult.get().exitValue}")
+ }
+
+ if (!File(venvPython).exists()) {
+ throw GradleException("Virtual environment creation failed. Python executable not found at: $venvPython")
+ }
+ }
+ }
+
+ register<Exec>("installDependenciesWithUv") {
+ group = "python"
+ description = "Install Python dependencies using global UV"
+ dependsOn("createVenvWithUv")
+ workingDir(pythonProjectDir)
+
+ doFirst {
+ commandLine(getUvExecutable(), "pip", "install", "--python", venvPython, "-e", ".")
+ }
+
+ doLast {
+ if (executionResult.get().exitValue != 0) {
+ throw GradleException("Failed to install dependencies. Exit code: ${executionResult.get().exitValue}")
+ }
+ }
+ }
+
+ register<Exec>("installFormatTools") {
+ group = "python"
+ description = "Install code formatting tools"
+ dependsOn("createVenvWithUv")
+ workingDir(pythonProjectDir)
+
+ doFirst {
+ commandLine(getUvExecutable(), "pip", "install", "--python", venvPython, "black", "isort")
+ }
+
+ doLast {
+ if (executionResult.get().exitValue != 0) {
+ throw GradleException("Failed to install formatting tools. Exit code: ${executionResult.get().exitValue}")
+ }
+ }
+ }
+
+ register("buildPython") {
+ group = "python"
+ description = "Build Python project"
+ dependsOn("installDependenciesWithUv")
+ doLast {
+ logger.lifecycle("Python project built successfully")
+ }
+ }
+
+ register<Exec>("testPython") {
+ group = "python"
+ description = "Run Python unit tests with unittest"
+ dependsOn("buildPython")
+ workingDir(pythonProjectDir)
+
+ commandLine(venvPython, "-m", "unittest", "discover", "-s", "tests", "-v")
+
+ doLast {
+ if (executionResult.get().exitValue != 0) {
+ throw GradleException("Unit tests failed. Exit code: ${executionResult.get().exitValue}")
+ }
+ }
+ }
+
+ register<Delete>("cleanPython") {
+ group = "python"
+ description = "Clean Python build artifacts"
+ delete(venvDir)
+ delete(pythonProjectDir.resolve(".uv"))
+ delete(pythonProjectDir.resolve("dist"))
+ delete(pythonProjectDir.resolve("build"))
+ delete(pythonProjectDir.resolve("*.egg-info"))
+ }
+
+ register<DefaultTask>("formatApplyPython") {
+ group = "python"
+ description = "Apply Black formatting and isort import sorting"
+ dependsOn("installFormatTools")
+
+ doLast {
+ // Apply isort
+ exec {
+ workingDir = pythonProjectDir
+ commandLine(venvPython, "-m", "isort", "mcp_server", "tests")
+ }
+
+ // Apply Black
+ exec {
+ workingDir = pythonProjectDir
+ commandLine(venvPython, "-m", "black", "mcp_server", "tests")
+ }
+
+ logger.lifecycle("Python formatting applied (isort + Black)")
+ }
+ }
+
+ register<DefaultTask>("formatCheckPython") {
+ group = "python"
+ description = "Check Python code formatting with Black and import order with isort"
+ dependsOn("installFormatTools")
+
+ doLast {
+ var anyFailed = false
+
+ val isortExitCode = exec {
+ workingDir = pythonProjectDir
+ commandLine(venvPython, "-m", "isort", "--check", "mcp_server", "tests")
+ isIgnoreExitValue = false
+ }.exitValue
+
+ if (isortExitCode != 0) {
+ throw GradleException("Python isort formatting check failed")
+ }
+
+ val blackExitCode = exec {
+ workingDir = pythonProjectDir
+ commandLine(venvPython, "-m", "black", "--check", "mcp_server", "tests")
+ isIgnoreExitValue = false
+ }.exitValue
+
+ if (blackExitCode != 0) {
+ throw GradleException("Python black formatting check failed")
+ anyFailed = true
Review Comment:
`anyFailed = true` anyFailed is never used.
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2259296967
##########
mcp-server/build.gradle.kts:
##########
@@ -0,0 +1,274 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.gradle.api.GradleException
+import org.gradle.api.tasks.Delete
+import org.gradle.api.tasks.Exec
+import org.gradle.kotlin.dsl.register
+import java.io.File
+
+val pythonProjectDir = project.projectDir
+val venvDir = pythonProjectDir.resolve(".venv")
+
+val globalUvExecutable = when {
+ System.getProperty("os.name").contains("win", ignoreCase = true) -> "uv.exe"
+ else -> "uv"
+}
+
+fun getUvExecutable(): String {
+ return if (project.extensions.extraProperties.has("uvExecutable")) {
+ project.extensions.extraProperties.get("uvExecutable") as String
+ } else {
+ globalUvExecutable
+ }
+}
+
+val venvPython = when {
+ System.getProperty("os.name").contains("win", ignoreCase = true) ->
+ venvDir.resolve("Scripts/python.exe").absolutePath
+ else ->
+ venvDir.resolve("bin/python").absolutePath
+}
+
+tasks {
+ register<Exec>("installUv") {
+ group = "python"
+ description = "Install UV if not present"
+
+ val isWindows = System.getProperty("os.name").contains("win", ignoreCase = true)
+ val uvInstallDir = file("$pythonProjectDir/.uv/bin").apply { mkdirs() }
+ val uvExecutable = if (isWindows) {
+ file("$uvInstallDir/uv.exe")
+ } else {
+ file("$uvInstallDir/uv")
+ }
+
+ onlyIf {
+ if (uvExecutable.exists()) {
+ project.extensions.extraProperties.set("uvExecutable", uvExecutable.absolutePath)
+ logger.lifecycle("UV already installed at: ${uvExecutable.absolutePath}")
+ false
+ } else {
+ try {
+ exec {
+ commandLine(globalUvExecutable, "--version")
+ isIgnoreExitValue = true
+ }.exitValue != 0
+ } catch (e: Exception) {
+ true
+ }
+ }
+ }
+
+ doFirst {
+ logger.lifecycle("UV not found, installing via official script...")
+ }
+
+ if (isWindows) {
+ commandLine(
+ "powershell",
+ "-Command",
+ "\$env:UV_INSTALL_DIR='${uvInstallDir.absolutePath}'; " +
+ "irm https://astral.sh/uv/install.ps1 | iex"
+ )
+ } else {
+ commandLine(
+ "/bin/sh",
+ "-c",
+ "export UV_INSTALL_DIR=${uvInstallDir.absolutePath}; " +
+ "curl -LsSf https://astral.sh/uv/install.sh | sh"
+ )
+ }
+
+ doLast {
+ val uvCheck = exec {
+ commandLine(uvExecutable.absolutePath, "--version")
+ isIgnoreExitValue = true
+ }
+ if (uvCheck.exitValue != 0) {
+ throw GradleException("UV installation failed")
+ }
+
+ project.extensions.extraProperties.set("uvExecutable", uvExecutable.absolutePath)
+ }
+ }
Review Comment:
What if I already installed a UV, will this install another one for me? Also, how about let user to install UV beforehand. My concern is that a): Gradle may not have the permission to install; b) User may want a different version.
I don't have a strong preference on it, just some thougts about it.
##########
mcp-server/build.gradle.kts:
##########
@@ -0,0 +1,274 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.gradle.api.GradleException
+import org.gradle.api.tasks.Delete
+import org.gradle.api.tasks.Exec
+import org.gradle.kotlin.dsl.register
+import java.io.File
+
+val pythonProjectDir = project.projectDir
+val venvDir = pythonProjectDir.resolve(".venv")
+
+val globalUvExecutable = when {
+ System.getProperty("os.name").contains("win", ignoreCase = true) -> "uv.exe"
+ else -> "uv"
+}
+
+fun getUvExecutable(): String {
+ return if (project.extensions.extraProperties.has("uvExecutable")) {
+ project.extensions.extraProperties.get("uvExecutable") as String
+ } else {
+ globalUvExecutable
+ }
+}
+
+val venvPython = when {
+ System.getProperty("os.name").contains("win", ignoreCase = true) ->
+ venvDir.resolve("Scripts/python.exe").absolutePath
+ else ->
+ venvDir.resolve("bin/python").absolutePath
+}
+
+tasks {
+ register<Exec>("installUv") {
+ group = "python"
+ description = "Install UV if not present"
+
+ val isWindows = System.getProperty("os.name").contains("win", ignoreCase = true)
+ val uvInstallDir = file("$pythonProjectDir/.uv/bin").apply { mkdirs() }
+ val uvExecutable = if (isWindows) {
+ file("$uvInstallDir/uv.exe")
+ } else {
+ file("$uvInstallDir/uv")
+ }
+
+ onlyIf {
+ if (uvExecutable.exists()) {
+ project.extensions.extraProperties.set("uvExecutable", uvExecutable.absolutePath)
+ logger.lifecycle("UV already installed at: ${uvExecutable.absolutePath}")
+ false
+ } else {
+ try {
+ exec {
+ commandLine(globalUvExecutable, "--version")
+ isIgnoreExitValue = true
+ }.exitValue != 0
+ } catch (e: Exception) {
+ true
+ }
+ }
+ }
+
+ doFirst {
+ logger.lifecycle("UV not found, installing via official script...")
+ }
+
+ if (isWindows) {
+ commandLine(
+ "powershell",
+ "-Command",
+ "\$env:UV_INSTALL_DIR='${uvInstallDir.absolutePath}'; " +
+ "irm https://astral.sh/uv/install.ps1 | iex"
+ )
+ } else {
+ commandLine(
+ "/bin/sh",
+ "-c",
+ "export UV_INSTALL_DIR=${uvInstallDir.absolutePath}; " +
+ "curl -LsSf https://astral.sh/uv/install.sh | sh"
+ )
+ }
+
+ doLast {
+ val uvCheck = exec {
+ commandLine(uvExecutable.absolutePath, "--version")
+ isIgnoreExitValue = true
+ }
+ if (uvCheck.exitValue != 0) {
+ throw GradleException("UV installation failed")
+ }
+
+ project.extensions.extraProperties.set("uvExecutable", uvExecutable.absolutePath)
+ }
+ }
Review Comment:
What if I already installed a UV, will this install another one for me? Also, how about let user to install UV beforehand. My concern is that a): Gradle may not have the permission to install; b) User may want a different version.
I don't have a strong preference on it, just some thoughts about it.
--
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] [#7561] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#issuecomment-3157854101
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mcp-server:checkSystemPython'.
> Python version 3.9 is too old. Requires Python >= 3.10. Found: Python 3.9.6
The module depends on the Python version installed on the compiling machine physicall, which is not user-friendly, I don't think it's easy to upgrade the python version of my Mac.
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2256805140
##########
mcp-server/build.gradle.kts:
##########
@@ -0,0 +1,277 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.gradle.api.GradleException
+import org.gradle.api.tasks.Delete
+import org.gradle.api.tasks.Exec
+import org.gradle.kotlin.dsl.register
+import java.io.File
+
+val pythonProjectDir = project.projectDir
+val venvDir = pythonProjectDir.resolve(".venv")
+
+val globalUvExecutable = when {
+ System.getProperty("os.name").contains("win", ignoreCase = true) -> "uv.exe"
+ else -> "uv"
+}
+
+fun getUvExecutable(): String {
+ return if (project.extensions.extraProperties.has("uvExecutable")) {
+ project.extensions.extraProperties.get("uvExecutable") as String
+ } else {
+ globalUvExecutable
+ }
+}
+
+val venvPython = when {
+ System.getProperty("os.name").contains("win", ignoreCase = true) ->
+ venvDir.resolve("Scripts/python.exe").absolutePath
+ else ->
+ venvDir.resolve("bin/python").absolutePath
+}
+
+tasks {
+ register<Exec>("installUv") {
+ group = "python"
+ description = "Install UV if not present"
+
+ val isWindows = System.getProperty("os.name").contains("win", ignoreCase = true)
+ val uvInstallDir = file("$pythonProjectDir/.uv/bin").apply { mkdirs() }
+ val uvExecutable = if (isWindows) {
+ file("$uvInstallDir/uv.exe")
+ } else {
+ file("$uvInstallDir/uv")
+ }
+
+ onlyIf {
+ if (uvExecutable.exists()) {
+ project.extensions.extraProperties.set("uvExecutable", uvExecutable.absolutePath)
+ logger.lifecycle("UV already installed at: ${uvExecutable.absolutePath}")
+ false
+ } else {
+ try {
+ exec {
+ commandLine(globalUvExecutable, "--version")
+ isIgnoreExitValue = true
+ }.exitValue != 0
+ } catch (e: Exception) {
+ true
+ }
+ }
+ }
+
+ doFirst {
+ logger.lifecycle("UV not found, installing via official script...")
+ }
+
+ if (isWindows) {
+ commandLine(
+ "powershell",
+ "-Command",
+ "\$env:UV_INSTALL_DIR='${uvInstallDir.absolutePath}'; " +
+ "irm https://astral.sh/uv/install.ps1 | iex"
+ )
+ } else {
+ commandLine(
+ "/bin/sh",
+ "-c",
+ "export UV_INSTALL_DIR=${uvInstallDir.absolutePath}; " +
+ "curl -LsSf https://astral.sh/uv/install.sh | sh"
+ )
+ }
+
+ doLast {
+ val uvCheck = exec {
+ commandLine(uvExecutable.absolutePath, "--version")
+ isIgnoreExitValue = true
+ }
+ if (uvCheck.exitValue != 0) {
+ throw GradleException("UV installation failed")
+ }
+
+ project.extensions.extraProperties.set("uvExecutable", uvExecutable.absolutePath)
+ }
+ }
+
+ register<Exec>("createVenvWithUv") {
+ group = "python"
+ description = "Create Python virtual environment using UV"
+ dependsOn("installUv")
+ workingDir(pythonProjectDir)
+
+ doFirst {
+ println("UV executable path: ${getUvExecutable()}")
+ commandLine(getUvExecutable(), "venv", venvDir.absolutePath)
+ }
+
+ doLast {
+ if (executionResult.get().exitValue != 0) {
+ throw GradleException("Failed to create virtual environment with UV. Exit code: ${executionResult.get().exitValue}")
+ }
+
+ if (!File(venvPython).exists()) {
+ throw GradleException("Virtual environment creation failed. Python executable not found at: $venvPython")
+ }
+ }
+ }
+
+ register<Exec>("installDependenciesWithUv") {
+ group = "python"
+ description = "Install Python dependencies using global UV"
+ dependsOn("createVenvWithUv")
+ workingDir(pythonProjectDir)
+
+ doFirst {
+ commandLine(getUvExecutable(), "pip", "install", "--python", venvPython, "-e", ".")
+ }
+
+ doLast {
+ if (executionResult.get().exitValue != 0) {
+ throw GradleException("Failed to install dependencies. Exit code: ${executionResult.get().exitValue}")
+ }
+ }
+ }
+
+ register<Exec>("installFormatTools") {
+ group = "python"
+ description = "Install code formatting tools"
+ dependsOn("createVenvWithUv")
+ workingDir(pythonProjectDir)
+
+ doFirst {
+ commandLine(getUvExecutable(), "pip", "install", "--python", venvPython, "black", "isort")
+ }
+
+ doLast {
+ if (executionResult.get().exitValue != 0) {
+ throw GradleException("Failed to install formatting tools. Exit code: ${executionResult.get().exitValue}")
+ }
+ }
+ }
+
+ register("buildPython") {
+ group = "python"
+ description = "Build Python project"
+ dependsOn("installDependenciesWithUv")
+ doLast {
+ logger.lifecycle("Python project built successfully")
+ }
+ }
+
+ register<Exec>("testPython") {
+ group = "python"
+ description = "Run Python unit tests with unittest"
+ dependsOn("buildPython")
+ workingDir(pythonProjectDir)
+
+ commandLine(venvPython, "-m", "unittest", "discover", "-s", "tests", "-v")
+
+ doLast {
+ if (executionResult.get().exitValue != 0) {
+ throw GradleException("Unit tests failed. Exit code: ${executionResult.get().exitValue}")
+ }
+ }
+ }
+
+ register<Delete>("cleanPython") {
+ group = "python"
+ description = "Clean Python build artifacts"
+ delete(venvDir)
+ delete(pythonProjectDir.resolve(".uv"))
+ delete(pythonProjectDir.resolve("dist"))
+ delete(pythonProjectDir.resolve("build"))
+ delete(pythonProjectDir.resolve("*.egg-info"))
+ }
+
+ register<DefaultTask>("formatApplyPython") {
+ group = "python"
+ description = "Apply Black formatting and isort import sorting"
+ dependsOn("installFormatTools")
+
+ doLast {
+ // Apply isort
+ exec {
+ workingDir = pythonProjectDir
+ commandLine(venvPython, "-m", "isort", "mcp_server", "tests")
+ }
+
+ // Apply Black
+ exec {
+ workingDir = pythonProjectDir
+ commandLine(venvPython, "-m", "black", "mcp_server", "tests")
+ }
+
+ logger.lifecycle("Python formatting applied (isort + Black)")
+ }
+ }
+
+ register<DefaultTask>("formatCheckPython") {
+ group = "python"
+ description = "Check Python code formatting with Black and import order with isort"
+ dependsOn("installFormatTools")
+
+ doLast {
+ var anyFailed = false
+
+ val isortExitCode = exec {
+ workingDir = pythonProjectDir
+ commandLine(venvPython, "-m", "isort", "--check", "mcp_server", "tests")
+ isIgnoreExitValue = false
+ }.exitValue
+
+ if (isortExitCode != 0) {
+ throw GradleException("Python isort formatting check failed")
+ }
+
+ val blackExitCode = exec {
+ workingDir = pythonProjectDir
+ commandLine(venvPython, "-m", "black", "--check", "mcp_server", "tests")
+ isIgnoreExitValue = false
+ }.exitValue
+
+ if (blackExitCode != 0) {
+ throw GradleException("Python black formatting check failed")
+ anyFailed = true
Review Comment:
removed
--
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] [#7561] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
FANNG1 commented on PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#issuecomment-3149742626
[uv.lock](https://github.com/apache/gravitino/pull/7905/files#diff-e55a83edf870925730735751614e4a26912314804cc14555ce069bb77533ce9f) and license header files eat up too much code line, the real code is several hundreds
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2259263223
##########
mcp-server/README.md:
##########
@@ -0,0 +1,64 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+Gravitino MCP server provides the ability to manage Gravitino metadata for LLM.
+
+### Requirement:
+
+1. Python 3.10+
+2. uv is installed. You can install uv by following the [official guide](https://docs.astral.sh/uv/getting-started/installation/).
+
+### How to run:
+
+1. Clone the code from GitHub, and change to `mcp-server` directory
+2. Create virtual environment, `uv venv`
+3. Install the required Python packages. `uv pip install -e .`
+4. Add Gravitino MCP server to corresponding LLM tools. Take `cursor` for example, edit `~/.cursor/mcp.json`, use following configuration for local Gravitino MCP server:
+
+```json
+{
+ "mcpServers": {
+ "gravitino": {
+ "command": "uv",
+ "args": [
+ "--directory",
+ "$path/mcp-server",
+ "run",
+ "mcp_server",
+ "--metalake",
+ "test",
+ "--uri",
+ "http://127.0.0.1:8090"
+ ]
+ }
+ }
+}
+```
+
+Or start HTTP MCP server by `uv run mcp_server --metalake test --uri http://127.0.0.1:8090 --transport http --mcp-url http://localhost:8000/mcp`, and use the configuration:
+
+```json
+{
+ "mcpServers": {
+ "gravitino": {
+ "url": "http://localhost:1234/mcp1"
+ }
+ }
+}
+```
Review Comment:
We can remove this readme doc, and use the one above.
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2261854877
##########
mcp-server/mcp_server/client/plain/rest_client_catalog_operation.py:
##########
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from httpx import AsyncClient
+
+from mcp_server.client import CatalogOperation
+from mcp_server.client.plain.utils import extract_content_from_response
+
+
+class PlainRESTClientCatalogOperation(CatalogOperation):
Review Comment:
Can you also rename the file to align with the class name here and below.
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2260121711
##########
mcp-server/mcp_server/connector/rest/rest_client_operation.py:
##########
@@ -0,0 +1,55 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import httpx
+
+from mcp_server.connector import (
+ CatalogOperation,
+ GravitinoOperation,
+ SchemaOperation,
+ TableOperation,
+)
+from mcp_server.connector.rest.rest_client_catalog_operation import (
+ RESTClientCatalogOperation,
+)
+from mcp_server.connector.rest.rest_client_schema_operation import (
+ RESTClientSchemaOperation,
+)
+from mcp_server.connector.rest.rest_client_table_operation import (
+ RESTClientTableOperation,
+)
+
+
+class RESTClientOperation(GravitinoOperation):
Review Comment:
Classes like `RESTClientSchemaOperation` are in the package `rest`, I'm going to rename it to `plain` and then rename package `connector` to `clients` , the current package structure is as follows:
<img width="546" height="418" alt="image" src="https://github.com/user-attachments/assets/8cdbf6a0-71b6-4453-a729-c68a5362f115" />
Would that be acceptable to you?
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2259756269
##########
mcp-server/mcp_server/connector/rest/rest_client_operation.py:
##########
@@ -0,0 +1,55 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import httpx
+
+from mcp_server.connector import (
+ CatalogOperation,
+ GravitinoOperation,
+ SchemaOperation,
+ TableOperation,
+)
+from mcp_server.connector.rest.rest_client_catalog_operation import (
+ RESTClientCatalogOperation,
+)
+from mcp_server.connector.rest.rest_client_schema_operation import (
+ RESTClientSchemaOperation,
+)
+from mcp_server.connector.rest.rest_client_table_operation import (
+ RESTClientTableOperation,
+)
+
+
+class RESTClientOperation(GravitinoOperation):
Review Comment:
This package uses plain rest protocol, can we rename this package to "plain", and all the class names to `PlainREST...`, `plain_rest_client...`
--
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] [#7561][#7909][#7912] feat(mcp): initial support for Gravitino MCP server [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #7905:
URL: https://github.com/apache/gravitino/pull/7905#discussion_r2259738594
##########
mcp-server/mcp_server/connector/factory.py:
##########
@@ -18,35 +18,35 @@
from mcp_server.connector.rest.rest_client_operation import RESTClientOperation
-class ConnectorFactory:
+class RESTClientFactory:
"""
- Factory for creating and configuring Gravitino connector instances.
+ Factory for creating and configuring Gravitino rest client instances.
"""
- _connector_class = RESTClientOperation
+ _rest_client_class = RESTClientOperation
Review Comment:
Should you also change the package name?
--
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