HonahX commented on code in PR #39: URL: https://github.com/apache/polaris-tools/pull/39#discussion_r2524852230
########## mcp-server/README.md: ########## @@ -0,0 +1,87 @@ +<!-- + 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. +--> + +# Apache Polaris MCP Server + +This package provides a Python implementation of the [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for Apache Polaris. It wraps the Polaris REST APIs so MCP-compatible clients (IDEs, agents, chat applications) can issue structured requests via JSON-RPC on stdin/stdout. + +The implementation is built on top of [FastMCP](https://gofastmcp.com) for streamlined server registration and transport handling. + +## Prerequisites +- Python 3.10 or later +- [uv](https://docs.astral.sh/uv/) Review Comment: Could we also include the version of uv here? It would be good to pin a version of the management tools to prevent compatibility issue due to upstream update ########## mcp-server/tests/test_namespace_tool.py: ########## @@ -0,0 +1,62 @@ +"""Unit tests for ``polaris_mcp.tools.namespace``.""" + +from __future__ import annotations + +import unittest Review Comment: It will be good if we could use `pytest` as it is a more complete test framework that have convenient `fixtures` and parametrization. Do you think we could have an issue for this? ########## mcp-server/polaris_mcp/tools/principal_role.py: ########## @@ -0,0 +1,245 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# 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. +# + +"""Principal role MCP tool.""" + +from __future__ import annotations + +import copy +from typing import Any, Dict, Optional, Set + +import urllib3 + +from ..authorization import AuthorizationProvider Review Comment: [nit] Could we use full path here to avoid confusion in the future? ########## mcp-server/pyproject.toml: ########## @@ -0,0 +1,48 @@ +# +# 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. +# + +[project] +name = "polaris-mcp" +version = "0.9.0" Review Comment: Curious, what's the plan for the package version. Is `1.0.0` the next version same as what polaris previously did? ########## mcp-server/pyproject.toml: ########## @@ -0,0 +1,48 @@ +# +# 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. +# + +[project] +name = "polaris-mcp" +version = "0.9.0" +description = "Apache Polaris Model Context Protocol server" +authors = [ + {name = "Apache Polaris Community", email = "[email protected]"} +] +readme = "README.md" +requires-python = ">=3.10,<4.0" +license = "Apache-2.0" +keywords = ["Apache Polaris", "Polaris", "Model Context Protocol"] +dependencies = [ + "fastmcp>=2.13.0.2", + "urllib3>=1.25.3,<3.0.0", +] + Review Comment: It will be good to add format and lint tools to this project, as those make collaboration easier. precommit + ruff would be a good option: https://github.com/apache/polaris/blob/main/client/python/.pre-commit-config.yaml We could create an issue and add that in a follow-up -- 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]
