bharos opened a new issue, #12369:
URL: https://github.com/apache/gravitino/issues/12369

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   `--include-tool-tags` fails at startup for every tag value, so MCP tool 
filtering is unusable.
   
   `_create_gravitino_mcp` passes `include_tags` to the `FastMCP` constructor 
([server.py#L99-L110](https://github.com/apache/gravitino/blob/155ba1e53/mcp-server/mcp_server/server.py#L99-L110)),
 but `fastmcp` removed that argument and `pyproject.toml` pins 
`fastmcp==3.4.2`. Likely regressed in #11869 (fastmcp 3.2.0 → 3.4.2). The flag 
has no test coverage, so the unit suite stays green.
   
   ### Error message and/or stacktrace
   
   ```
     File "mcp_server/server.py", line 101, in _create_gravitino_mcp
       mcp = FastMCP(
     File "fastmcp/server/server.py", line 144, in _check_removed_kwargs
       raise TypeError(
   TypeError: FastMCP() no longer accepts `include_tags`. Use 
`server.enable(tags=..., only=True)` after creating the server.
   ```
   
   ### How to reproduce
   
   On main, from `mcp-server/`:
   
   ```bash
   python -m mcp_server --metalake demo --include-tool-tags catalog --transport 
stdio   # exits 1
   python -m mcp_server --metalake demo --transport stdio                       
        # starts fine
   ```
   
   The tag value doesn't matter — it fails before any tool is registered.
   
   ### Additional context
   
   The replacement API works:
   
   ```python
   mcp = FastMCP("Gravitino MCP Server", lifespan=...)
   if setting.tags:
       mcp.enable(tags=setting.tags, only=True)
   ```
   
   `enable(..., only=True)` is an allowlist transform applied when tools are 
listed, so it can be called before or after `load_tools()`. Applied locally, 
the server starts for every tag, filtering is correct (67 tools unfiltered, 2 
for `view`), and `black`/`pylint`/the 167 unit tests still pass.
   
   Happy to open a PR with the fix plus a regression test.
   


-- 
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