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: [email protected]

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

Reply via email to