[ 
https://issues.apache.org/jira/browse/CAMEL-23948?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Federico Mariani updated CAMEL-23948:
-------------------------------------
    Attachment: LangChain4jAgentMcpToolProviderFilterTest.java

> camel-langchain4j-agent: mcpToolProviderFilter not applied to endpoint-level 
> MCP clients
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-23948
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23948
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-langchain4j-agent
>    Affects Versions: 4.21.0
>            Reporter: Federico Mariani
>            Priority: Major
>         Attachments: LangChain4jAgentMcpToolProviderFilterTest.java
>
>
> {{AgentConfiguration.withMcpToolProviderFilter(...)}} is honored for MCP 
> clients configured on the {{AgentConfiguration}} 
> ({{AbstractAgent.configureBuilder}}, lines 115-117), but *ignored* for MCP 
> clients configured at the endpoint level: 
> {{LangChain4jAgentProducer.createComposedToolProvider}} builds its 
> {{McpToolProvider}} without any filter (line 193), covering both the 
> {{mcpClients}} URI option and clients materialized from 
> {{mcpServer.<name>.*}} definitions.
> The same filter semantics should apply regardless of where the MCP client was 
> configured.
> *Fix*: apply the {{AgentConfiguration}} filter (when present) to the 
> producer-built {{McpToolProvider}} as well, or introduce an equivalent 
> endpoint-level filter option.
> Attached reproducer {{LangChain4jAgentMcpToolProviderFilterTest}} configures 
> a filter that rejects every MCP tool plus an endpoint-level MCP client 
> advertising one tool: the tool is still advertised to the LLM.
> Related: CAMEL-23928, CAMEL-23929.
> _This issue was drafted by Claude Code on behalf of Federico Mariani._



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to