pramodpatil812 opened a new issue, #257:
URL: https://github.com/apache/doris-mcp-server/issues/257

   On doris-mcp-server==1.0.0, a custom tool provider configured via 
MCP_TOOL_PROVIDERS (as described in 
[`docs/custom-tool-providers.md`](https://github.com/apache/doris-mcp-server/blob/1.0.0/docs/custom-tool-providers.md))
 is successfully discovered, validated, instantiated, and lifecycle-started, 
but its tools never appear in tools/list and are not callable via tools/call. 
This happens in both hierarchical and flat exposure modes. The 
custom-tool-provider feature therefore appears to be non-functional end-to-end 
in the published release.
   
   ### Environment
   1. doris-mcp-server==1.0.0 (latest on PyPI), installed on python:3.12-slim
   2. Transport: Streamable HTTP (--transport http)
   3. Exposure modes tested: default hierarchical and 
MCP_TOOL_EXPOSURE_MODE=flat
   4. A trusted provider package installed in the same environment, enabled via 
MCP_TOOL_PROVIDERS
   
   ### Expected behavior
   Per docs/custom-tool-providers.md: "FastGPT and other MCP clients discover 
the custom schema through tools/list and invoke it through tools/call." So a 
configured, installed provider's tools should appear in tools/list and be 
invocable.
   
   ### Actual behavior
   1. hierarchical mode: tools/list returns only the 8 built-in domain tools; 
the custom tool is absent.
   2. flat mode (MCP_TOOL_EXPOSURE_MODE=flat): tools/list returns exactly the 
55 built-in flat children; the custom tool is absent.
   3. The server starts healthy (no error), because the provider does load — 
it's just never surfaced.
   
   ### Minimal reproduction
   1. Create a trusted provider package implementing the documented contract (I 
used the OrdersApiProvider-style example from the docs, trimmed to one REST 
tool):
   
   ```
   # provider.py
   from __future__ import annotations
   from typing import Any
   import httpx
   from doris_mcp_server.tools import CustomTool, ToolRateLimit
   from mcp.types import Tool
   
   class RestTestProvider:
       name = "rest_test"
       def __init__(self) -> None:
           self._client: httpx.AsyncClient | None = None
       async def start(self) -> None:
           self._client = 
httpx.AsyncClient(base_url="https://jsonplaceholder.typicode.com";)
       async def close(self) -> None:
           if self._client:
               await self._client.aclose()
       def tools(self) -> tuple[CustomTool, ...]:
           return (CustomTool(
               tool=Tool(
                   name="lookup_sample_todo",
                   description="Fetch one sample TODO from a public REST API.",
                   
input_schema={"type":"object","properties":{"id":{"type":"integer","minimum":1,"maximum":200}},"required":["id"],"additionalProperties":False},
               ),
               handler=self._lookup, risk="low",
               rate_limit=ToolRateLimit(max_calls=10, period_seconds=1, 
scope="principal"),
           ),)
       async def _lookup(self, arguments: dict[str, Any]) -> dict[str, Any]:
           resp = await self._client.get(f"/todos/{arguments['id']}")
           resp.raise_for_status()
           return resp.json()
   
   def create_provider() -> RestTestProvider:
       return RestTestProvider()
   ```
   
   ```
   # pyproject.toml
   [project.entry-points."doris_mcp_server.tool_providers"]
   rest_test = "rest_test_pkg.provider:create_provider"
   ```
   
   2. pip install the package into the same env as the server.
   3. Start the server with MCP_TOOL_PROVIDERS=rest_test.
   4. Call tools/list (try both default and MCP_TOOL_EXPOSURE_MODE=flat).
   
   Result: lookup_sample_todo does not appear in either mode.
   
   ### Evidence the provider does load
   Running the server's own loader against the configured env inside the 
container returns the provider and its tool:
   
   ```
   import os
   from doris_mcp_server.tools.tool_provider import load_tool_providers
   names = [v.strip() for v in os.getenv("MCP_TOOL_PROVIDERS","").split(",") if 
v.strip()]
   print(load_tool_providers(names))
   # -> (LoadedToolProvider(name='rest_test', 
tools=(CustomTool(tool=Tool(name='lookup_sample_todo', ...)),)),)
   ```
   
   So discovery, validation, and instantiation all succeed — only exposure 
fails.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to